|
From: Johnny P. <ele...@us...> - 2004-10-01 04:07:17
|
Update of /cvsroot/xpanda/Panda/Framework-Library/MACOSX/Headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8297/MACOSX/Headers Modified Files: panda.h panda_h.h panda_modules.h Log Message: update Index: panda_h.h =================================================================== RCS file: /cvsroot/xpanda/Panda/Framework-Library/MACOSX/Headers/panda_h.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** panda_h.h 23 Apr 2004 14:28:33 -0000 1.8 --- panda_h.h 1 Oct 2004 04:06:59 -0000 1.9 *************** *** 174,177 **** --- 174,191 ---- int c_bool(P_BOOL the_p_bool); P_BOOL p_bool(int c_cond); + #ifdef PANDA_LOCK_MALLOC + inline static void *paLockMalloc(size_t size) { + void *res = malloc(size); + int err = mlock(res,size); + if(err!=0) PandaLog("Warining: cannot lock memory.\n"); + return res; + } + + inline static void paUlockFree(void *addr,size_t size) { + int err = munlock(addr,size); + if(err!=0) PandaLog("Warning: cannot unlock memory.\n"); + free(addr); + } + #endif Index: panda_modules.h =================================================================== RCS file: /cvsroot/xpanda/Panda/Framework-Library/MACOSX/Headers/panda_modules.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** panda_modules.h 23 Apr 2004 14:28:33 -0000 1.6 --- panda_modules.h 1 Oct 2004 04:06:59 -0000 1.7 *************** *** 49,52 **** --- 49,55 ---- }; + #define NO_AUDIO_OUTPUT -55 + #define AUDIO_OUTPUT 0 + typedef unsigned char P_BOOL; typedef unsigned char P_BYTE; *************** *** 131,134 **** --- 134,151 ---- extern int c_bool(P_BOOL the_p_bool); extern P_BOOL p_bool(int c_cond); + #ifdef PANDA_LOCK_MALLOC + inline static void *paLockMalloc(size_t size) { + void *res = malloc(size); + int err = mlock(res,size); + if(err!=0) PandaLog("Warning: cannot lock memory.\n"); + return res; + } + + inline static void paUlockFree(void *addr,size_t size) { + int err = munlock(addr,size); + if(err!=0) PandaLog("Warning: cannot unlock memory.\n"); + free(addr); + } + #endif //THREADS *************** *** 137,140 **** --- 154,238 ---- int changeThreadPriority(int ThreadReference,int priority); + // LIFOs AND FIFOs: + typedef struct _PaLifo { + void *obj_self; + struct _PaLifo *prev; + } PaLifo; + + #define PaLifoNEW(_q1) { \ + _q1 = (PaLifo*)malloc(sizeof(PaLifo)); \ + _q1->obj_self = NULL; \ + _q1->prev = NULL; \ + } + + #define PaLifoINIT(_q1,_q2) { \ + _q1 = (PaLifo*)malloc(sizeof(PaLifo)); \ + _q1->obj_self = (void*)_q2; \ + _q1->prev = NULL; \ + } + + #define PaLifoPUSH(_q,_puz) { \ + PaLifo *___q; \ + PaLifoINIT(___q,_puz); \ + ___q->prev = _q; \ + _q = ___q; \ + } + + #define PaLifoFRONT(_q) _q->obj_self + + #define PaLifoPOP(_q) { \ + PaLifo *___q; \ + if(_q->obj_self) { \ + ___q = _q->prev; \ + free(_q); \ + _q = ___q; \ + } \ + } + + + typedef struct _PaFifo { + void *obj_self; + struct _PaFifo *next; + struct _PaFifo *begin; + } PaFifo; + + #define PaFifoNEW(_q1) { \ + _q1 = (PaFifo*)malloc(sizeof(PaFifo)); \ + _q1->obj_self = NULL; \ + _q1->next = NULL; \ + _q1->begin = NULL; \ + } + + #define PaFifoINIT(_q1,__object) { \ + _q1 = (PaFifo*)malloc(sizeof(PaFifo)); \ + _q1->obj_self = (void*)__object; \ + _q1->next = NULL; \ + _q1->begin = NULL; \ + } + + #define PaFifoPUSH(__fifo,__obj_to_push) { \ + if(__fifo->begin) { \ + PaFifo *___q; \ + PaFifoINIT(___q,__obj_to_push); \ + __fifo->next = ___q; \ + ___q->begin = __fifo->begin; \ + __fifo = ___q; \ + } else { \ + __fifo->obj_self = __obj_to_push; \ + __fifo->next = NULL; \ + __fifo->begin = __fifo; \ + } \ + } + + #define PaFifoFRONT(__fifo) __fifo->begin->obj_self + + #define PaFifoPOP(__fifo) { \ + PaFifo *__b = __fifo->begin; \ + if(__b->next) { \ + __fifo->begin = __b->next; \ + free(__b); \ + } else __fifo->begin = NULL; \ + } + #ifdef __cplusplus } Index: panda.h =================================================================== RCS file: /cvsroot/xpanda/Panda/Framework-Library/MACOSX/Headers/panda.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** panda.h 23 Apr 2004 14:28:33 -0000 1.5 --- panda.h 1 Oct 2004 04:06:59 -0000 1.6 *************** *** 90,93 **** --- 90,109 ---- //-------------------------- + // Panda Timing/Sleep functions: + + enum { RES1_4,RES1_8,RES1_16,RES1_32,RES1_64,RES1_128 }; + + void Sleep_SetBPM(double bpm); + + double Sleep_GetBPM(); + + void Sleep_SetResolution(int res); + + int Sleep_GetResolution(); + + void Sleep_ForTicks(long ticks); + + //--------------------------- + // Panda such a Plugin stuff: |