textstyle.in.h (bison-3.8.1.tar.xz) | : | textstyle.in.h (bison-3.8.2.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <stddef.h> | #include <stddef.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <string.h> | #include <string.h> | |||
#include <unistd.h> | #include <unistd.h> | |||
#if HAVE_TCDRAIN | #if HAVE_TCDRAIN | |||
# include <termios.h> | # include <termios.h> | |||
#endif | #endif | |||
/* An __attribute__ __format__ specifier for a function that takes a format | ||||
string and arguments, where the format string directives are the ones | ||||
standardized by ISO C99 and POSIX. | ||||
_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD */ | ||||
/* __gnu_printf__ is supported in GCC >= 4.4. */ | ||||
#ifndef _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD | ||||
# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) | ||||
# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__ | ||||
# else | ||||
# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__ | ||||
# endif | ||||
#endif | ||||
/* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if | ||||
the entity is not used. The compiler should not warn if the entity is not | ||||
used. */ | ||||
#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED | ||||
# if 0 /* no GCC or clang version supports this yet */ | ||||
# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] | ||||
# elif defined __GNUC__ || defined __clang__ | ||||
# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__)) | ||||
# else | ||||
# define _GL_ATTRIBUTE_MAYBE_UNUSED | ||||
# endif | ||||
#endif | ||||
/* ----------------------------- From ostream.h ----------------------------- */ | /* ----------------------------- From ostream.h ----------------------------- */ | |||
/* Describes the scope of a flush operation. */ | /* Describes the scope of a flush operation. */ | |||
typedef enum | typedef enum | |||
{ | { | |||
/* Flushes buffers in this ostream_t. | /* Flushes buffers in this ostream_t. | |||
Use this value if you want to write to the underlying ostream_t. */ | Use this value if you want to write to the underlying ostream_t. */ | |||
FLUSH_THIS_STREAM = 0, | FLUSH_THIS_STREAM = 0, | |||
/* Flushes all buffers in the current process. | /* Flushes all buffers in the current process. | |||
Use this value if you want to write to the same target through a | Use this value if you want to write to the same target through a | |||
skipping to change at line 169 | skipping to change at line 195 | |||
/* ------------------------- From styled-ostream.h ------------------------- */ | /* ------------------------- From styled-ostream.h ------------------------- */ | |||
typedef ostream_t styled_ostream_t; | typedef ostream_t styled_ostream_t; | |||
#define styled_ostream_write_mem ostream_write_mem | #define styled_ostream_write_mem ostream_write_mem | |||
#define styled_ostream_flush ostream_flush | #define styled_ostream_flush ostream_flush | |||
#define styled_ostream_free ostream_free | #define styled_ostream_free ostream_free | |||
static inline void | static inline void | |||
styled_ostream_begin_use_class (styled_ostream_t stream _GL_UNUSED, | styled_ostream_begin_use_class (_GL_ATTRIBUTE_MAYBE_UNUSED styled_ostream_t stre | |||
const char *classname _GL_UNUSED) | am, | |||
_GL_ATTRIBUTE_MAYBE_UNUSED const char *classname | ||||
) | ||||
{ | { | |||
} | } | |||
static inline void | static inline void | |||
styled_ostream_end_use_class (styled_ostream_t stream _GL_UNUSED, | styled_ostream_end_use_class (_GL_ATTRIBUTE_MAYBE_UNUSED styled_ostream_t stream | |||
const char *classname _GL_UNUSED) | , | |||
_GL_ATTRIBUTE_MAYBE_UNUSED const char *classname) | ||||
{ | { | |||
} | } | |||
static inline const char * | static inline const char * | |||
styled_ostream_get_hyperlink_ref (styled_ostream_t stream _GL_UNUSED) | styled_ostream_get_hyperlink_ref (_GL_ATTRIBUTE_MAYBE_UNUSED styled_ostream_t st ream) | |||
{ | { | |||
return NULL; | return NULL; | |||
} | } | |||
static inline const char * | static inline const char * | |||
styled_ostream_get_hyperlink_id (styled_ostream_t stream _GL_UNUSED) | styled_ostream_get_hyperlink_id (_GL_ATTRIBUTE_MAYBE_UNUSED styled_ostream_t str eam) | |||
{ | { | |||
return NULL; | return NULL; | |||
} | } | |||
static inline void | static inline void | |||
styled_ostream_set_hyperlink (styled_ostream_t stream _GL_UNUSED, | styled_ostream_set_hyperlink (_GL_ATTRIBUTE_MAYBE_UNUSED styled_ostream_t stream | |||
const char *ref _GL_UNUSED, | , | |||
const char *id _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED const char *ref, | |||
_GL_ATTRIBUTE_MAYBE_UNUSED const char *id) | ||||
{ | { | |||
} | } | |||
static inline void | static inline void | |||
styled_ostream_flush_to_current_style (styled_ostream_t stream _GL_UNUSED) | styled_ostream_flush_to_current_style (_GL_ATTRIBUTE_MAYBE_UNUSED styled_ostream _t stream) | |||
{ | { | |||
} | } | |||
/* -------------------------- From file-ostream.h -------------------------- */ | /* -------------------------- From file-ostream.h -------------------------- */ | |||
typedef ostream_t file_ostream_t; | typedef ostream_t file_ostream_t; | |||
#define file_ostream_write_mem ostream_write_mem | #define file_ostream_write_mem ostream_write_mem | |||
#define file_ostream_flush ostream_flush | #define file_ostream_flush ostream_flush | |||
#define file_ostream_free ostream_free | #define file_ostream_free ostream_free | |||
skipping to change at line 227 | skipping to change at line 253 | |||
/* --------------------------- From fd-ostream.h --------------------------- */ | /* --------------------------- From fd-ostream.h --------------------------- */ | |||
typedef ostream_t fd_ostream_t; | typedef ostream_t fd_ostream_t; | |||
#define fd_ostream_write_mem ostream_write_mem | #define fd_ostream_write_mem ostream_write_mem | |||
#define fd_ostream_flush ostream_flush | #define fd_ostream_flush ostream_flush | |||
#define fd_ostream_free ostream_free | #define fd_ostream_free ostream_free | |||
static inline fd_ostream_t | static inline fd_ostream_t | |||
fd_ostream_create (int fd, const char *filename _GL_UNUSED, | fd_ostream_create (int fd, _GL_ATTRIBUTE_MAYBE_UNUSED const char *filename, | |||
bool buffered _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED bool buffered) | |||
{ | { | |||
if (fd == 1) | if (fd == 1) | |||
return stdout; | return stdout; | |||
else if (fd == 2) | else if (fd == 2) | |||
return stderr; | return stderr; | |||
else | else | |||
return fdopen (fd, "w"); | return fdopen (fd, "w"); | |||
} | } | |||
/* -------------------------- From term-ostream.h -------------------------- */ | /* -------------------------- From term-ostream.h -------------------------- */ | |||
skipping to change at line 274 | skipping to change at line 300 | |||
UNDERLINE_DEFAULT = UNDERLINE_OFF | UNDERLINE_DEFAULT = UNDERLINE_OFF | |||
} term_underline_t; | } term_underline_t; | |||
typedef ostream_t term_ostream_t; | typedef ostream_t term_ostream_t; | |||
#define term_ostream_write_mem ostream_write_mem | #define term_ostream_write_mem ostream_write_mem | |||
#define term_ostream_flush ostream_flush | #define term_ostream_flush ostream_flush | |||
#define term_ostream_free ostream_free | #define term_ostream_free ostream_free | |||
static inline term_color_t | static inline term_color_t | |||
term_ostream_get_color (term_ostream_t stream _GL_UNUSED) | term_ostream_get_color (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream) | |||
{ | { | |||
return COLOR_DEFAULT; | return COLOR_DEFAULT; | |||
} | } | |||
static inline void | static inline void | |||
term_ostream_set_color (term_ostream_t stream _GL_UNUSED, | term_ostream_set_color (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream, | |||
term_color_t color _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED term_color_t color) | |||
{ | { | |||
} | } | |||
static inline term_color_t | static inline term_color_t | |||
term_ostream_get_bgcolor (term_ostream_t stream _GL_UNUSED) | term_ostream_get_bgcolor (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream) | |||
{ | { | |||
return COLOR_DEFAULT; | return COLOR_DEFAULT; | |||
} | } | |||
static inline void | static inline void | |||
term_ostream_set_bgcolor (term_ostream_t stream _GL_UNUSED, | term_ostream_set_bgcolor (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream, | |||
term_color_t color _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED term_color_t color) | |||
{ | { | |||
} | } | |||
static inline term_weight_t | static inline term_weight_t | |||
term_ostream_get_weight (term_ostream_t stream _GL_UNUSED) | term_ostream_get_weight (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream) | |||
{ | { | |||
return WEIGHT_DEFAULT; | return WEIGHT_DEFAULT; | |||
} | } | |||
static inline void | static inline void | |||
term_ostream_set_weight (term_ostream_t stream _GL_UNUSED, | term_ostream_set_weight (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream, | |||
term_weight_t weight _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED term_weight_t weight) | |||
{ | { | |||
} | } | |||
static inline term_posture_t | static inline term_posture_t | |||
term_ostream_get_posture (term_ostream_t stream _GL_UNUSED) | term_ostream_get_posture (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream) | |||
{ | { | |||
return POSTURE_DEFAULT; | return POSTURE_DEFAULT; | |||
} | } | |||
static inline void | static inline void | |||
term_ostream_set_posture (term_ostream_t stream _GL_UNUSED, | term_ostream_set_posture (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream, | |||
term_posture_t posture _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED term_posture_t posture) | |||
{ | { | |||
} | } | |||
static inline term_underline_t | static inline term_underline_t | |||
term_ostream_get_underline (term_ostream_t stream _GL_UNUSED) | term_ostream_get_underline (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream) | |||
{ | { | |||
return UNDERLINE_DEFAULT; | return UNDERLINE_DEFAULT; | |||
} | } | |||
static inline void | static inline void | |||
term_ostream_set_underline (term_ostream_t stream _GL_UNUSED, | term_ostream_set_underline (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream, | |||
term_underline_t underline _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED term_underline_t underlin | |||
e) | ||||
{ | { | |||
} | } | |||
static inline const char * | static inline const char * | |||
term_ostream_get_hyperlink_ref (term_ostream_t stream _GL_UNUSED) | term_ostream_get_hyperlink_ref (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream ) | |||
{ | { | |||
return NULL; | return NULL; | |||
} | } | |||
static inline const char * | static inline const char * | |||
term_ostream_get_hyperlink_id (term_ostream_t stream _GL_UNUSED) | term_ostream_get_hyperlink_id (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream) | |||
{ | { | |||
return NULL; | return NULL; | |||
} | } | |||
static inline void | static inline void | |||
term_ostream_set_hyperlink (term_ostream_t stream _GL_UNUSED, | term_ostream_set_hyperlink (_GL_ATTRIBUTE_MAYBE_UNUSED term_ostream_t stream, | |||
const char *ref _GL_UNUSED, | _GL_ATTRIBUTE_MAYBE_UNUSED const char *ref, | |||
const char *id _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED const char *id) | |||
{ | { | |||
} | } | |||
static inline void | static inline void | |||
term_ostream_flush_to_current_style (term_ostream_t stream) | term_ostream_flush_to_current_style (term_ostream_t stream) | |||
{ | { | |||
fflush (stream); | fflush (stream); | |||
} | } | |||
typedef enum | typedef enum | |||
skipping to change at line 376 | skipping to change at line 402 | |||
be left in the default state when the program is | be left in the default state when the program is | |||
interrupted. */ | interrupted. */ | |||
TTYCTL_FULL /* Signal handling and disabling echo and flush-upon-signal. | TTYCTL_FULL /* Signal handling and disabling echo and flush-upon-signal. | |||
Result: No garbled output, and the the terminal will | Result: No garbled output, and the the terminal will | |||
be left in the default state when the program is | be left in the default state when the program is | |||
interrupted. */ | interrupted. */ | |||
} ttyctl_t; | } ttyctl_t; | |||
static inline term_ostream_t | static inline term_ostream_t | |||
term_ostream_create (int fd, const char *filename, | term_ostream_create (int fd, const char *filename, | |||
ttyctl_t tty_control _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED ttyctl_t tty_control) | |||
{ | { | |||
return fd_ostream_create (fd, filename, true); | return fd_ostream_create (fd, filename, true); | |||
} | } | |||
/* ----------------------- From term-styled-ostream.h ----------------------- */ | /* ----------------------- From term-styled-ostream.h ----------------------- */ | |||
typedef styled_ostream_t term_styled_ostream_t; | typedef styled_ostream_t term_styled_ostream_t; | |||
#define term_styled_ostream_write_mem ostream_write_mem | #define term_styled_ostream_write_mem ostream_write_mem | |||
#define term_styled_ostream_flush ostream_flush | #define term_styled_ostream_flush ostream_flush | |||
#define term_styled_ostream_free ostream_free | #define term_styled_ostream_free ostream_free | |||
#define term_styled_ostream_begin_use_class styled_ostream_begin_use_class | #define term_styled_ostream_begin_use_class styled_ostream_begin_use_class | |||
#define term_styled_ostream_end_use_class styled_ostream_end_use_class | #define term_styled_ostream_end_use_class styled_ostream_end_use_class | |||
#define term_styled_ostream_get_hyperlink_ref styled_ostream_get_hyperlink_ref | #define term_styled_ostream_get_hyperlink_ref styled_ostream_get_hyperlink_ref | |||
#define term_styled_ostream_get_hyperlink_id styled_ostream_get_hyperlink_id | #define term_styled_ostream_get_hyperlink_id styled_ostream_get_hyperlink_id | |||
#define term_styled_ostream_set_hyperlink styled_ostream_set_hyperlink | #define term_styled_ostream_set_hyperlink styled_ostream_set_hyperlink | |||
#define term_styled_ostream_flush_to_current_style styled_ostream_flush_to_curre nt_style | #define term_styled_ostream_flush_to_current_style styled_ostream_flush_to_curre nt_style | |||
static inline term_styled_ostream_t | static inline term_styled_ostream_t | |||
term_styled_ostream_create (int fd, const char *filename, | term_styled_ostream_create (int fd, const char *filename, | |||
ttyctl_t tty_control _GL_UNUSED, | _GL_ATTRIBUTE_MAYBE_UNUSED ttyctl_t tty_control, | |||
const char *css_filename _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED const char *css_filename) | |||
{ | { | |||
return fd_ostream_create (fd, filename, true); | return fd_ostream_create (fd, filename, true); | |||
} | } | |||
/* ----------------------- From html-styled-ostream.h ----------------------- */ | /* ----------------------- From html-styled-ostream.h ----------------------- */ | |||
typedef styled_ostream_t html_styled_ostream_t; | typedef styled_ostream_t html_styled_ostream_t; | |||
static inline html_styled_ostream_t | static inline html_styled_ostream_t | |||
html_styled_ostream_create (ostream_t destination _GL_UNUSED, | html_styled_ostream_create (_GL_ATTRIBUTE_MAYBE_UNUSED ostream_t destination, | |||
const char *css_filename _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED const char *css_filename) | |||
{ | { | |||
abort (); | abort (); | |||
return NULL; | return NULL; | |||
} | } | |||
/* ------------------------------ From color.h ------------------------------ */ | /* ------------------------------ From color.h ------------------------------ */ | |||
#define color_test_mode false | #define color_test_mode false | |||
enum color_option { color_no, color_tty, color_yes, color_html }; | enum color_option { color_no, color_tty, color_yes, color_html }; | |||
#define color_mode color_no | #define color_mode color_no | |||
#define style_file_name NULL | #define style_file_name NULL | |||
static inline bool | static inline bool | |||
handle_color_option (const char *option _GL_UNUSED) | handle_color_option (_GL_ATTRIBUTE_MAYBE_UNUSED const char *option) | |||
{ | { | |||
return false; | return false; | |||
} | } | |||
static inline void | static inline void | |||
handle_style_option (const char *option _GL_UNUSED) | handle_style_option (_GL_ATTRIBUTE_MAYBE_UNUSED const char *option) | |||
{ | { | |||
} | } | |||
static inline void | static inline void | |||
print_color_test (void) | print_color_test (void) | |||
{ | { | |||
abort (); | abort (); | |||
} | } | |||
static inline void | static inline void | |||
style_file_prepare (const char *style_file_envvar _GL_UNUSED, | style_file_prepare (_GL_ATTRIBUTE_MAYBE_UNUSED const char *style_file_envvar, | |||
const char *stylesdir_envvar _GL_UNUSED, | _GL_ATTRIBUTE_MAYBE_UNUSED const char *stylesdir_envvar, | |||
const char *stylesdir_after_install _GL_UNUSED, | _GL_ATTRIBUTE_MAYBE_UNUSED const char *stylesdir_after_insta | |||
const char *default_style_file _GL_UNUSED) | ll, | |||
_GL_ATTRIBUTE_MAYBE_UNUSED const char *default_style_file) | ||||
{ | { | |||
} | } | |||
/* ------------------------------ From misc.h ------------------------------ */ | /* ------------------------------ From misc.h ------------------------------ */ | |||
static inline styled_ostream_t | static inline styled_ostream_t | |||
styled_ostream_create (int fd, const char *filename, | styled_ostream_create (int fd, const char *filename, | |||
ttyctl_t tty_control _GL_UNUSED, | _GL_ATTRIBUTE_MAYBE_UNUSED ttyctl_t tty_control, | |||
const char *css_filename _GL_UNUSED) | _GL_ATTRIBUTE_MAYBE_UNUSED const char *css_filename) | |||
{ | { | |||
return fd_ostream_create (fd, filename, true); | return fd_ostream_create (fd, filename, true); | |||
} | } | |||
static inline void | static inline void | |||
libtextstyle_set_failure_exit_code (int exit_code _GL_UNUSED) | libtextstyle_set_failure_exit_code (_GL_ATTRIBUTE_MAYBE_UNUSED int exit_code) | |||
{ | { | |||
} | } | |||
#endif /* _TEXTSTYLE_H */ | #endif /* _TEXTSTYLE_H */ | |||
End of changes. 29 change blocks. | ||||
46 lines changed or deleted | 78 lines changed or added |