'OHRRPGCE - util.bi '(C) Copyright 1997-2006 James Paige and Hamster Republic Productions 'Please read LICENSE.txt for GPL License details and disclaimer of liability 'See README.txt for code docs and apologies for crappyness of this code ;) 'Auto-generated by MAKEBI from util.bas #IFNDEF UTIL_BI #DEFINE UTIL_BI declare function bound (n, lowest, highest) declare function large (n1, n2) declare function loopvar (var, min, max, inc) declare function small (n1, n2) declare function trimpath$ (filename$) declare function trimfilename$ (filename$) declare function trimextension$ (filename$) declare function justextension$ (filename$) declare function anycase$ (filename$) declare sub touchfile (filename$) declare function rotascii$ (s$, o) declare function escape_string(s as string, chars as string) as string declare function sign_string(n as integer, neg_str as string, zero_str as string, pos_str as string) as string declare function zero_default(n, zerocaption as string="default") as string 'also appears in udts.bi #ifndef Stack TYPE Stack pos as integer ptr bottom as integer ptr size as integer END TYPE #endif declare sub createstack (st as Stack) declare sub destroystack (st as Stack) declare sub checkoverflow (st as Stack, byval amount as integer = 1) #define pushs(stack, datum) *(stack).pos = (datum) : (stack).pos += 1 #define pops(stack, var) (stack).pos -= 1 : (var) = *(stack).pos 'read from a stack offset from the last push (eg. 0 is last int pushed, -1 is previous) #define reads(stack, off) stack.pos[(off) - 1] #define checkunderflow(stack, amount) ((stack).pos - (amount) < (stack).bottom) #ENDIF