~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.0.1/third_party/portaudio/src/common/pa_trace.c

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * $Id: pa_trace.c 1339 2008-02-15 07:50:33Z rossb $
3
 
 * Portable Audio I/O Library Trace Facility
4
 
 * Store trace information in real-time for later printing.
5
 
 *
6
 
 * Based on the Open Source API proposed by Ross Bencina
7
 
 * Copyright (c) 1999-2000 Phil Burk
8
 
 *
9
 
 * Permission is hereby granted, free of charge, to any person obtaining
10
 
 * a copy of this software and associated documentation files
11
 
 * (the "Software"), to deal in the Software without restriction,
12
 
 * including without limitation the rights to use, copy, modify, merge,
13
 
 * publish, distribute, sublicense, and/or sell copies of the Software,
14
 
 * and to permit persons to whom the Software is furnished to do so,
15
 
 * subject to the following conditions:
16
 
 *
17
 
 * The above copyright notice and this permission notice shall be
18
 
 * included in all copies or substantial portions of the Software.
19
 
 *
20
 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
 
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22
 
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23
 
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
24
 
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
25
 
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26
 
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
 
 */
28
 
 
29
 
/*
30
 
 * The text above constitutes the entire PortAudio license; however,
31
 
 * the PortAudio community also makes the following non-binding requests:
32
 
 *
33
 
 * Any person wishing to distribute modifications to the Software is
34
 
 * requested to send the modifications to the original developer so that
35
 
 * they can be incorporated into the canonical version. It is also
36
 
 * requested that these non-binding requests be included along with the
37
 
 * license above.
38
 
 */
39
 
 
40
 
/** @file
41
 
 @ingroup common_src
42
 
 
43
 
 @brief Real-time safe event trace logging facility for debugging.
44
 
*/
45
 
 
46
 
 
47
 
#include <stdio.h>
48
 
#include <stdlib.h>
49
 
#include <string.h>
50
 
#include "pa_trace.h"
51
 
 
52
 
#if PA_TRACE_REALTIME_EVENTS
53
 
 
54
 
static char *traceTextArray[PA_MAX_TRACE_RECORDS];
55
 
static int traceIntArray[PA_MAX_TRACE_RECORDS];
56
 
static int traceIndex = 0;
57
 
static int traceBlock = 0;
58
 
 
59
 
/*********************************************************************/
60
 
void PaUtil_ResetTraceMessages()
61
 
{
62
 
    traceIndex = 0;
63
 
}
64
 
 
65
 
/*********************************************************************/
66
 
void PaUtil_DumpTraceMessages()
67
 
{
68
 
    int i;
69
 
    int messageCount = (traceIndex < PA_MAX_TRACE_RECORDS) ? traceIndex : PA_MAX_TRACE_RECORDS;
70
 
 
71
 
    printf("DumpTraceMessages: traceIndex = %d\n", traceIndex );
72
 
    for( i=0; i<messageCount; i++ )
73
 
    {
74
 
        printf("%3d: %s = 0x%08X\n",
75
 
               i, traceTextArray[i], traceIntArray[i] );
76
 
    }
77
 
    PaUtil_ResetTraceMessages();
78
 
    fflush(stdout);
79
 
}
80
 
 
81
 
/*********************************************************************/
82
 
void PaUtil_AddTraceMessage( const char *msg, int data )
83
 
{
84
 
    if( (traceIndex == PA_MAX_TRACE_RECORDS) && (traceBlock == 0) )
85
 
    {
86
 
        traceBlock = 1;
87
 
        /*  PaUtil_DumpTraceMessages(); */
88
 
    }
89
 
    else if( traceIndex < PA_MAX_TRACE_RECORDS )
90
 
    {
91
 
        traceTextArray[traceIndex] = msg;
92
 
        traceIntArray[traceIndex] = data;
93
 
        traceIndex++;
94
 
    }
95
 
}
96
 
 
97
 
#endif /* TRACE_REALTIME_EVENTS */