#ifndef __SYNTAX_H__ #define __SYNTAX_H__ /* global syntax data - includes a character buffer, the nuumber of bytes it can hold, and the number of bytes currently stored in it. */ typedef struct sh_data sh_data; struct sh_data { char *buf; /* buffer for the syntax-highlighted code */ int len; /* number of bytes stored in the buffer */ int cap; /* capacity of the buffer in bytes */ }; /* function declarations */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* free and reset the contents of one of the global buffers */ void sh_reset ( sh_data *d ); /* concatentate a string onto a global buffer */ int sh_cats ( sh_data *d, const char *fmt, ... ); /* append a character to a global buffer */ int sh_catc ( sh_data *d, int c ); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __SYNTAX_H__ */