1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00

death the parser

This commit is contained in:
psyc://psyced.org/~lynX 2011-05-09 09:02:15 +02:00
parent 26539cdd14
commit 36491b4886
12 changed files with 41 additions and 25 deletions

19
README
View file

@ -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).

View file

@ -17,7 +17,6 @@
*/
#ifndef PSYC_H
# define PSYC_H
#include <stdint.h>
#include <string.h>
@ -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

View file

@ -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}

View file

@ -1,5 +1,4 @@
#ifndef PSYC_PACKET_H
# define PSYC_PACKET_H
#include <psyc.h>
#include <psyc/syntax.h>
@ -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

View file

@ -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 <stdint.h>
#include <string.h>
#include <psyc.h>
@ -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

View file

@ -1,5 +1,4 @@
#ifndef PSYC_RENDER_H
# define PSYC_RENDER_H
#include <psyc/packet.h>
@ -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

View file

@ -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

View file

@ -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

View file

@ -4,8 +4,8 @@
# define PSYC_LIB_H
#include <psyc.h>
#include "./debug.h"
#include <assert.h>
#include "debug.h"
/* perlisms for readability */
#define unless(COND) if (!(COND))

View file

@ -6,7 +6,7 @@
#endif
#include "lib.h"
#include <psyc/parser.h>
#include <psyc/parse.h>
#define ADVANCE_CURSOR_OR_RETURN(ret) \
if (++(state->cursor) >= state->buffer.length) \

View file

@ -3,7 +3,7 @@
#include <fcntl.h>
#include <psyc.h>
#include <psyc/parser.h>
#include <psyc/parse.h>
int main (int argc, char **argv)
{

View file

@ -21,7 +21,7 @@
#include <assert.h>
#include <psyc.h>
#include <psyc/parser.h>
#include <psyc/parse.h>
#include <psyc/render.h>
#include <psyc/syntax.h>