mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
more work on the d binding
This commit is contained in:
parent
7a1b1f0e08
commit
d94c76012a
2 changed files with 6 additions and 8 deletions
|
@ -16,7 +16,9 @@
|
||||||
* etc...
|
* etc...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EPOCH = 1440444041 // 2015-08-24 21:20:41 CET (Monday)
|
module psyc.common;
|
||||||
|
|
||||||
|
const EPOCH = 1440444041; // 2015-08-24 21:20:41 CET (Monday)
|
||||||
|
|
||||||
extern (C):
|
extern (C):
|
||||||
|
|
||||||
|
@ -119,9 +121,6 @@ struct MatchVar
|
||||||
*/
|
*/
|
||||||
String newString (char *str, size_t strlen);
|
String newString (char *str, size_t strlen);
|
||||||
|
|
||||||
#define C2STR(_string) {sizeof(_string)-1, _string}
|
|
||||||
#define C2ARG(_string) _string, sizeof(_string)-1
|
|
||||||
|
|
||||||
/* intermediate struct for a PSYC variable modification */
|
/* intermediate struct for a PSYC variable modification */
|
||||||
struct Modifier
|
struct Modifier
|
||||||
{
|
{
|
||||||
|
@ -239,8 +238,7 @@ int matches(char *sho, size_t slen,
|
||||||
* number of bytes written. 0 is a legal return value. Should the
|
* number of bytes written. 0 is a legal return value. Should the
|
||||||
* callback return -1, text leaves the original template text as is.
|
* callback return -1, text leaves the original template text as is.
|
||||||
*/
|
*/
|
||||||
typedef int (*textCB)(char *match, size_t mlen,
|
alias extern (C) int function (char *match, size_t mlen, char **buffer, size_t *blen) textCB;
|
||||||
char **buffer, size_t *blen);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fills out text templates by asking a callback for content.
|
* Fills out text templates by asking a callback for content.
|
||||||
|
@ -255,7 +253,7 @@ typedef int (*textCB)(char *match, size_t mlen,
|
||||||
*
|
*
|
||||||
* See also http://about..eu/text
|
* See also http://about..eu/text
|
||||||
*/
|
*/
|
||||||
int text(char *template, size_t tlen,
|
int text(char *_template, size_t tlen,
|
||||||
char **buffer, size_t *blen,
|
char **buffer, size_t *blen,
|
||||||
textCB lookupValue,
|
textCB lookupValue,
|
||||||
char *braceOpen, char *braceClose);
|
char *braceOpen, char *braceClose);
|
|
@ -1,6 +1,6 @@
|
||||||
module psyc.parser;
|
module psyc.parser;
|
||||||
|
|
||||||
import psyc.psyc;
|
import psyc.common;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file d/psyc/parser.d
|
* @file d/psyc/parser.d
|
||||||
|
|
Loading…
Reference in a new issue