diff --git a/README b/README index a814984..c709daa 100644 --- a/README +++ b/README @@ -10,9 +10,20 @@ See http://about.psyc.eu for information on PSYC in general. The plain C API located in the include/psyc directory along with the file psyc.h is primarily intended to be used for binding with other languages and frameworks. -Available bindings are located in include/ where name is the lanugage or +Available bindings are located in include/ where name is the language or framework. +== C API == + +The "plain C API" is a very low-level API intended to be used for bindings. +To access a certain module of the library, just include the according header +file from the psyc directory: + +parser.h -- parse psyc packets +render.h -- render psyc packets +text.h -- text template functions +packet.h -- structures for render.h and functions to initialize them +syntax.h -- definitions and constants related to parsing and rendering == Directory Overview == diff --git a/include/psyc/debug.h b/src/debug.h similarity index 100% rename from include/psyc/debug.h rename to src/debug.h diff --git a/include/psyc/lib.h b/src/lib.h similarity index 96% rename from include/psyc/lib.h rename to src/lib.h index dfa017b..ba7808c 100644 --- a/include/psyc/lib.h +++ b/src/lib.h @@ -3,7 +3,7 @@ #ifndef PSYC_LIB_H # define PSYC_LIB_H -#include "../psyc.h" +#include #include "./debug.h" #include diff --git a/src/match.c b/src/match.c index 22d6ced..7fc3c25 100644 --- a/src/match.c +++ b/src/match.c @@ -1,4 +1,4 @@ -#include "psyc/lib.h" +#include "lib.h" int psyc_inherits(char* sho, size_t slen, char* lon, size_t llen) { diff --git a/src/packet.c b/src/packet.c index aed1aa5..fe7c13e 100644 --- a/src/packet.c +++ b/src/packet.c @@ -1,4 +1,4 @@ -#include +#include "lib.h" #include #include diff --git a/src/parser.c b/src/parser.c index 4e50dce..b447750 100644 --- a/src/parser.c +++ b/src/parser.c @@ -5,7 +5,7 @@ #include #endif -#include +#include "lib.h" #include #define ADVANCE_CURSOR_OR_RETURN(ret) \ diff --git a/src/render.c b/src/render.c index 5990f4b..c0e0a77 100644 --- a/src/render.c +++ b/src/render.c @@ -1,6 +1,6 @@ -#include "psyc/lib.h" -#include "psyc/render.h" -#include "psyc/syntax.h" +#include "lib.h" +#include +#include psycRenderRC psyc_renderList (psycList *list, char *buffer, size_t buflen) { diff --git a/src/text.c b/src/text.c index 674890b..70a437b 100644 --- a/src/text.c +++ b/src/text.c @@ -1,4 +1,4 @@ -#include +#include "lib.h" #include psycTextRC psyc_text (psycTextState *state, psycTextCB getValue) diff --git a/src/variable.c b/src/variable.c index a30805d..a1e4845 100644 --- a/src/variable.c +++ b/src/variable.c @@ -1,4 +1,4 @@ -#include +#include "lib.h" #include /// Routing variables in alphabetical order. diff --git a/test/Makefile b/test/Makefile index 749fd75..8217eb5 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,6 +1,6 @@ OPT = -O2 DEBUG = 2 -CFLAGS = -I../include -Wall -std=c99 ${OPT} +CFLAGS = -I../include -I../src -Wall -std=c99 ${OPT} LDFLAGS = -L../lib LOADLIBES = -lpsyc -lm LOADLIBES_NET = ${LOADLIBES} diff --git a/test/getVarType.c b/test/getVarType.c index bdf6d3c..d0fd152 100644 --- a/test/getVarType.c +++ b/test/getVarType.c @@ -2,7 +2,7 @@ #include #include #include -#include "../include/psyc/lib.h" +#include int main() { unless (psyc_getVarType(PSYC_C2ARG("_list"))) return 1; diff --git a/test/isRoutingVar.c b/test/isRoutingVar.c index f2d0ceb..9c31685 100644 --- a/test/isRoutingVar.c +++ b/test/isRoutingVar.c @@ -2,7 +2,7 @@ #include #include #include -#include "../include/psyc/lib.h" +#include int main() { #if 0 diff --git a/test/testMatch.c b/test/testMatch.c index cdac58a..6874e14 100644 --- a/test/testMatch.c +++ b/test/testMatch.c @@ -1,5 +1,5 @@ #include -#include "../include/psyc/lib.h" +#include int main() { if (psyc_matches(PSYC_C2ARG("_failure_delivery"), PSYC_C2ARG("_failure_unsuccessful_delivery_death"))) return 1; diff --git a/test/testRender.c b/test/testRender.c index edfb798..1f1f61b 100644 --- a/test/testRender.c +++ b/test/testRender.c @@ -1,6 +1,6 @@ #include -#include +#include #include #include diff --git a/test/testText.c b/test/testText.c index e5aff36..21f732d 100644 --- a/test/testText.c +++ b/test/testText.c @@ -1,6 +1,6 @@ #include -#include +#include #include #define BUFSIZE 512