~ubuntu-branches/ubuntu/lucid/lastfm/lucid

« back to all changes in this revision

Viewing changes to src/output/portAudio/PortAudio/common/pa_debugprint.h

  • Committer: Bazaar Package Importer
  • Author(s): Pedro Fragoso
  • Date: 2007-12-31 09:49:54 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071231094954-ix1amvcsj9pk61ya
Tags: 1:1.4.1.57486.dfsg-1ubuntu1
* Merge from Debian unstable (LP: #180254), remaining changes:
  - debian/rules;
    - Added dh_icons
  - Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef PA_LOG_H
2
 
#define PA_LOG_H
3
 
/*
4
 
 * Log file redirector function
5
 
 * Copyright (c) 1999-2006 Ross Bencina, Phil Burk
6
 
 *
7
 
 * Permission is hereby granted, free of charge, to any person obtaining
8
 
 * a copy of this software and associated documentation files
9
 
 * (the "Software"), to deal in the Software without restriction,
10
 
 * including without limitation the rights to use, copy, modify, merge,
11
 
 * publish, distribute, sublicense, and/or sell copies of the Software,
12
 
 * and to permit persons to whom the Software is furnished to do so,
13
 
 * subject to the following conditions:
14
 
 *
15
 
 * The above copyright notice and this permission notice shall be
16
 
 * included in all copies or substantial portions of the Software.
17
 
 *
18
 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
 
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
 
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21
 
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
22
 
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
23
 
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
 
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
 
 */
26
 
 
27
 
/*
28
 
 * The text above constitutes the entire PortAudio license; however,
29
 
 * the PortAudio community also makes the following non-binding requests:
30
 
 *
31
 
 * Any person wishing to distribute modifications to the Software is
32
 
 * requested to send the modifications to the original developer so that
33
 
 * they can be incorporated into the canonical version. It is also
34
 
 * requested that these non-binding requests be included along with the
35
 
 * license above.
36
 
 */
37
 
 
38
 
/** @file
39
 
 @ingroup common_src
40
 
*/
41
 
 
42
 
 
43
 
#ifdef __cplusplus
44
 
extern "C"
45
 
{
46
 
#endif /* __cplusplus */
47
 
 
48
 
 
49
 
 
50
 
void PaUtil_DebugPrint( const char *format, ... );
51
 
 
52
 
 
53
 
/*
54
 
    The basic format for log messages is described below. If you need to
55
 
    add any log messages, please follow this format.
56
 
 
57
 
    Function entry (void function):
58
 
 
59
 
        "FunctionName called.\n"
60
 
 
61
 
    Function entry (non void function):
62
 
 
63
 
        "FunctionName called:\n"
64
 
        "\tParam1Type param1: param1Value\n"
65
 
        "\tParam2Type param2: param2Value\n"      (etc...)
66
 
 
67
 
 
68
 
    Function exit (no return value):
69
 
 
70
 
        "FunctionName returned.\n"
71
 
 
72
 
    Function exit (simple return value):
73
 
 
74
 
        "FunctionName returned:\n"
75
 
        "\tReturnType: returnValue\n\n"
76
 
 
77
 
    If the return type is an error code, the error text is displayed in ()
78
 
 
79
 
    If the return type is not an error code, but has taken a special value
80
 
    because an error occurred, then the reason for the error is shown in []
81
 
 
82
 
    If the return type is a struct ptr, the struct is dumped.
83
 
 
84
 
    See the code below for examples
85
 
*/
86
 
 
87
 
/** PA_DEBUG() provides a simple debug message printing facility. The macro
88
 
 passes it's argument to a printf-like function called PaUtil_DebugPrint()
89
 
 which prints to stderr and always flushes the stream after printing.
90
 
 Because preprocessor macros cannot directly accept variable length argument
91
 
 lists, calls to the macro must include an additional set of parenthesis, eg:
92
 
 PA_DEBUG(("errorno: %d", 1001 ));
93
 
*/
94
 
 
95
 
 
96
 
#ifdef PA_ENABLE_DEBUG_OUTPUT
97
 
#define PA_DEBUG(x) PaUtil_DebugPrint x ;
98
 
#else
99
 
#define PA_DEBUG(x)
100
 
#endif
101
 
 
102
 
 
103
 
#ifdef PA_LOG_API_CALLS
104
 
#define PA_LOGAPI(x) PaUtil_DebugPrint x ;
105
 
#else
106
 
#define PA_LOGAPI(x)
107
 
#endif
108
 
 
109
 
    
110
 
typedef void (*PaUtilLogCallback ) (const char *log);
111
 
 
112
 
/**
113
 
    Install user provided log function
114
 
*/
115
 
void PaUtil_SetDebugPrintFunction(PaUtilLogCallback  cb);
116
 
 
117
 
 
118
 
 
119
 
#ifdef __cplusplus
120
 
}
121
 
#endif /* __cplusplus */
122
 
#endif /* PA_LOG_H */