diff options
Diffstat (limited to 'src/prot.h')
-rw-r--r-- | src/prot.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/prot.h b/src/prot.h new file mode 100644 index 0000000..a1ded3b --- /dev/null +++ b/src/prot.h @@ -0,0 +1,85 @@ +#pragma once + +struct prot; +typedef struct prot prot_t; + +#define MAXBUFLEN 2000 +#define MAXARGS 20 +#define FS ' ' +#define RS '\n' +#define ESC '\\' + + +extern +int +prot_create( + prot_t **prot +); + +extern +void +prot_destroy( + prot_t *prot +); + +extern +void +prot_reset( + prot_t *prot +); + +extern +int +prot_put( + prot_t *prot, + unsigned count, + const char **fields +); + +extern +int +prot_putx( + prot_t *prot, + ... +); + +extern +int +prot_should_write( + prot_t *prot +); + +extern +int +prot_write( + prot_t *prot, + int fdout +); + +extern +int +prot_can_read( + prot_t *prot +); + +extern +int +prot_read( + prot_t *prot, + int fdin +); + +extern +int +prot_get( + prot_t *prot, + const char ***fields +); + +extern +void +prot_next( + prot_t *prot +); + + |