]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/libc-extension.hh
* flower/include/international.hh: Bugfix: include "string.hh".
[lilypond.git] / flower / include / libc-extension.hh
index 5ca5a1f579f576374ebd2652d203b3cf585d476b..3ee0fe426c09e6532dc27aced27900b02399fde9 100644 (file)
@@ -18,7 +18,7 @@ char *strnlwr (char *start, int n);
 char *strnupr (char *start, int n);
 
 #if ! HAVE_MEMMEM              /* GNU extension. */
-void *memmem (void consthaystack, int haystack_len,
+void *memmem (void const *haystack, int haystack_len,
              void const *needle, int needle_len);
 #endif /* HAVE_MEMMEM */
 
@@ -53,9 +53,9 @@ extern "C" {
 #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);
@@ -64,6 +64,17 @@ extern "C" {
     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,
@@ -75,7 +86,11 @@ extern "C" {
   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
@@ -83,18 +98,22 @@ extern "C" {
 #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);