char *strnupr (char *start, int n);
#if ! HAVE_MEMMEM /* GNU extension. */
-void *memmem (void const* haystack, int haystack_len,
+void *memmem (void const *haystack, int haystack_len,
void const *needle, int needle_len);
#endif /* HAVE_MEMMEM */
#include <libio.h>
#else
-#ifdef ALIAS_FILE_TO_FILECOOKIE
-
-#define cookie_io_functions_t le_cookie_io_functions_t
+#if 1 //! HAVE_FUNOPEN
+
+#define cookie_io_functions_t le_cookie_io_functions_t
typedef struct
{
ssize_t (*read) (void *, char *, size_t);
int (*close) (void *);
} cookie_io_functions_t;
+#else
+
+ typedef struct
+ {
+ int (*read) (void *, char *, int);
+ int (*write) (void *, char const *, int);
+ fpos_t (*seek) (void *, fpos_t, int);
+ int (*close) (void *);
+ } cookie_io_functions_t;
+
+#endif /* ! HAVE_FUNOPEN */
#endif /* ! HAVE_LIBIO_H */
FILE *fopencookie (void *cookie, char const *modes,
int handle_cookie_io_fprintf (FILE *file, char const *format, ...);
int handle_cookie_io_putc (int c, FILE *file);
-/* FIXME: ttftool uses fclose fopencookie fprintf and putc only... */
+ /* FIXME: ttftool uses fclose fopencookie fprintf and putc only. if
+ ALIAS_FILE_TO_FILECOOKIE, blondly redefine those functions
+ to wrappers that check for and handle Memory_out_stream. */
+#ifdef ALIAS_FILE_TO_FILECOOKIE
+
#define fclose handle_cookie_io_fclose
#define fprintf handle_cookie_io_fprintf
#ifdef putc
#undef putc
#endif
#define putc handle_cookie_io_putc
+
#endif /* ALIAS_FILE_TO_FILECOOKIE */
-
#endif /* ! HAVE_FUNOPEN */
-
#endif /* ! HAVE_FOPENCOOKIE */
#ifdef __cplusplus
} /* extern "C" */
#endif
+#if ! HAVE_MEMRCHR
unsigned char *memrchr (unsigned char const *p, int n, char c);
-unsigned char *strrev (unsigned char *byte, int length_i);
+#endif
+
+#if ! HAVE_MEMREV
+unsigned char *memrev (unsigned char *byte, int length_i);
+#endif
double my_round (double);