mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
Merge branch 'master' of supraverse.net:libpsyc
This commit is contained in:
commit
683e2ca09a
15 changed files with 27 additions and 16 deletions
13
README
13
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
|
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.
|
is primarily intended to be used for binding with other languages and frameworks.
|
||||||
|
|
||||||
Available bindings are located in include/<name> where name is the lanugage or
|
Available bindings are located in include/<name> where name is the language or
|
||||||
framework.
|
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 ==
|
== Directory Overview ==
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#ifndef PSYC_LIB_H
|
#ifndef PSYC_LIB_H
|
||||||
# define PSYC_LIB_H
|
# define PSYC_LIB_H
|
||||||
|
|
||||||
#include "../psyc.h"
|
#include <psyc.h>
|
||||||
#include "./debug.h"
|
#include "./debug.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "psyc/lib.h"
|
#include "lib.h"
|
||||||
|
|
||||||
int psyc_inherits(char* sho, size_t slen,
|
int psyc_inherits(char* sho, size_t slen,
|
||||||
char* lon, size_t llen) {
|
char* lon, size_t llen) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include <psyc/lib.h>
|
#include "lib.h"
|
||||||
#include <psyc/syntax.h>
|
#include <psyc/syntax.h>
|
||||||
#include <psyc/packet.h>
|
#include <psyc/packet.h>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <psyc/lib.h>
|
#include "lib.h"
|
||||||
#include <psyc/parser.h>
|
#include <psyc/parser.h>
|
||||||
|
|
||||||
#define ADVANCE_CURSOR_OR_RETURN(ret) \
|
#define ADVANCE_CURSOR_OR_RETURN(ret) \
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "psyc/lib.h"
|
#include "lib.h"
|
||||||
#include "psyc/render.h"
|
#include <psyc/render.h>
|
||||||
#include "psyc/syntax.h"
|
#include <psyc/syntax.h>
|
||||||
|
|
||||||
psycRenderRC psyc_renderList (psycList *list, char *buffer, size_t buflen)
|
psycRenderRC psyc_renderList (psycList *list, char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include <psyc/lib.h>
|
#include "lib.h"
|
||||||
#include <psyc/text.h>
|
#include <psyc/text.h>
|
||||||
|
|
||||||
psycTextRC psyc_text (psycTextState *state, psycTextCB getValue)
|
psycTextRC psyc_text (psycTextState *state, psycTextCB getValue)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include <psyc/lib.h>
|
#include "lib.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
/// Routing variables in alphabetical order.
|
/// Routing variables in alphabetical order.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
OPT = -O2
|
OPT = -O2
|
||||||
DEBUG = 2
|
DEBUG = 2
|
||||||
CFLAGS = -I../include -Wall -std=c99 ${OPT}
|
CFLAGS = -I../include -I../src -Wall -std=c99 ${OPT}
|
||||||
LDFLAGS = -L../lib
|
LDFLAGS = -L../lib
|
||||||
LOADLIBES = -lpsyc -lm
|
LOADLIBES = -lpsyc -lm
|
||||||
LOADLIBES_NET = ${LOADLIBES}
|
LOADLIBES_NET = ${LOADLIBES}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include "../include/psyc/lib.h"
|
#include <lib.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
unless (psyc_getVarType(PSYC_C2ARG("_list"))) return 1;
|
unless (psyc_getVarType(PSYC_C2ARG("_list"))) return 1;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include "../include/psyc/lib.h"
|
#include <lib.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "../include/psyc/lib.h"
|
#include <lib.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
if (psyc_matches(PSYC_C2ARG("_failure_delivery"), PSYC_C2ARG("_failure_unsuccessful_delivery_death"))) return 1;
|
if (psyc_matches(PSYC_C2ARG("_failure_delivery"), PSYC_C2ARG("_failure_unsuccessful_delivery_death"))) return 1;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <psyc/lib.h>
|
#include <lib.h>
|
||||||
#include <psyc/render.h>
|
#include <psyc/render.h>
|
||||||
#include <psyc/syntax.h>
|
#include <psyc/syntax.h>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <psyc/lib.h>
|
#include <lib.h>
|
||||||
#include <psyc/text.h>
|
#include <psyc/text.h>
|
||||||
|
|
||||||
#define BUFSIZE 512
|
#define BUFSIZE 512
|
||||||
|
|
Loading…
Reference in a new issue