explicit (1) extern for func prototypes (2) parens in defines

This commit is contained in:
Joseph Poirier 2015-06-07 00:56:20 -05:00
parent 8964112c70
commit af9b423aaa
2 changed files with 133 additions and 133 deletions

View file

@ -24,7 +24,7 @@
#define MEM_ALIGN(x) (((x) + sizeof(ALIGN_TYPE) - 1) & ~(sizeof(ALIGN_TYPE)-1)) #define MEM_ALIGN(x) (((x) + sizeof(ALIGN_TYPE) - 1) & ~(sizeof(ALIGN_TYPE)-1))
#define GETS_BUF_MAX 256 #define GETS_BUF_MAX (256)
/* for debugging */ /* for debugging */
#define PRINT_SOURCE_POS ({ PrintSourceTextErrorLine(Parser->pc->CStdOut, Parser->FileName, Parser->SourceText, Parser->Line, Parser->CharacterPos); PlatformPrintf(Parser->pc->CStdOut, "\n"); }) #define PRINT_SOURCE_POS ({ PrintSourceTextErrorLine(Parser->pc->CStdOut, Parser->FileName, Parser->SourceText, Parser->Line, Parser->CharacterPos); PlatformPrintf(Parser->pc->CStdOut, "\n"); })
@ -42,8 +42,8 @@ typedef FILE IOFILE;
#define IS_FP(v) ((v)->Typ->Base == TypeFP) #define IS_FP(v) ((v)->Typ->Base == TypeFP)
#define FP_VAL(v) ((v)->Val->FP) #define FP_VAL(v) ((v)->Val->FP)
#else #else
#define IS_FP(v) 0 #define IS_FP(v) (0)
#define FP_VAL(v) 0 #define FP_VAL(v) (0)
#endif #endif
#define IS_POINTER_COERCIBLE(v, ap) ((ap) ? ((v)->Typ->Base == TypePointer) : 0) #define IS_POINTER_COERCIBLE(v, ap) ((ap) ? ((v)->Typ->Base == TypePointer) : 0)
@ -354,9 +354,9 @@ struct IncludeLibrary
struct IncludeLibrary *NextLib; struct IncludeLibrary *NextLib;
}; };
#define FREELIST_BUCKETS 8 /* freelists for 4, 8, 12 ... 32 byte allocs */ #define FREELIST_BUCKETS (8) /* freelists for 4, 8, 12 ... 32 byte allocs */
#define SPLIT_MEM_THRESHOLD 16 /* don't split memory which is close in size */ #define SPLIT_MEM_THRESHOLD (16) /* don't split memory which is close in size */
#define BREAKPOINT_TABLE_SIZE 21 #define BREAKPOINT_TABLE_SIZE (21)
/* the entire state of the picoc system */ /* the entire state of the picoc system */
@ -469,114 +469,114 @@ struct Picoc_Struct
}; };
/* table.c */ /* table.c */
void TableInit(Picoc *pc); extern void TableInit(Picoc *pc);
char *TableStrRegister(Picoc *pc, const char *Str); extern char *TableStrRegister(Picoc *pc, const char *Str);
char *TableStrRegister2(Picoc *pc, const char *Str, int Len); extern char *TableStrRegister2(Picoc *pc, const char *Str, int Len);
void TableInitTable(struct Table *Tbl, struct TableEntry **HashTable, int Size, int OnHeap); extern void TableInitTable(struct Table *Tbl, struct TableEntry **HashTable, int Size, int OnHeap);
int TableSet(Picoc *pc, struct Table *Tbl, char *Key, struct Value *Val, const char *DeclFileName, int DeclLine, int DeclColumn); extern int TableSet(Picoc *pc, struct Table *Tbl, char *Key, struct Value *Val, const char *DeclFileName, int DeclLine, int DeclColumn);
int TableGet(struct Table *Tbl, const char *Key, struct Value **Val, const char **DeclFileName, int *DeclLine, int *DeclColumn); extern int TableGet(struct Table *Tbl, const char *Key, struct Value **Val, const char **DeclFileName, int *DeclLine, int *DeclColumn);
struct Value *TableDelete(Picoc *pc, struct Table *Tbl, const char *Key); extern struct Value *TableDelete(Picoc *pc, struct Table *Tbl, const char *Key);
char *TableSetIdentifier(Picoc *pc, struct Table *Tbl, const char *Ident, int IdentLen); extern char *TableSetIdentifier(Picoc *pc, struct Table *Tbl, const char *Ident, int IdentLen);
void TableStrFree(Picoc *pc); extern void TableStrFree(Picoc *pc);
/* lex.c */ /* lex.c */
void LexInit(Picoc *pc); extern void LexInit(Picoc *pc);
void LexCleanup(Picoc *pc); extern void LexCleanup(Picoc *pc);
void *LexAnalyse(Picoc *pc, const char *FileName, const char *Source, int SourceLen, int *TokenLen); extern void *LexAnalyse(Picoc *pc, const char *FileName, const char *Source, int SourceLen, int *TokenLen);
void LexInitParser(struct ParseState *Parser, Picoc *pc, const char *SourceText, void *TokenSource, char *FileName, int RunIt, int SetDebugMode); extern void LexInitParser(struct ParseState *Parser, Picoc *pc, const char *SourceText, void *TokenSource, char *FileName, int RunIt, int SetDebugMode);
enum LexToken LexGetToken(struct ParseState *Parser, struct Value **Value, int IncPos); extern enum LexToken LexGetToken(struct ParseState *Parser, struct Value **Value, int IncPos);
enum LexToken LexRawPeekToken(struct ParseState *Parser); extern enum LexToken LexRawPeekToken(struct ParseState *Parser);
void LexToEndOfLine(struct ParseState *Parser); extern void LexToEndOfLine(struct ParseState *Parser);
void *LexCopyTokens(struct ParseState *StartParser, struct ParseState *EndParser); extern void *LexCopyTokens(struct ParseState *StartParser, struct ParseState *EndParser);
void LexInteractiveClear(Picoc *pc, struct ParseState *Parser); extern void LexInteractiveClear(Picoc *pc, struct ParseState *Parser);
void LexInteractiveCompleted(Picoc *pc, struct ParseState *Parser); extern void LexInteractiveCompleted(Picoc *pc, struct ParseState *Parser);
void LexInteractiveStatementPrompt(Picoc *pc); extern void LexInteractiveStatementPrompt(Picoc *pc);
/* parse.c */ /* parse.c */
/* the following are defined in picoc.h: /* the following are defined in picoc.h:
* void PicocParse(const char *FileName, const char *Source, int SourceLen, int RunIt, int CleanupNow, int CleanupSource); * void PicocParse(const char *FileName, const char *Source, int SourceLen, int RunIt, int CleanupNow, int CleanupSource);
* void PicocParseInteractive(); */ * void PicocParseInteractive(); */
void PicocParseInteractiveNoStartPrompt(Picoc *pc, int EnableDebugger); extern void PicocParseInteractiveNoStartPrompt(Picoc *pc, int EnableDebugger);
enum ParseResult ParseStatement(struct ParseState *Parser, int CheckTrailingSemicolon); extern enum ParseResult ParseStatement(struct ParseState *Parser, int CheckTrailingSemicolon);
struct Value *ParseFunctionDefinition(struct ParseState *Parser, struct ValueType *ReturnType, char *Identifier); extern struct Value *ParseFunctionDefinition(struct ParseState *Parser, struct ValueType *ReturnType, char *Identifier);
void ParseCleanup(Picoc *pc); extern void ParseCleanup(Picoc *pc);
void ParserCopyPos(struct ParseState *To, struct ParseState *From); extern void ParserCopyPos(struct ParseState *To, struct ParseState *From);
void ParserCopy(struct ParseState *To, struct ParseState *From); extern void ParserCopy(struct ParseState *To, struct ParseState *From);
/* expression.c */ /* expression.c */
int ExpressionParse(struct ParseState *Parser, struct Value **Result); extern int ExpressionParse(struct ParseState *Parser, struct Value **Result);
long ExpressionParseInt(struct ParseState *Parser); extern long ExpressionParseInt(struct ParseState *Parser);
void ExpressionAssign(struct ParseState *Parser, struct Value *DestValue, struct Value *SourceValue, int Force, const char *FuncName, int ParamNo, int AllowPointerCoercion); extern void ExpressionAssign(struct ParseState *Parser, struct Value *DestValue, struct Value *SourceValue, int Force, const char *FuncName, int ParamNo, int AllowPointerCoercion);
long ExpressionCoerceInteger(struct Value *Val); extern long ExpressionCoerceInteger(struct Value *Val);
unsigned long ExpressionCoerceUnsignedInteger(struct Value *Val); extern unsigned long ExpressionCoerceUnsignedInteger(struct Value *Val);
#ifndef NO_FP #ifndef NO_FP
double ExpressionCoerceFP(struct Value *Val); extern double ExpressionCoerceFP(struct Value *Val);
#endif #endif
/* type.c */ /* type.c */
void TypeInit(Picoc *pc); extern void TypeInit(Picoc *pc);
void TypeCleanup(Picoc *pc); extern void TypeCleanup(Picoc *pc);
int TypeSize(struct ValueType *Typ, int ArraySize, int Compact); extern int TypeSize(struct ValueType *Typ, int ArraySize, int Compact);
int TypeSizeValue(struct Value *Val, int Compact); extern int TypeSizeValue(struct Value *Val, int Compact);
int TypeStackSizeValue(struct Value *Val); extern int TypeStackSizeValue(struct Value *Val);
int TypeLastAccessibleOffset(Picoc *pc, struct Value *Val); extern int TypeLastAccessibleOffset(Picoc *pc, struct Value *Val);
int TypeParseFront(struct ParseState *Parser, struct ValueType **Typ, int *IsStatic); extern int TypeParseFront(struct ParseState *Parser, struct ValueType **Typ, int *IsStatic);
void TypeParseIdentPart(struct ParseState *Parser, struct ValueType *BasicTyp, struct ValueType **Typ, char **Identifier); extern void TypeParseIdentPart(struct ParseState *Parser, struct ValueType *BasicTyp, struct ValueType **Typ, char **Identifier);
void TypeParse(struct ParseState *Parser, struct ValueType **Typ, char **Identifier, int *IsStatic); extern void TypeParse(struct ParseState *Parser, struct ValueType **Typ, char **Identifier, int *IsStatic);
struct ValueType *TypeGetMatching(Picoc *pc, struct ParseState *Parser, struct ValueType *ParentType, enum BaseType Base, int ArraySize, const char *Identifier, int AllowDuplicates); extern struct ValueType *TypeGetMatching(Picoc *pc, struct ParseState *Parser, struct ValueType *ParentType, enum BaseType Base, int ArraySize, const char *Identifier, int AllowDuplicates);
struct ValueType *TypeCreateOpaqueStruct(Picoc *pc, struct ParseState *Parser, const char *StructName, int Size); extern struct ValueType *TypeCreateOpaqueStruct(Picoc *pc, struct ParseState *Parser, const char *StructName, int Size);
int TypeIsForwardDeclared(struct ParseState *Parser, struct ValueType *Typ); extern int TypeIsForwardDeclared(struct ParseState *Parser, struct ValueType *Typ);
/* heap.c */ /* heap.c */
void HeapInit(Picoc *pc, int StackSize); extern void HeapInit(Picoc *pc, int StackSize);
void HeapCleanup(Picoc *pc); extern void HeapCleanup(Picoc *pc);
void *HeapAllocStack(Picoc *pc, int Size); extern void *HeapAllocStack(Picoc *pc, int Size);
int HeapPopStack(Picoc *pc, void *Addr, int Size); extern int HeapPopStack(Picoc *pc, void *Addr, int Size);
void HeapUnpopStack(Picoc *pc, int Size); extern void HeapUnpopStack(Picoc *pc, int Size);
void HeapPushStackFrame(Picoc *pc); extern void HeapPushStackFrame(Picoc *pc);
int HeapPopStackFrame(Picoc *pc); extern int HeapPopStackFrame(Picoc *pc);
void *HeapAllocMem(Picoc *pc, int Size); extern void *HeapAllocMem(Picoc *pc, int Size);
void HeapFreeMem(Picoc *pc, void *Mem); extern void HeapFreeMem(Picoc *pc, void *Mem);
/* variable.c */ /* variable.c */
void VariableInit(Picoc *pc); extern void VariableInit(Picoc *pc);
void VariableCleanup(Picoc *pc); extern void VariableCleanup(Picoc *pc);
void VariableFree(Picoc *pc, struct Value *Val); extern void VariableFree(Picoc *pc, struct Value *Val);
void VariableTableCleanup(Picoc *pc, struct Table *HashTable); extern void VariableTableCleanup(Picoc *pc, struct Table *HashTable);
void *VariableAlloc(Picoc *pc, struct ParseState *Parser, int Size, int OnHeap); extern void *VariableAlloc(Picoc *pc, struct ParseState *Parser, int Size, int OnHeap);
void VariableStackPop(struct ParseState *Parser, struct Value *Var); extern void VariableStackPop(struct ParseState *Parser, struct Value *Var);
struct Value *VariableAllocValueAndData(Picoc *pc, struct ParseState *Parser, int DataSize, int IsLValue, struct Value *LValueFrom, int OnHeap); extern struct Value *VariableAllocValueAndData(Picoc *pc, struct ParseState *Parser, int DataSize, int IsLValue, struct Value *LValueFrom, int OnHeap);
struct Value *VariableAllocValueAndCopy(Picoc *pc, struct ParseState *Parser, struct Value *FromValue, int OnHeap); extern struct Value *VariableAllocValueAndCopy(Picoc *pc, struct ParseState *Parser, struct Value *FromValue, int OnHeap);
struct Value *VariableAllocValueFromType(Picoc *pc, struct ParseState *Parser, struct ValueType *Typ, int IsLValue, struct Value *LValueFrom, int OnHeap); extern struct Value *VariableAllocValueFromType(Picoc *pc, struct ParseState *Parser, struct ValueType *Typ, int IsLValue, struct Value *LValueFrom, int OnHeap);
struct Value *VariableAllocValueFromExistingData(struct ParseState *Parser, struct ValueType *Typ, union AnyValue *FromValue, int IsLValue, struct Value *LValueFrom); extern struct Value *VariableAllocValueFromExistingData(struct ParseState *Parser, struct ValueType *Typ, union AnyValue *FromValue, int IsLValue, struct Value *LValueFrom);
struct Value *VariableAllocValueShared(struct ParseState *Parser, struct Value *FromValue); extern struct Value *VariableAllocValueShared(struct ParseState *Parser, struct Value *FromValue);
struct Value *VariableDefine(Picoc *pc, struct ParseState *Parser, char *Ident, struct Value *InitValue, struct ValueType *Typ, int MakeWritable); extern struct Value *VariableDefine(Picoc *pc, struct ParseState *Parser, char *Ident, struct Value *InitValue, struct ValueType *Typ, int MakeWritable);
struct Value *VariableDefineButIgnoreIdentical(struct ParseState *Parser, char *Ident, struct ValueType *Typ, int IsStatic, int *FirstVisit); extern struct Value *VariableDefineButIgnoreIdentical(struct ParseState *Parser, char *Ident, struct ValueType *Typ, int IsStatic, int *FirstVisit);
int VariableDefined(Picoc *pc, const char *Ident); extern int VariableDefined(Picoc *pc, const char *Ident);
int VariableDefinedAndOutOfScope(Picoc *pc, const char *Ident); extern int VariableDefinedAndOutOfScope(Picoc *pc, const char *Ident);
void VariableRealloc(struct ParseState *Parser, struct Value *FromValue, int NewSize); extern void VariableRealloc(struct ParseState *Parser, struct Value *FromValue, int NewSize);
void VariableGet(Picoc *pc, struct ParseState *Parser, const char *Ident, struct Value **LVal); extern void VariableGet(Picoc *pc, struct ParseState *Parser, const char *Ident, struct Value **LVal);
void VariableDefinePlatformVar(Picoc *pc, struct ParseState *Parser, char *Ident, struct ValueType *Typ, union AnyValue *FromValue, int IsWritable); extern void VariableDefinePlatformVar(Picoc *pc, struct ParseState *Parser, char *Ident, struct ValueType *Typ, union AnyValue *FromValue, int IsWritable);
void VariableStackFrameAdd(struct ParseState *Parser, const char *FuncName, int NumParams); extern void VariableStackFrameAdd(struct ParseState *Parser, const char *FuncName, int NumParams);
void VariableStackFramePop(struct ParseState *Parser); extern void VariableStackFramePop(struct ParseState *Parser);
struct Value *VariableStringLiteralGet(Picoc *pc, char *Ident); extern struct Value *VariableStringLiteralGet(Picoc *pc, char *Ident);
void VariableStringLiteralDefine(Picoc *pc, char *Ident, struct Value *Val); extern void VariableStringLiteralDefine(Picoc *pc, char *Ident, struct Value *Val);
void *VariableDereferencePointer(struct ParseState *Parser, struct Value *PointerValue, struct Value **DerefVal, int *DerefOffset, struct ValueType **DerefType, int *DerefIsLValue); extern void *VariableDereferencePointer(struct ParseState *Parser, struct Value *PointerValue, struct Value **DerefVal, int *DerefOffset, struct ValueType **DerefType, int *DerefIsLValue);
int VariableScopeBegin(struct ParseState * Parser, int* PrevScopeID); extern int VariableScopeBegin(struct ParseState * Parser, int* PrevScopeID);
void VariableScopeEnd(struct ParseState * Parser, int ScopeID, int PrevScopeID); extern void VariableScopeEnd(struct ParseState * Parser, int ScopeID, int PrevScopeID);
/* clibrary.c */ /* clibrary.c */
void BasicIOInit(Picoc *pc); extern void BasicIOInit(Picoc *pc);
void LibraryInit(Picoc *pc); extern void LibraryInit(Picoc *pc);
void LibraryAdd(Picoc *pc, struct Table *GlobalTable, const char *LibraryName, struct LibraryFunction *FuncList); extern void LibraryAdd(Picoc *pc, struct Table *GlobalTable, const char *LibraryName, struct LibraryFunction *FuncList);
void CLibraryInit(Picoc *pc); extern void CLibraryInit(Picoc *pc);
void PrintCh(char OutCh, IOFILE *Stream); extern void PrintCh(char OutCh, IOFILE *Stream);
void PrintSimpleInt(long Num, IOFILE *Stream); extern void PrintSimpleInt(long Num, IOFILE *Stream);
void PrintInt(long Num, int FieldWidth, int ZeroPad, int LeftJustify, IOFILE *Stream); extern void PrintInt(long Num, int FieldWidth, int ZeroPad, int LeftJustify, IOFILE *Stream);
void PrintStr(const char *Str, IOFILE *Stream); extern void PrintStr(const char *Str, IOFILE *Stream);
void PrintFP(double Num, IOFILE *Stream); extern void PrintFP(double Num, IOFILE *Stream);
void PrintType(struct ValueType *Typ, IOFILE *Stream); extern void PrintType(struct ValueType *Typ, IOFILE *Stream);
void LibPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs); extern void LibPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs);
/* platform.c */ /* platform.c */
/* the following are defined in picoc.h: /* the following are defined in picoc.h:
@ -586,71 +586,71 @@ void LibPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct Valu
* void PicocCleanup(); * void PicocCleanup();
* void PicocPlatformScanFile(const char *FileName); * void PicocPlatformScanFile(const char *FileName);
* extern int PicocExitValue; */ * extern int PicocExitValue; */
void ProgramFail(struct ParseState *Parser, const char *Message, ...); extern void ProgramFail(struct ParseState *Parser, const char *Message, ...);
void ProgramFailNoParser(Picoc *pc, const char *Message, ...); extern void ProgramFailNoParser(Picoc *pc, const char *Message, ...);
void AssignFail(struct ParseState *Parser, const char *Format, struct ValueType *Type1, struct ValueType *Type2, int Num1, int Num2, const char *FuncName, int ParamNo); extern void AssignFail(struct ParseState *Parser, const char *Format, struct ValueType *Type1, struct ValueType *Type2, int Num1, int Num2, const char *FuncName, int ParamNo);
void LexFail(Picoc *pc, struct LexState *Lexer, const char *Message, ...); extern void LexFail(Picoc *pc, struct LexState *Lexer, const char *Message, ...);
void PlatformInit(Picoc *pc); extern void PlatformInit(Picoc *pc);
void PlatformCleanup(Picoc *pc); extern void PlatformCleanup(Picoc *pc);
char *PlatformGetLine(char *Buf, int MaxLen, const char *Prompt); extern char *PlatformGetLine(char *Buf, int MaxLen, const char *Prompt);
int PlatformGetCharacter(); extern int PlatformGetCharacter();
void PlatformPutc(unsigned char OutCh, union OutputStreamInfo *); extern void PlatformPutc(unsigned char OutCh, union OutputStreamInfo *);
void PlatformPrintf(IOFILE *Stream, const char *Format, ...); extern void PlatformPrintf(IOFILE *Stream, const char *Format, ...);
void PlatformVPrintf(IOFILE *Stream, const char *Format, va_list Args); extern void PlatformVPrintf(IOFILE *Stream, const char *Format, va_list Args);
void PlatformExit(Picoc *pc, int ExitVal); extern void PlatformExit(Picoc *pc, int ExitVal);
char *PlatformMakeTempName(Picoc *pc, char *TempNameBuffer); extern char *PlatformMakeTempName(Picoc *pc, char *TempNameBuffer);
void PlatformLibraryInit(Picoc *pc); extern void PlatformLibraryInit(Picoc *pc);
/* include.c */ /* include.c */
void IncludeInit(Picoc *pc); extern void IncludeInit(Picoc *pc);
void IncludeCleanup(Picoc *pc); extern void IncludeCleanup(Picoc *pc);
void IncludeRegister(Picoc *pc, const char *IncludeName, void (*SetupFunction)(Picoc *pc), struct LibraryFunction *FuncList, const char *SetupCSource); extern void IncludeRegister(Picoc *pc, const char *IncludeName, void (*SetupFunction)(Picoc *pc), struct LibraryFunction *FuncList, const char *SetupCSource);
void IncludeFile(Picoc *pc, char *Filename); extern void IncludeFile(Picoc *pc, char *Filename);
/* the following is defined in picoc.h: /* the following is defined in picoc.h:
* void PicocIncludeAllSystemHeaders(); */ * void PicocIncludeAllSystemHeaders(); */
#ifndef NO_DEBUGGER #ifndef NO_DEBUGGER
/* debug.c */ /* debug.c */
void DebugInit(); extern void DebugInit();
void DebugCleanup(); extern void DebugCleanup();
void DebugCheckStatement(struct ParseState *Parser); extern void DebugCheckStatement(struct ParseState *Parser);
#endif #endif
/* stdio.c */ /* stdio.c */
extern const char StdioDefs[]; extern const char StdioDefs[];
extern struct LibraryFunction StdioFunctions[]; extern struct LibraryFunction StdioFunctions[];
void StdioSetupFunc(Picoc *pc); extern void StdioSetupFunc(Picoc *pc);
/* math.c */ /* math.c */
extern struct LibraryFunction MathFunctions[]; extern struct LibraryFunction MathFunctions[];
void MathSetupFunc(Picoc *pc); extern void MathSetupFunc(Picoc *pc);
/* string.c */ /* string.c */
extern struct LibraryFunction StringFunctions[]; extern struct LibraryFunction StringFunctions[];
void StringSetupFunc(Picoc *pc); extern void StringSetupFunc(Picoc *pc);
/* stdlib.c */ /* stdlib.c */
extern struct LibraryFunction StdlibFunctions[]; extern struct LibraryFunction StdlibFunctions[];
void StdlibSetupFunc(Picoc *pc); extern void StdlibSetupFunc(Picoc *pc);
/* time.c */ /* time.c */
extern const char StdTimeDefs[]; extern const char StdTimeDefs[];
extern struct LibraryFunction StdTimeFunctions[]; extern struct LibraryFunction StdTimeFunctions[];
void StdTimeSetupFunc(Picoc *pc); extern void StdTimeSetupFunc(Picoc *pc);
/* errno.c */ /* errno.c */
void StdErrnoSetupFunc(Picoc *pc); extern void StdErrnoSetupFunc(Picoc *pc);
/* ctype.c */ /* ctype.c */
extern struct LibraryFunction StdCtypeFunctions[]; extern struct LibraryFunction StdCtypeFunctions[];
/* stdbool.c */ /* stdbool.c */
extern const char StdboolDefs[]; extern const char StdboolDefs[];
void StdboolSetupFunc(Picoc *pc); extern void StdboolSetupFunc(Picoc *pc);
/* unistd.c */ /* unistd.c */
extern const char UnistdDefs[]; extern const char UnistdDefs[];
extern struct LibraryFunction UnistdFunctions[]; extern struct LibraryFunction UnistdFunctions[];
void UnistdSetupFunc(Picoc *pc); extern void UnistdSetupFunc(Picoc *pc);
#endif /* INTERPRETER_H */ #endif /* INTERPRETER_H */

View file

@ -12,21 +12,21 @@
* #define WIN32 (predefined on MSVC) * #define WIN32 (predefined on MSVC)
*/ */
#define LARGE_INT_POWER_OF_TEN 1000000000 /* the largest power of ten which fits in an int on this architecture */ #define LARGE_INT_POWER_OF_TEN (1000000000) /* the largest power of ten which fits in an int on this architecture */
#if defined(__hppa__) || defined(__sparc__) #if defined(__hppa__) || defined(__sparc__)
#define ALIGN_TYPE double /* the default data type to use for alignment */ #define ALIGN_TYPE double /* the default data type to use for alignment */
#else #else
#define ALIGN_TYPE void * /* the default data type to use for alignment */ #define ALIGN_TYPE void * /* the default data type to use for alignment */
#endif #endif
#define GLOBAL_TABLE_SIZE 97 /* global variable table */ #define GLOBAL_TABLE_SIZE (97) /* global variable table */
#define STRING_TABLE_SIZE 97 /* shared string table size */ #define STRING_TABLE_SIZE (97) /* shared string table size */
#define STRING_LITERAL_TABLE_SIZE 97 /* string literal table size */ #define STRING_LITERAL_TABLE_SIZE (97) /* string literal table size */
#define RESERVED_WORD_TABLE_SIZE 97 /* reserved word table size */ #define RESERVED_WORD_TABLE_SIZE (97) /* reserved word table size */
#define PARAMETER_MAX 16 /* maximum number of parameters to a function */ #define PARAMETER_MAX (16) /* maximum number of parameters to a function */
#define LINEBUFFER_MAX 256 /* maximum number of characters on a line */ #define LINEBUFFER_MAX (256) /* maximum number of characters on a line */
#define LOCAL_TABLE_SIZE 11 /* size of local variable table (can expand) */ #define LOCAL_TABLE_SIZE (11) /* size of local variable table (can expand) */
#define STRUCT_TABLE_SIZE 11 /* size of struct/union member table (can expand) */ #define STRUCT_TABLE_SIZE (11) /* size of struct/union member table (can expand) */
#define INTERACTIVE_PROMPT_START "starting picoc " PICOC_VERSION "\n" #define INTERACTIVE_PROMPT_START "starting picoc " PICOC_VERSION "\n"
#define INTERACTIVE_PROMPT_STATEMENT "picoc> " #define INTERACTIVE_PROMPT_STATEMENT "picoc> "