7 #if defined(HAVE_FOPENCOOKIE)
8 #define COOKIE_LEN_T size_t
9 #define COOKIE_RET_T ssize_t
11 #define COOKIE_LEN_T int
12 #define COOKIE_RET_T int
16 conf_read(void *cookie, char *buf, COOKIE_LEN_T size)
18 static int col = 0, row = 0;
20 const char *conf[] = defconfig;
25 if (!(conf[row])) /* end of rows */
27 if (!(conf[row][col])) { /* end of line */
32 buf[i++] = conf[row][col++];
37 #if defined(HAVE_FOPENCOOKIE)
38 static cookie_io_functions_t conf_cookie = {
44 FILE *conf_cookie_open(void)
46 return fopencookie(NULL, "r", conf_cookie);
48 #elif defined(HAVE_FUNOPEN)
49 FILE *conf_cookie_open(void)
51 return funopen(NULL, &conf_read, NULL, NULL, NULL);
54 FILE *conf_cookie_open(void) { return NULL; }