Home | History | Annotate | Download | only in b_BasicEm

Lines Matching refs:cpA

41 void bbs_Context_init( struct bbs_Context* cpA )
46 cpA->errStackE[ iL ].errorE = bbs_ERR_OK;
47 cpA->errStackE[ iL ].fileE[ 0 ] = 0;
48 cpA->errStackE[ iL ].lineE = 0;
49 cpA->errStackE[ iL ].textE[ 0 ] = 0;
52 cpA->errIndexE = 0;
54 bbs_MemTbl_init( cpA, &cpA->memTblE );
58 bbs_DynMemManager_init( cpA, &cpA->dynMemManagerArrE[ iL ] );
61 cpA->dynMemManagerArrSizeE = 0;
62 cpA->errorHandlerE = NULL;
63 cpA->callbackHandlerE = NULL;
64 cpA->userPtrE = NULL;
69 void bbs_Context_exit( struct bbs_Context* cpA )
74 cpA->errStackE[ iL ].errorE = bbs_ERR_OK;
75 cpA->errStackE[ iL ].fileE[ 0 ] = 0;
76 cpA->errStackE[ iL ].lineE = 0;
77 cpA->errStackE[ iL ].textE[ 0 ] = 0;
80 cpA->errIndexE = 0;
82 bbs_MemTbl_exit( cpA, &cpA->memTblE );
84 for( iL = 0; iL < cpA->dynMemManagerArrSizeE; iL++ )
86 bbs_DynMemManager_freeAll( cpA, &cpA->dynMemManagerArrE[ iL ] );
91 bbs_DynMemManager_exit( cpA, &cpA->dynMemManagerArrE[ iL ] );
94 cpA->dynMemManagerArrSizeE = 0;
95 cpA->errorHandlerE = NULL;
96 cpA->callbackHandlerE = NULL;
97 cpA->userPtrE = NULL;
110 void bbs_Context_copy( struct bbs_Context* cpA, const struct bbs_Context* srcPtrA )
112 bbs_ERROR0( "void bbs_Context_copy( struct bbs_Context* cpA, const struct bbs_Context* srcPtrA ):\n"
188 flag bbs_Context_pushError( struct bbs_Context* cpA, struct bbs_Error errorA )
191 if( cpA->errIndexE < bbs_CONTEXT_MAX_ERRORS )
193 cpA->errStackE[ cpA->errIndexE++ ] = errorA;
197 if( cpA->errorHandlerE != NULL )
199 cpA->errorHandlerE( cpA );
207 struct bbs_Error bbs_Context_popError( struct bbs_Context* cpA )
209 if( cpA->errIndexE > 0 )
211 return cpA->errStackE[ --( cpA->errIndexE ) ];
215 return cpA->errStackE[ 0 ];
221 struct bbs_Error bbs_Context_peekError( struct bbs_Context* cpA )
223 if( cpA->errIndexE > 0 )
225 return cpA->errStackE[ cpA->errIndexE - 1 ];
229 return cpA->errStackE[ 0 ];
235 flag bbs_Context_error( struct bbs_Context* cpA )
237 return cpA->errIndexE > 0;
242 bbs_errorFPtr bbs_Context_setErrorHandler( struct bbs_Context* cpA,
245 bbs_errorFPtr oldErrorHandlerL = cpA->errorHandlerE;
246 cpA->errorHandlerE = errorHandlerA;
252 void bbs_Context_doCallback( struct bbs_Context* cpA )
254 if( cpA->callbackHandlerE != NULL )
256 uint32 errorL = ( *cpA->callbackHandlerE )( cpA );
259 bbs_Context_pushError( cpA, bbs_Error_create( errorL, 0, NULL, NULL ) );
266 bbs_callbackFPtr bbs_Context_setCallbackHandler( struct bbs_Context* cpA,
269 bbs_callbackFPtr oldCallbackHandlerL = cpA->callbackHandlerE;
270 cpA->callbackHandlerE = callbackHandlerA;
277 void bbs_Context_addStaticSeg( struct bbs_Context* cpA,
288 if( sharedA && cpA->memTblE.ssSizeE == bbs_MAX_MEM_SEGS )
293 if( sharedA && cpA->memTblE.esSizeE == bbs_MAX_MEM_SEGS )
300 bbs_MemSeg_init( cpA, &memSegL );
310 cpA->memTblE.ssArrE[ cpA->memTblE.ssSizeE++ ] = memSegL;
314 cpA->memTblE.esArrE[ cpA->memTblE.esSizeE ] = memSegL;
315 cpA->memTblE.espArrE[ cpA->memTblE.esSizeE ] = &cpA->memTblE.esArrE[ cpA->memTblE.esSizeE ];
316 cpA->memTblE.esSizeE++;
325 void bbs_Context_addDynamicSeg( struct bbs_Context* cpA,
337 if( cpA->dynMemManagerArrSizeE == bbs_CONTEXT_MAX_MEM_MANAGERS )
342 if( sharedA && cpA->memTblE.ssSizeE == bbs_MAX_MEM_SEGS )
347 if( sharedA && cpA->memTblE.esSizeE == bbs_MAX_MEM_SEGS )
353 bbs_DynMemManager_init( cpA, &memManagerL );
357 cpA->dynMemManagerArrE[ cpA->dynMemManagerArrSizeE++ ] = memManagerL;
359 bbs_MemSeg_init( cpA, &memSegL );
365 memSegL.dynMemManagerPtrE = &cpA->dynMemManagerArrE[ cpA->dynMemManagerArrSizeE - 1 ];
369 cpA->memTblE.ssArrE[ cpA->memTblE.ssSizeE++ ] = memSegL;
373 cpA->memTblE.esArrE[ cpA->memTblE.esSizeE ] = memSegL;
374 cpA->memTblE.espArrE[ cpA->memTblE.esSizeE ] = &cpA->memTblE.esArrE[ cpA->memTblE.esSizeE ];
375 cpA->memTblE.esSizeE++;
381 uint32 bbs_Context_exclAllocSize( struct bbs_Context* cpA, uint32 segIndexA )
383 return bbs_MemSeg_allocatedSize( cpA, &cpA->memTblE.esArrE[ segIndexA ] );
388 uint32 bbs_Context_shrdAllocSize( struct bbs_Context* cpA, uint32 segIndexA )
390 return bbs_MemSeg_allocatedSize( cpA, &cpA->memTblE.ssArrE[ segIndexA ] );
395 void bbs_Context_quickInit( struct bbs_Context* cpA,
400 bbs_Context_init( cpA );
401 bbs_Context_addDynamicSeg( cpA, mallocFPtrA, freeFPtrA, FALSE, 0 );
402 bbs_Context_addDynamicSeg( cpA, mallocFPtrA, freeFPtrA, TRUE, 0 );
403 bbs_Context_setErrorHandler( cpA, errorHandlerA );