#include #include #include #define TRUE (1 == 1) int main(void) { csb_buf *buf = csb_new_withstring("abcDEFghi"); int retval; if (buf == NULL) { return (1); } csb_rewind(buf); printf("buffer contains: %s, position %d\n", csb_cstring(buf), (int)csb_tellpos(buf)); if (csb_searchforward(buf, "DEF") == TRUE) { printf("\tFound DEF, position %d\n", (int)csb_tellpos(buf)); retval = 0; } else { printf("\tERROR: did not find DEF.\n"); retval = 1; } csb_destroy(buf); return (retval); }