1 /* { dg-do compile } */
2 /* { dg-options "-w" } */
4 __extension__
typedef __SIZE_TYPE__
size_t;
5 typedef unsigned char __u_char
;
6 typedef unsigned short int __u_short
;
7 typedef unsigned int __u_int
;
8 typedef unsigned long int __u_long
;
9 typedef signed char __int8_t
;
10 typedef unsigned char __uint8_t
;
11 typedef signed short int __int16_t
;
12 typedef unsigned short int __uint16_t
;
13 typedef signed int __int32_t
;
14 typedef unsigned int __uint32_t
;
15 __extension__
typedef signed long long int __int64_t
;
16 __extension__
typedef unsigned long long int __uint64_t
;
17 __extension__
typedef long long int __quad_t
;
18 __extension__
typedef unsigned long long int __u_quad_t
;
19 __extension__
typedef __u_quad_t __dev_t
;
20 __extension__
typedef unsigned int __uid_t
;
21 __extension__
typedef unsigned int __gid_t
;
22 __extension__
typedef unsigned long int __ino_t
;
23 __extension__
typedef __u_quad_t __ino64_t
;
24 __extension__
typedef unsigned int __mode_t
;
25 __extension__
typedef unsigned int __nlink_t
;
26 __extension__
typedef long int __off_t
;
27 __extension__
typedef __quad_t __off64_t
;
28 __extension__
typedef int __pid_t
;
29 __extension__
typedef struct {
32 __extension__
typedef long int __clock_t
;
33 __extension__
typedef unsigned int __id_t
;
34 typedef struct _IO_FILE
FILE;
35 typedef struct _IO_FILE __FILE
;
52 typedef unsigned int _G_uint16_t
__attribute__ ((__mode__ (__HI__
)));
53 typedef struct _IO_FILE _IO_FILE
;
54 extern struct _IO_FILE_plus _IO_2_1_stderr_
;
55 extern int fputs (__const
char *__restrict __s
, FILE * __restrict __stream
);
56 extern char *strstr (__const
char *__haystack
, __const
char *__needle
)
57 __attribute__ ((__nonnull__ (1, 2)));
58 extern char *rindex (__const
char *__s
, int __c
) __attribute__ ((__nonnull__ (1)));
59 extern size_t strlen (__const
char *__s
) __attribute__ ((__nothrow__
))
60 __attribute__ ((__pure__
)) __attribute__ ((__nonnull__ (1)));
61 char *mystrlwr (char *string
);
62 char *m_replace_filename (const char *path
, const char *filename
);
77 static int _empty_count
;
78 extern char *_word_substitution
[256];
79 static void _output_sorted_nested_toc (TOC
** list
, unsigned int num_items
);
80 static char *_do_text_substitution (char *input
);
81 static int _toc_scmp (const void *e1
, const void *e2
)
83 TOC
*t1
= *((TOC
**) e1
);
84 TOC
*t2
= *((TOC
**) e2
);
85 return mystricmp (t1
->text
, t2
->text
);
87 static void _output_buffered_text (void) { if (_empty_count
) ; }
88 void _post_process_filename (char *filename
)
90 int code_scanning
= 0;
91 char *new_filename
, *p
;
93 FILE *f1
= 0, *f2
= 0;
94 if (!new_filename
|| strlen (new_filename
) < 2)
95 new_filename
[strlen (filename
) - 1] = 'x';
97 while ((line
= m_fgets (f1
)))
99 line
= _do_text_substitution (line
);
102 if (remove (filename
))
109 static void _close_html_file (FILE * file
)
112 for (f
= 0; _word_substitution
[f
]; f
++)
115 static __attribute__((always_inline
))
116 char * _do_text_substitution (char *input
)
118 int start
, end
, middle
, f
;
119 char *temp
, *found
, *reader
;
120 for (f
= 0; _word_substitution
[f
]; f
++)
123 while ((found
= strstr (reader
, _word_substitution
[f
])))
125 start
= found
- input
;
127 reader
= temp
+ start
+ middle
;