diff --git a/README b/README index c709daa..64df3aa 100644 --- a/README +++ b/README @@ -19,11 +19,12 @@ 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 +psyc.h -- basic things for well-being +psyc/parse.h -- parse psyc packets +psyc/render.h -- render psyc packets +psyc/text.h -- text template functions +psyc/packet.h -- structures for render.h and functions to initialize them +psyc/syntax.h -- definitions and constants related to parsing and rendering == Directory Overview == @@ -70,3 +71,11 @@ developement room at == Licence == -- To be discussed -- + +== Style Wars == + +This source code should follow the http://about.psyc.eu/Indent conventions. + (if you have good reasons to use another style, discuss it on the + wiki page so that it becomes the general style convention for all + of us, not just for you). + diff --git a/include/psyc.h b/include/psyc.h index e1b39e8..c9b6e11 100644 --- a/include/psyc.h +++ b/include/psyc.h @@ -17,7 +17,6 @@ */ #ifndef PSYC_H -# define PSYC_H #include #include @@ -148,4 +147,5 @@ int psyc_inherits(char *sho, size_t slen, int psyc_matches(char *sho, size_t slen, char *lon, size_t llen); -#endif // PSYC_H +#define PSYC_H +#endif diff --git a/include/psyc/Makefile b/include/psyc/Makefile index 9733a9d..daad9c8 100644 --- a/include/psyc/Makefile +++ b/include/psyc/Makefile @@ -1,8 +1,10 @@ +# Why do we have a Makefile in the include directory? + prefix = /usr includedir = ${prefix}/include INSTALL = install -HEADERS = packet.h parser.h render.h syntax.h text.h +HEADERS = packet.h parse.h render.h syntax.h text.h install: ${HEADERS} diff --git a/include/psyc/packet.h b/include/psyc/packet.h index 350a418..becb0e4 100644 --- a/include/psyc/packet.h +++ b/include/psyc/packet.h @@ -1,5 +1,4 @@ #ifndef PSYC_PACKET_H -# define PSYC_PACKET_H #include #include @@ -143,4 +142,5 @@ psycPacket psyc_newRawPacket2 (psycModifier *routing, size_t routinglen, const char *content, size_t contentlen, psycPacketFlag flag); -#endif // PSYC_PACKET_H +#define PSYC_PACKET_H +#endif diff --git a/include/psyc/parser.h b/include/psyc/parse.h similarity index 99% rename from include/psyc/parser.h rename to include/psyc/parse.h index f9d5b89..d5c3146 100644 --- a/include/psyc/parser.h +++ b/include/psyc/parse.h @@ -1,5 +1,7 @@ +#ifndef PSYC_PARSE_H + /** - * @file psyc/parser.h + * @file psyc/parse.h * @brief Interface for various PSYC parser functions. * * All parsing functions and the definitions they use are @@ -108,9 +110,6 @@ /** @{ */ // begin of parser group -#ifndef PSYC_PARSER_H -# define PSYC_PARSER_H - #include #include #include @@ -411,6 +410,7 @@ psycParseRC psyc_parse (psycParseState *state, char *oper, psycParseListRC psyc_parseList (psycParseListState *state, psycString *name, psycString *value, psycString *elem); -#endif // PSYC_PARSER_H - /** @} */ // end of parser group + +#define PSYC_PARSE_H +#endif diff --git a/include/psyc/render.h b/include/psyc/render.h index 6b837da..a9b6b57 100644 --- a/include/psyc/render.h +++ b/include/psyc/render.h @@ -1,5 +1,4 @@ #ifndef PSYC_RENDER_H -# define PSYC_RENDER_H #include @@ -39,6 +38,7 @@ psycRenderRC psyc_render (psycPacket *packet, char *buffer, size_t buflen); */ psycRenderRC psyc_renderList (psycList *list, char *buffer, size_t buflen); -#endif // PSYC_RENDER_H - /** @} */ // end of render group + +#define PSYC_RENDER_H +#endif diff --git a/include/psyc/syntax.h b/include/psyc/syntax.h index 92aadb9..105d59e 100644 --- a/include/psyc/syntax.h +++ b/include/psyc/syntax.h @@ -1,5 +1,4 @@ #ifndef PSYC_SYNTAX_H -#define PSYC_SYNTAX_H #ifndef PSYC_LIST_SIZE_LIMIT # define PSYC_LIST_SIZE_LIMIT 404 @@ -42,4 +41,5 @@ #define PSYC_ROUTING_MERGE 2 #define PSYC_ROUTING_RENDER 4 -#endif /* PSYC_SYNTAX_H */ +#define PSYC_SYNTAX_H +#endif diff --git a/include/psyc/text.h b/include/psyc/text.h index dd9b180..5b964b3 100644 --- a/include/psyc/text.h +++ b/include/psyc/text.h @@ -1,3 +1,5 @@ +#ifndef PSYC_TEXT_H + /** * @file psyc/text.h * @brief Interface for text template rendering. @@ -157,3 +159,6 @@ size_t psyc_getTextBytesWritten (psycTextState *state) psycTextRC psyc_text (psycTextState *state, psycTextCB getValue); /** @} */ // end of text group + +#define PSYC_TEXT_H +#endif diff --git a/src/lib.h b/src/lib.h index ba7808c..637b082 100644 --- a/src/lib.h +++ b/src/lib.h @@ -4,8 +4,8 @@ # define PSYC_LIB_H #include -#include "./debug.h" #include +#include "debug.h" /* perlisms for readability */ #define unless(COND) if (!(COND)) diff --git a/src/parser.c b/src/parser.c index 2ec5a66..d11db10 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,7 +6,7 @@ #endif #include "lib.h" -#include +#include #define ADVANCE_CURSOR_OR_RETURN(ret) \ if (++(state->cursor) >= state->buffer.length) \ diff --git a/test/testParser.c b/test/testParser.c index 8634bcb..bbba26f 100644 --- a/test/testParser.c +++ b/test/testParser.c @@ -3,7 +3,7 @@ #include #include -#include +#include int main (int argc, char **argv) { diff --git a/test/testServer.c b/test/testServer.c index 4d15d68..620580f 100644 --- a/test/testServer.c +++ b/test/testServer.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include