2009-02-25 01:49:48 -05:00
|
|
|
/* all platform-specific includes and defines go in this file */
|
|
|
|
#ifndef PLATFORM_H
|
|
|
|
#define PLATFORM_H
|
|
|
|
|
|
|
|
/* configurable options */
|
|
|
|
#define UNIX_HOST /* select your host type */
|
|
|
|
#undef FLYINGFOX_HOST
|
|
|
|
#undef SURVEYOR_HOST
|
|
|
|
|
2009-02-28 15:38:16 -05:00
|
|
|
#ifndef SURVEYOR_HOST
|
2009-02-25 01:49:48 -05:00
|
|
|
#define HEAP_SIZE 16384 /* space for the heap and the stack */
|
2009-02-28 15:38:16 -05:00
|
|
|
#endif
|
2009-02-25 01:49:48 -05:00
|
|
|
#define LARGE_INT_POWER_OF_TEN 1000000000 /* the largest power of ten which fits in an int on this architecture */
|
|
|
|
#define ARCH_ALIGN_WORDSIZE sizeof(int) /* memory alignment boundary on this architecture */
|
|
|
|
|
2009-03-11 18:28:42 -04:00
|
|
|
#define GLOBAL_TABLE_SIZE 97 /* global variable table */
|
2009-02-25 01:49:48 -05:00
|
|
|
#define STRING_TABLE_SIZE 97 /* shared string table size */
|
2009-03-11 18:28:42 -04:00
|
|
|
#define STRING_LITERAL_TABLE_SIZE 97 /* string literal table size */
|
2009-02-25 01:49:48 -05:00
|
|
|
#define PARAMETER_MAX 16 /* maximum number of parameters to a function */
|
|
|
|
#define LINEBUFFER_MAX 256 /* maximum number of characters on a line */
|
|
|
|
#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) */
|
|
|
|
|
2009-03-08 19:03:59 -04:00
|
|
|
#define INTERACTIVE_PROMPT_START "starting picoc\n"
|
2009-03-08 20:07:44 -04:00
|
|
|
#define INTERACTIVE_PROMPT_STATEMENT "picoc> "
|
|
|
|
#define INTERACTIVE_PROMPT_LINE " > "
|
2009-03-07 23:26:28 -05:00
|
|
|
|
2009-03-31 07:08:29 -04:00
|
|
|
#define PlatformSetExitPoint() setjmp(ExitBuf)
|
|
|
|
|
2009-02-25 01:49:48 -05:00
|
|
|
/* host platform includes */
|
|
|
|
#ifdef UNIX_HOST
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <memory.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
2009-02-28 00:49:14 -05:00
|
|
|
#include <stdarg.h>
|
2009-03-07 23:26:28 -05:00
|
|
|
#include <setjmp.h>
|
2009-02-25 01:49:48 -05:00
|
|
|
#ifndef NO_FP
|
|
|
|
#include <math.h>
|
|
|
|
#endif
|
|
|
|
|
2009-03-31 07:08:29 -04:00
|
|
|
extern jmp_buf ExitBuf;
|
|
|
|
|
2009-02-25 01:49:48 -05:00
|
|
|
#else
|
|
|
|
# ifdef FLYINGFOX_HOST
|
|
|
|
|
|
|
|
# else
|
|
|
|
# ifdef SURVEYOR_HOST
|
|
|
|
# define NO_FP
|
|
|
|
# define NO_CTYPE
|
2009-03-12 16:44:50 -04:00
|
|
|
# define NO_HASH_INCLUDE
|
2009-03-03 02:01:45 -05:00
|
|
|
# include <cdefBF537.h>
|
2009-02-26 22:02:05 -05:00
|
|
|
# include "../string.h"
|
|
|
|
# include "../print.h"
|
2009-03-01 05:07:01 -05:00
|
|
|
# include "../srv.h"
|
2009-02-28 00:43:28 -05:00
|
|
|
# include "../setjmp.h"
|
|
|
|
# include "../stdarg.h"
|
2009-03-04 03:32:24 -05:00
|
|
|
# include "../colors.h"
|
|
|
|
# include "../neural.h"
|
2009-03-15 17:26:03 -04:00
|
|
|
# include "../gps.h"
|
2009-03-04 03:32:24 -05:00
|
|
|
# include "../i2c.h"
|
2009-02-25 01:49:48 -05:00
|
|
|
# define assert(x)
|
2009-03-08 20:07:44 -04:00
|
|
|
# undef INTERACTIVE_PROMPT_STATEMENT
|
|
|
|
# undef INTERACTIVE_PROMPT_LINE
|
|
|
|
# define INTERACTIVE_PROMPT_STATEMENT "> "
|
|
|
|
# define INTERACTIVE_PROMPT_LINE "- "
|
2009-02-25 01:49:48 -05:00
|
|
|
# endif
|
|
|
|
# endif
|
2009-04-03 23:11:12 -04:00
|
|
|
|
|
|
|
extern int ExitBuf[];
|
|
|
|
|
2009-02-25 01:49:48 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* PLATFORM_H */
|
|
|
|
|