int eno_setOSerror(int errnr) { #ifdef __TURBOC__ int eno; #endif DBG_ENTER("eno_setOSerror", Suppl_error) DBG_ARGUMENTS( ("errnr=%u", errnr) ) #ifdef __TURBOC__ if((unsigned)errnr > 88) { DBG_INFO( ("Errnr exceeds range") ) eno = EFAULT; } else { eno = _dosErrorToSV[errnr]; } errno = eno; DBG_RETURN_BI(_doserrno = errnr) #elif __WATCOMC__ __set_errno_dos(errnr); DBG_RETURN_I( errnr) #endif }
bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include <dos.h> #endif #include <portable.h> #include "mcb.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id: mcb_env.c,v 1.1 2006/06/17 03:25:05 blairdude Exp $"; #endif static int isEnvcomp(void *arg, word mcb) { return (isPSP(mcb) && mcb_env(mcb) == (unsigned)arg) ? mcb : 0; } int isEnv(const word mcb) { DBG_ENTER("isEnv", Suppl_mcb) DBG_ARGUMENTS( ("mcb=%u", mcb) ) DBG_RETURN_BI( mcb_walk(0, aF(isEnvcomp), (void*)MCB2SEG(mcb))) }
pr(erequistes): va(lue): 0: is no shell \item else: is a shell re(lated to): isMCB isPSP isEnv se(condary subsystems): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include <dos.h> #endif #include <portable.h> #include "mcb.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id: mcb_shel.c 1210 2006-06-17 03:25:06Z blairdude $"; #endif int isShell(const word mcb) { DBG_ENTER("isShell", Suppl_mcb) DBG_ARGUMENTS( ("mcb=%u", mcb) ) DBG_RETURN_BI( isPSP(mcb) && peekw(mcb, 0x16 + SEG_OFFSET) == MCB2SEG(mcb)) }
int StrUnquoteTokenAppend(const char **s, const STR_QUOTES * const quotes , char ** const dst) { const char *p; /* temp pointer into s */ size_t l; int ch; FLAG fullQuote; int endQuote; const char *q; DBG_ENTER("StrUnquoteToken", Suppl_dynstr) assert(quotes); assert(s); assert(dst); assert(!quotes->str_unpairyQuotes || strlen(quotes->str_unpairyQuotes) % 2 == 0); DBG_ARGUMENTS( ("str=\"%s\"", s) ) *dst = 0; if((p = *s) == 0 || (ch = *p) == 0) { DBG_RETURN_I(0) } if((l = Strspn(p, quotes->str_delimiters)) != 0) { /* Unquoted delimiter --> The token is a sequence of delimiters */ /** Warning: Possible incorrect assignment **/ DBG_RETURN_BI( (*dst = StrDupe(p, *s += l)) == 0) } fullQuote = endQuote = 0; do { if(endQuote) { /* within quoted string */ if(endQuote == ch) { /* end of quote reached */ endQuote = 0; continue; } if(!fullQuote && StrChr(quotes->str_singleQuotes, ch)) { /* A not-full quote does not quote single quotes --> regardless what the next character is (except NUL) it is appended to the string */ if((ch = *++p) == NUL) /* single quote @ EOS --> ign */ break; } } else if(StrChr(quotes->str_singleQuotes, ch)) { if((ch = *++p) == NUL) /* single quote @ EOS --> ign */ break; } else if(StrChr(quotes->str_pairyQuotes, ch)) { endQuote = ch; fullQuote = StrChr(quotes->str_fullQuotes, ch) != 0; continue; } else if((q = StrChr(quotes->str_unpairyQuotes, ch)) != 0 && (q - quotes->str_unpairyQuotes) % 2 == 0) { endQuote = q[1]; fullQuote = StrChr(quotes->str_fullQuotes, ch) != 0; continue; } else if(StrChr(quotes->str_delimiters, ch)) { /* Unquoted delimiter --> Stop here */ break; } if(!StrAppChr_(dst, ch)) { /* allocation error */ StrFree_(dst); DBG_RETURN_I(1) } } while((ch = *++p) != NUL); *s = p; DBG_RETURN_I(0) }
pr(erequistes): va(lue): 0: is no MCB\item else: is a MCB re(lated to): isPSP isEnv mcb_walk se(condary subsystems): bu(gs): co(mpilers): */ #include "initsupl.loc" #include <portable.h> #include "mcb.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id: mcb_is.c,v 1.1 2006/06/17 03:25:05 blairdude Exp $"; #endif static isMCBcomp(void *arg, word mcb) { return mcb == (unsigned)arg; } int isMCB(const word mcb) { DBG_ENTER("isMCB", Suppl_mcb) DBG_ARGUMENTS( ("mcb=%u", mcb) ) DBG_RETURN_BI( mcb_walk(0, aF(isMCBcomp), (void*)mcb)) }