Clapkit
Loading...
Searching...
No Matches
ckUtils.h File Reference
#include "ckMemory.h"
#include "dlmalloc.h"
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <stdarg.h>
#include <stdio.h>
#include <vector>

Go to the source code of this file.

Classes

class  CKProfilerData
 
class  CKScopeProfiler
 

Macros

#define __FILENAME__   __FILE__
 
#define CKMSToTicks(milliseconds)   ((int)((milliseconds) / 16.66))
 Convert milliseconds to ticks.
 
#define CKLog(s, ...)   __CKDebugLog(0, s __VA_OPT__(, ) __VA_ARGS__)
 Wrapper for logging.
 
#define CKDebugLog(l, s, ...)   __CKDebugLog(l, s __VA_OPT__(, ) __VA_ARGS__)
 
#define CKC2P(s)   __CKC2P(s, __func__, __LINE__, __FILENAME__)
 Convert a C-string to a Pascal-string.
 
#define CKP2C(s)   __CKP2C(s, __func__, __LINE__, __FILENAME__)
 Convert a Pascal-string to a C-String.
 
#define CKPROFILE   CKScopeProfiler __p(__PRETTY_FUNCTION__);
 

Functions

unsigned char * __CKC2P (const char *src, const char *func, int line, const char *file)
 
char * __CKP2C (const unsigned char *src, const char *func, int line, const char *file)
 
void __CKDebugLog (int level, const char *s,...)
 
void CKConsolePrint (const char *toPrint)
 
void CKPrintProfileData ()
 
void CKPrintExitDebugData ()
 
void __CKWriteToExitFile (const char *s,...)
 
bool CKHasAppearanceManager ()
 Checks if Appearance Manager is present (8.x+)
 
UInt32 CKMillis ()
 Return the number of milliseconds since computer booted up.
 

Variables

std::vector< CKProfilerData * > _profilerData
 
bool _profilerDataInit
 

Macro Definition Documentation

◆ __FILENAME__

#define __FILENAME__   __FILE__

◆ CKDebugLog

#define CKDebugLog (   l,
  s,
  ... 
)    __CKDebugLog(l, s __VA_OPT__(, ) __VA_ARGS__)

◆ CKLog

#define CKLog (   s,
  ... 
)    __CKDebugLog(0, s __VA_OPT__(, ) __VA_ARGS__)

Wrapper for logging.

CKLog("Hello! My value is %d", myval);
#define CKLog(s,...)
Wrapper for logging.
Definition ckUtils.h:45
Note
Only active if kCKAPPDEBUG defined.

◆ CKPROFILE

#define CKPROFILE   CKScopeProfiler __p(__PRETTY_FUNCTION__);

Function Documentation

◆ __CKC2P()

unsigned char * __CKC2P ( const char *  src,
const char *  func,
int  line,
const char *  file 
)

Convert a C-style string to Pascal string that most Macintosh Toolbox calls require.

◆ __CKDebugLog()

void __CKDebugLog ( int  level,
const char *  s,
  ... 
)

Print to console a warning, log or an error.

Level 0 => Log Level 1 => Warning Level 2 => Error Level 3 => Fatal Error

◆ __CKP2C()

char * __CKP2C ( const unsigned char *  src,
const char *  func,
int  line,
const char *  file 
)

Converts Pascal string to C string.

◆ __CKWriteToExitFile()

void __CKWriteToExitFile ( const char *  s,
  ... 
)

◆ CKConsolePrint()

void CKConsolePrint ( const char *  toPrint)

Print to wherever the OS expects us to print.

◆ CKPrintExitDebugData()

void CKPrintExitDebugData ( )

◆ CKPrintProfileData()

void CKPrintProfileData ( )

Variable Documentation

◆ _profilerData

std::vector<CKProfilerData*> _profilerData
extern

◆ _profilerDataInit

bool _profilerDataInit
extern