Playlist Generator  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines
CADebugPrintf.mm
Go to the documentation of this file.
00001 /*      Copyright © 2007 Apple Inc. All Rights Reserved.
00002         
00003         Disclaimer: IMPORTANT:  This Apple software is supplied to you by 
00004                         Apple Inc. ("Apple") in consideration of your agreement to the
00005                         following terms, and your use, installation, modification or
00006                         redistribution of this Apple software constitutes acceptance of these
00007                         terms.  If you do not agree with these terms, please do not use,
00008                         install, modify or redistribute this Apple software.
00009                         
00010                         In consideration of your agreement to abide by the following terms, and
00011                         subject to these terms, Apple grants you a personal, non-exclusive
00012                         license, under Apple's copyrights in this original Apple software (the
00013                         "Apple Software"), to use, reproduce, modify and redistribute the Apple
00014                         Software, with or without modifications, in source and/or binary forms;
00015                         provided that if you redistribute the Apple Software in its entirety and
00016                         without modifications, you must retain this notice and the following
00017                         text and disclaimers in all such redistributions of the Apple Software. 
00018                         Neither the name, trademarks, service marks or logos of Apple Inc. 
00019                         may be used to endorse or promote products derived from the Apple
00020                         Software without specific prior written permission from Apple.  Except
00021                         as expressly stated in this notice, no other rights or licenses, express
00022                         or implied, are granted by Apple herein, including but not limited to
00023                         any patent rights that may be infringed by your derivative works or by
00024                         other works in which the Apple Software may be incorporated.
00025                         
00026                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE
00027                         MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
00028                         THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
00029                         FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
00030                         OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
00031                         
00032                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
00033                         OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00034                         SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00035                         INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
00036                         MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
00037                         AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
00038                         STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
00039                         POSSIBILITY OF SUCH DAMAGE.
00040 */
00041 //==================================================================================================
00042 //      Includes
00043 //==================================================================================================
00044 
00045 //      Self Include
00046 #include "CADebugPrintf.h"
00047 
00048 #if     DEBUG || CoreAudio_Debug
00049 
00050         #if     TARGET_OS_WIN32
00051                 #include <stdarg.h>
00052                 #include <stdio.h>
00053                 #include <Windows.h>
00054                 extern "C"
00055                 int     CAWin32DebugPrintf(char* inFormat, ...)
00056                 {
00057                         char theMessage[1024];
00058                         va_list theArguments;
00059                         va_start(theArguments, inFormat);
00060                         _vsnprintf(theMessage, 1024, inFormat, theArguments);
00061                         va_end(theArguments);
00062                         OutputDebugString(theMessage);
00063                         return 0;
00064                 }
00065         #endif
00066         
00067         #if defined(CoreAudio_UseSideFile)
00068                 #include <unistd.h>
00069                 FILE* sDebugPrintfSideFile = NULL;
00070                 extern "C"
00071                 void OpenDebugPrintfSideFile()
00072                 {
00073                         if(sDebugPrintfSideFile == NULL)
00074                         {
00075                                 char theFileName[1024];
00076                                 snprintf(theFileName, sizeof(theFileName), CoreAudio_UseSideFile, getpid());
00077                                 sDebugPrintfSideFile = fopen(theFileName, "a+");
00078                                 DebugPrintfRtn(DebugPrintfFileComma "\n------------------------------\n");
00079                         }
00080                 }
00081         #endif
00082 
00083 #endif