/* Header file for RocketAware High Reuse High Compatibility Library librock/exec.h - - - - - - - - - - - - Copyright Notice - - - - - - - - - - - - Copyright 1998-2000 Forrest J. Cavalier III See http://www.rocketaware.com/librock/ for documentation and original copies of this software. This software shall be distributed with the implementation source code according to the license terms therein. License text in librock_LIDESC_HC=12440211096131f5976d36be0cddca4cd9152e45 */ #ifndef librock_INC_EXEC_H #define librock_INC_EXEC_H #include #ifdef __cplusplus extern "C" { #endif /**************************************************************/ int librock_avscan(int argc, const char * *argv, /* argument array */ const char *optKeys, /* blank separated list accepted options */ const char * *ppszOpt, /* Store pointer into optKeys of match*/ const char * *ppszValue); /* Store pointer to option value, if any */ /**************************************************************/ int librock_lockw(int *); int librock_unlockw(int *); /**************************************************************/ int librock_ITERbinsearch(long *pLow,long *pHigh,long side); /**************************************************************/ int librock_prsargv_split(const char *line, char ***argvp); void librock_prsargv_free(char ***argvp); char * librock_prsargv_glom(const char **av); /**************************************************************/ #ifdef librock_FILE void librock_dumpmem(librock_FILE *f,const char *p,int c); #endif #ifdef __cplusplus }; #endif #ifndef librock_DEBUG #define librock_TRACE_MARK(a) #define librock_TRACE_FN(a) #define librock_TRACE_FR(a,t) #define librock_TRACE_STRUCT_B() #define librock_TRACE_STRUCT_E() #define librock_TRACE_V_I(i) #define librock_TRACE_V_PSZ(p) #define librock_TRACE_V_MEM(p,c) #endif #include #ifndef librock_TRACE_MARK /* Caller has to #define or have a FILE *librock_ftrace in scope */ #define librock_TRACE_MARK(a) (librock_ftrace ? fprintf(librock_ftrace,"\n%s",a) : 0) #define librock_TRACE_FN(a) (librock_ftrace ?fprintf(librock_ftrace,"\n%s { ",a) : 0) #define librock_TRACE_FR(a,t) (librock_ftrace ?fprintf(librock_ftrace,"\n%s } %s = ",a,t) : 0) #define librock_TRACE_STRUCT_B() (librock_ftrace ?fprintf(librock_ftrace," [") : 0) #define librock_TRACE_STRUCT_E() (librock_ftrace ?fprintf(librock_ftrace," ]") : 0) #define librock_TRACE_V_I(i) (librock_ftrace ?fprintf(librock_ftrace," %d",i) : 0) #define librock_TRACE_V_MEM(p,c) librock_dumpmem(librock_ftrace,p,c) #define librock_TRACE_V_PSZ(p) librock_TRACE_V_MEM(p,strlen(p)) #endif #ifdef __cplusplus #define librock_PR_CRIT(a) (librock_pPR ? (librock_pPR)->Crit(a),0 : 0) #define librock_PR_ERROR(a) (librock_pPR ? (librock_pPR)->Error(a),0 : 0) #define librock_PR_ERRORINFO(a) (librock_pPR ? (librock_pPR)->ErrorInfo(a),0 : 0) #define librock_PR_TRACE(a) (librock_pPR ? (librock_pPR)->Trace(a),0 : 0) #define librock_PR_STATE(a) (librock_pPR ? (librock_pPR)->State(a),0 : 0) #define librock_PR_TRACE_SUB(a) librock_AutoState librock_pr_sub(librock_pPR,a) #ifdef librock_FILE class librock_CProgress { public: int m_bCrit; int m_bError; int m_bTrace; int m_bStepCompleted; int m_bState; int m_bSubstate; static const char *disable; static const char *enable; librock_FILE *m_f; public: librock_CProgress() { m_bCrit = 1; m_bError = 1; m_bTrace = 0; m_bStepCompleted = 0; m_bState = 0; m_bSubstate = 0; m_f = 0; } librock_CProgress(librock_FILE *f) { m_bCrit = 1; m_bError = 1; m_bTrace = 0; m_bStepCompleted = 0; m_bState = 0; m_bSubstate = 0; m_f = f; } virtual void Crit(const char *str); virtual void Error(const char *str); virtual void ErrorInfo(const char *str); virtual void Trace(const char *str); virtual void StepCompleted(long amt); virtual void State(const char *str); /* DEBUG: perhaps base versions at least copy it somewhere */ virtual void SubState(const char *str); }; #endif #endif #include #endif /* $Log: exec.h,v $ Revision 1.2 2002/03/22 04:21:57 forrest@mibsoftware.com rights=#1 Moved some decls to data.h. Revision 1.1 2002/03/22 04:12:30 forrest@mibsoftware.com rights=#1 Renamed. Was procede.h Revision 1.4 2002/03/18 19:33:59 forrest@mibsoftware.com rights=#1 librock_CProgress class decl. Revision 1.3 2002/02/10 03:20:12 forrest@mibsoftware.com rights=#1 Standardized chg log. space/tab cleanup. Revision 1.2 2002/01/29 04:40:03 forrest@mibsoftware.com rights=#1 Prep for publish. API clean up, TAB, space at eol removal Revision 1.1 2001/01/06 19:36:17 forrest@mibsoftware.com rights=#1 Initial import to CVS rights#1 Copyright (c) Forrest J Cavalier III d-b-a Mib Software rights#1 License text in librock_LIDESC_HC=12440211096131f5976d36be0cddca4cd9152e45 */