Skip to content

Commit

Permalink
Big reorganisation to make it easier to access picoc as a library.
Browse files Browse the repository at this point in the history
Also moved most internal header stuff to the new header interpreter.h.


git-svn-id: http://picoc.googlecode.com/svn/trunk@549 21eae674-98b7-11dd-bd71-f92a316d2d60
  • Loading branch information
zik.saleeba committed Feb 17, 2011
1 parent fbe799d commit b23d1e8
Show file tree
Hide file tree
Showing 30 changed files with 659 additions and 609 deletions.
1 change: 1 addition & 0 deletions clibrary.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "picoc.h"
#include "interpreter.h"

/* the picoc version string */
static const char *VersionString = NULL;
Expand Down
2 changes: 1 addition & 1 deletion cstdlib/ctype.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* string.h library for large systems - small embedded systems use clibrary.c instead */
#include <ctype.h>
#include "../picoc.h"
#include "../interpreter.h"

#ifndef BUILTIN_MINI_STDLIB

Expand Down
2 changes: 1 addition & 1 deletion cstdlib/errno.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* string.h library for large systems - small embedded systems use clibrary.c instead */
#include <errno.h>
#include "../picoc.h"
#include "../interpreter.h"

#ifndef BUILTIN_MINI_STDLIB

Expand Down
2 changes: 1 addition & 1 deletion cstdlib/math.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* stdio.h library for large systems - small embedded systems use clibrary.c instead */
#include "../picoc.h"
#include "../interpreter.h"

#ifndef BUILTIN_MINI_STDLIB
#ifndef NO_FP
Expand Down
2 changes: 1 addition & 1 deletion cstdlib/stdbool.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* string.h library for large systems - small embedded systems use clibrary.c instead */
#include "../picoc.h"
#include "../interpreter.h"

#ifndef BUILTIN_MINI_STDLIB

Expand Down
2 changes: 1 addition & 1 deletion cstdlib/stdio.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* stdio.h library for large systems - small embedded systems use clibrary.c instead */
#include <errno.h>
#include "../picoc.h"
#include "../interpreter.h"

#ifndef BUILTIN_MINI_STDLIB

Expand Down
2 changes: 1 addition & 1 deletion cstdlib/stdlib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* stdlib.h library for large systems - small embedded systems use clibrary.c instead */
#include "../picoc.h"
#include "../interpreter.h"

#ifndef BUILTIN_MINI_STDLIB

Expand Down
2 changes: 1 addition & 1 deletion cstdlib/string.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* string.h library for large systems - small embedded systems use clibrary.c instead */
#include "../picoc.h"
#include "../interpreter.h"

#ifndef BUILTIN_MINI_STDLIB

Expand Down
2 changes: 1 addition & 1 deletion cstdlib/time.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* string.h library for large systems - small embedded systems use clibrary.c instead */
#include <time.h>
#include "../picoc.h"
#include "../interpreter.h"

#ifndef BUILTIN_MINI_STDLIB

Expand Down
2 changes: 1 addition & 1 deletion cstdlib/unistd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <stdio.h>
#include <unistd.h>
#include <limits.h>
#include "../picoc.h"
#include "../interpreter.h"

#ifndef BUILTIN_MINI_STDLIB

Expand Down
2 changes: 1 addition & 1 deletion expression.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "picoc.h"
#include "interpreter.h"


/* whether evaluation is left to right for a given precedence level */
Expand Down
2 changes: 1 addition & 1 deletion heap.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* stack grows up from the bottom and heap grows down from the top of heap space */
#include "picoc.h"
#include "interpreter.h"

#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 */
Expand Down
7 changes: 4 additions & 3 deletions include.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "picoc.h"
#include "interpreter.h"

#ifndef NO_HASH_INCLUDE

Expand Down Expand Up @@ -62,7 +63,7 @@ void IncludeRegister(const char *IncludeName, void (*SetupFunction)(void), struc
}

/* include all of the system headers */
void IncludeAllSystemHeaders()
void PicocIncludeAllSystemHeaders()
{
struct IncludeLibrary *ThisInclude = IncludeLibList;

Expand Down Expand Up @@ -91,7 +92,7 @@ void IncludeFile(char *FileName)

/* parse the setup C source code - may define types etc. */
if (LInclude->SetupCSource != NULL)
Parse(FileName, LInclude->SetupCSource, strlen(LInclude->SetupCSource), TRUE, TRUE, FALSE);
PicocParse(FileName, LInclude->SetupCSource, strlen(LInclude->SetupCSource), TRUE, TRUE, FALSE);

/* set up the library functions */
if (LInclude->FuncList != NULL)
Expand All @@ -103,7 +104,7 @@ void IncludeFile(char *FileName)
}

/* not a predefined file, read a real file */
PlatformScanFile(FileName);
PicocPlatformScanFile(FileName);
}

#endif /* NO_HASH_INCLUDE */
Loading

0 comments on commit b23d1e8

Please sign in to comment.