1 /* Public API of the libtextstyle library. 2 Copyright (C) 2006-2007, 2019 Free Software Foundation, Inc. 3 4 This program is free software: you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 3 of the License, or 7 (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 16 17 /* Written by Bruno Haible <bruno@clisp.org>, 2006, 2019. */ 18 19 #ifndef _TEXTSTYLE_H 20 #define _TEXTSTYLE_H 21 22 #include <stdarg.h> 23 #include <stddef.h> 24 #include <stdio.h> 25 #include <textstyle/stdbool.h> 26 #include <textstyle/woe32dll.h> 27 28 /* Meta information. */ 29 #include <textstyle/version.h> 30 31 /* ----------------------------- From ostream.h ----------------------------- */ 32 33 /* Describes the scope of a flush operation. */ 34 typedef enum 35 { 36 /* Flushes buffers in this ostream_t. 37 Use this value if you want to write to the underlying ostream_t. */ 38 FLUSH_THIS_STREAM = 0, 39 /* Flushes all buffers in the current process. 40 Use this value if you want to write to the same target through a 41 different file descriptor or a FILE stream. */ 42 FLUSH_THIS_PROCESS = 1, 43 /* Flushes buffers in the current process and attempts to flush the buffers 44 in the kernel. 45 Use this value so that some other process (or the kernel itself) 46 may write to the same target. */ 47 FLUSH_ALL = 2 48 } ostream_flush_scope_t; 49 50 51 /* An output stream is an object to which one can feed a sequence of bytes. */ 52 53 struct any_ostream_representation; 54 typedef struct any_ostream_representation * ostream_t; 55 56 /* Functions that invoke the methods. */ 57 #ifdef __cplusplus 58 extern "C" { 59 #endif 60 extern void ostream_write_mem (ostream_t first_arg, const void *data, size_t len); 61 extern void ostream_flush (ostream_t first_arg, ostream_flush_scope_t scope); 62 extern void ostream_free (ostream_t first_arg); 63 #ifdef __cplusplus 64 } 65 #endif 66 67 #ifdef __cplusplus 68 extern "C" { 69 #endif 70 71 /* Write a string's contents to a stream. */ 72 extern void ostream_write_str (ostream_t stream, const char *string); 73 74 /* Writes formatted output to a stream. 75 Returns the size of formatted output, or a negative value in case of an 76 error. */ 77 extern ptrdiff_t ostream_printf (ostream_t stream, const char *format, ...) 78 #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3 79 __attribute__ ((__format__ (__printf__, 2, 3))) 80 #endif 81 ; 82 extern ptrdiff_t ostream_vprintf (ostream_t stream, 83 const char *format, va_list args) 84 #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3 85 __attribute__ ((__format__ (__printf__, 2, 0))) 86 #endif 87 ; 88 89 #ifdef __cplusplus 90 } 91 #endif 92 93 /* ------------------------- From styled-ostream.h ------------------------- */ 94 95 /* A styled output stream is an object to which one can feed a sequence of 96 bytes, marking some runs of text as belonging to specific CSS classes, 97 where the rendering of the CSS classes is defined through a CSS (cascading 98 style sheet). */ 99 100 /* styled_ostream_t is a subtype of ostream_t. */ 101 typedef ostream_t styled_ostream_t; 102 103 /* Functions that invoke the methods. */ 104 #ifdef __cplusplus 105 extern "C" { 106 #endif 107 extern void styled_ostream_write_mem (styled_ostream_t first_arg, const void *data, size_t len); 108 extern void styled_ostream_flush (styled_ostream_t first_arg, ostream_flush_scope_t scope); 109 extern void styled_ostream_free (styled_ostream_t first_arg); 110 extern void styled_ostream_begin_use_class (styled_ostream_t first_arg, const char *classname); 111 extern void styled_ostream_end_use_class (styled_ostream_t first_arg, const char *classname); 112 extern const char *styled_ostream_get_hyperlink_ref (styled_ostream_t first_arg); 113 extern const char *styled_ostream_get_hyperlink_id (styled_ostream_t first_arg); 114 extern void styled_ostream_set_hyperlink (styled_ostream_t first_arg, const char *ref, const char *id); 115 /* Like styled_ostream_flush (first_arg, FLUSH_THIS_STREAM), except that it 116 leaves the destination with the current text style enabled, instead 117 of with the default text style. 118 After calling this function, you can output strings without newlines(!) 119 to the underlying stream, and they will be rendered like strings passed 120 to 'ostream_write_mem', 'ostream_write_str', or 'ostream_write_printf'. */ 121 extern void styled_ostream_flush_to_current_style (styled_ostream_t stream); 122 #ifdef __cplusplus 123 } 124 #endif 125 126 /* -------------------------- From file-ostream.h -------------------------- */ 127 128 /* file_ostream_t is a subtype of ostream_t. */ 129 typedef ostream_t file_ostream_t; 130 131 /* Functions that invoke the methods. */ 132 #ifdef __cplusplus 133 extern "C" { 134 #endif 135 extern void file_ostream_write_mem (file_ostream_t first_arg, const void *data, size_t len); 136 extern void file_ostream_flush (file_ostream_t first_arg, ostream_flush_scope_t scope); 137 extern void file_ostream_free (file_ostream_t first_arg); 138 #ifdef __cplusplus 139 } 140 #endif 141 142 #ifdef __cplusplus 143 extern "C" { 144 #endif 145 146 147 /* Create an output stream referring to FP. 148 Note that the resulting stream must be closed before FP can be closed. */ 149 extern file_ostream_t file_ostream_create (FILE *fp); 150 151 152 #ifdef __cplusplus 153 } 154 #endif 155 156 /* --------------------------- From fd-ostream.h --------------------------- */ 157 158 /* fd_ostream_t is a subtype of ostream_t. */ 159 typedef ostream_t fd_ostream_t; 160 161 /* Functions that invoke the methods. */ 162 #ifdef __cplusplus 163 extern "C" { 164 #endif 165 extern void fd_ostream_write_mem (fd_ostream_t first_arg, const void *data, size_t len); 166 extern void fd_ostream_flush (fd_ostream_t first_arg, ostream_flush_scope_t scope); 167 extern void fd_ostream_free (fd_ostream_t first_arg); 168 #ifdef __cplusplus 169 } 170 #endif 171 172 #ifdef __cplusplus 173 extern "C" { 174 #endif 175 176 177 /* Create an output stream referring to the file descriptor FD. 178 FILENAME is used only for error messages. 179 Note that the resulting stream must be closed before FD can be closed. */ 180 extern fd_ostream_t fd_ostream_create (int fd, const char *filename, 181 bool buffered); 182 183 184 #ifdef __cplusplus 185 } 186 #endif 187 188 /* -------------------------- From term-ostream.h -------------------------- */ 189 190 /* Querying and setting of text attributes. 191 The stream has a notion of the current text attributes; they apply 192 implicitly to all following output. The attributes are automatically 193 reset when the stream is closed. 194 Note: Not all terminal types can actually render all attributes adequately. 195 For example, xterm cannot render POSTURE_ITALIC nor the combination of 196 WEIGHT_BOLD and UNDERLINE_ON. */ 197 198 /* Colors are represented by indices >= 0 in a stream dependent format. */ 199 typedef int term_color_t; 200 /* The value -1 denotes the default (foreground or background) color. */ 201 enum 202 { 203 COLOR_DEFAULT = -1 /* unknown */ 204 }; 205 206 typedef enum 207 { 208 WEIGHT_NORMAL = 0, 209 WEIGHT_BOLD, 210 WEIGHT_DEFAULT = WEIGHT_NORMAL 211 } term_weight_t; 212 213 typedef enum 214 { 215 POSTURE_NORMAL = 0, 216 POSTURE_ITALIC, /* same as oblique */ 217 POSTURE_DEFAULT = POSTURE_NORMAL 218 } term_posture_t; 219 220 typedef enum 221 { 222 UNDERLINE_OFF = 0, 223 UNDERLINE_ON, 224 UNDERLINE_DEFAULT = UNDERLINE_OFF 225 } term_underline_t; 226 227 /* term_ostream_t is a subtype of ostream_t. */ 228 typedef ostream_t term_ostream_t; 229 230 /* Functions that invoke the methods. */ 231 #ifdef __cplusplus 232 extern "C" { 233 #endif 234 extern void term_ostream_write_mem (term_ostream_t first_arg, const void *data, size_t len); 235 extern void term_ostream_flush (term_ostream_t first_arg, ostream_flush_scope_t scope); 236 extern void term_ostream_free (term_ostream_t first_arg); 237 extern term_color_t term_ostream_rgb_to_color (term_ostream_t first_arg, int red, int green, int blue); 238 extern term_color_t term_ostream_get_color (term_ostream_t first_arg); 239 extern void term_ostream_set_color (term_ostream_t first_arg, term_color_t color); 240 extern term_color_t term_ostream_get_bgcolor (term_ostream_t first_arg); 241 extern void term_ostream_set_bgcolor (term_ostream_t first_arg, term_color_t color); 242 extern term_weight_t term_ostream_get_weight (term_ostream_t first_arg); 243 extern void term_ostream_set_weight (term_ostream_t first_arg, term_weight_t weight); 244 extern term_posture_t term_ostream_get_posture (term_ostream_t first_arg); 245 extern void term_ostream_set_posture (term_ostream_t first_arg, term_posture_t posture); 246 extern term_underline_t term_ostream_get_underline (term_ostream_t first_arg); 247 extern void term_ostream_set_underline (term_ostream_t first_arg, term_underline_t underline); 248 extern const char *term_ostream_get_hyperlink_ref (term_ostream_t first_arg); 249 extern const char *term_ostream_get_hyperlink_id (term_ostream_t first_arg); 250 extern void term_ostream_set_hyperlink (term_ostream_t first_arg, const char *ref, const char *id); 251 /* Like term_ostream_flush (first_arg, FLUSH_THIS_STREAM), except that it 252 leaves the terminal with the current text attributes enabled, instead of 253 with the default text attributes. 254 After calling this function, you can output strings without newlines(!) 255 to the underlying file descriptor, and they will be rendered like strings 256 passed to 'ostream_write_mem', 'ostream_write_str', or 257 'ostream_write_printf'. */ 258 extern void term_ostream_flush_to_current_style (term_ostream_t first_arg); 259 #ifdef __cplusplus 260 } 261 #endif 262 263 /* The amount of control to take over the underlying tty in order to avoid 264 garbled output on the screen, due to interleaved output of escape sequences 265 and output from the kernel (such as when the kernel echoes user's input 266 or when the kernel prints '^C' after the user pressed Ctrl-C). */ 267 typedef enum 268 { 269 TTYCTL_AUTO = 0, /* Automatic best-possible choice. */ 270 TTYCTL_NONE, /* No control. 271 Result: Garbled output can occur, and the terminal can 272 be left in any state when the program is interrupted. */ 273 TTYCTL_PARTIAL, /* Signal handling. 274 Result: Garbled output can occur, but the terminal will 275 be left in the default state when the program is 276 interrupted. */ 277 TTYCTL_FULL /* Signal handling and disabling echo and flush-upon-signal. 278 Result: No garbled output, and the the terminal will 279 be left in the default state when the program is 280 interrupted. */ 281 } ttyctl_t; 282 283 #ifdef __cplusplus 284 extern "C" { 285 #endif 286 287 288 /* Create an output stream referring to the file descriptor FD. 289 FILENAME is used only for error messages. 290 TTY_CONTROL specifies the amount of control to take over the underlying tty. 291 The resulting stream will be line-buffered. 292 Note that the resulting stream must be closed before FD can be closed. */ 293 extern term_ostream_t 294 term_ostream_create (int fd, const char *filename, ttyctl_t tty_control); 295 296 297 #ifdef __cplusplus 298 } 299 #endif 300 301 /* ------------------------- From memory-ostream.h ------------------------- */ 302 303 /* memory_ostream_t is a subtype of ostream_t. */ 304 typedef ostream_t memory_ostream_t; 305 306 /* Functions that invoke the methods. */ 307 #ifdef __cplusplus 308 extern "C" { 309 #endif 310 extern void memory_ostream_write_mem (memory_ostream_t first_arg, const void *data, size_t len); 311 extern void memory_ostream_flush (memory_ostream_t first_arg, ostream_flush_scope_t scope); 312 extern void memory_ostream_free (memory_ostream_t first_arg); 313 extern void memory_ostream_contents (memory_ostream_t first_arg, const void **bufp, size_t *buflenp); 314 #ifdef __cplusplus 315 } 316 #endif 317 318 #ifdef __cplusplus 319 extern "C" { 320 #endif 321 322 323 /* Create an output stream that accumulates the output in a memory buffer. */ 324 extern memory_ostream_t memory_ostream_create (void); 325 326 327 #ifdef __cplusplus 328 } 329 #endif 330 331 /* -------------------------- From iconv-ostream.h -------------------------- */ 332 333 #if LIBTEXTSTYLE_USES_ICONV 334 335 /* iconv_ostream_t is a subtype of ostream_t. */ 336 typedef ostream_t iconv_ostream_t; 337 338 /* Functions that invoke the methods. */ 339 #ifdef __cplusplus 340 extern "C" { 341 #endif 342 extern void iconv_ostream_write_mem (iconv_ostream_t first_arg, const void *data, size_t len); 343 extern void iconv_ostream_flush (iconv_ostream_t first_arg, ostream_flush_scope_t scope); 344 extern void iconv_ostream_free (iconv_ostream_t first_arg); 345 #ifdef __cplusplus 346 } 347 #endif 348 349 #ifdef __cplusplus 350 extern "C" { 351 #endif 352 353 354 /* Create an output stream that converts from FROM_ENCODING to TO_ENCODING, 355 writing the result to DESTINATION. */ 356 extern iconv_ostream_t iconv_ostream_create (const char *from_encoding, 357 const char *to_encoding, 358 ostream_t destination); 359 360 361 #ifdef __cplusplus 362 } 363 #endif 364 365 #endif /* LIBTEXTSTYLE_USES_ICONV */ 366 367 /* -------------------------- From html-ostream.h -------------------------- */ 368 369 /* html_ostream_t is a subtype of ostream_t. */ 370 typedef ostream_t html_ostream_t; 371 372 /* Functions that invoke the methods. */ 373 #ifdef __cplusplus 374 extern "C" { 375 #endif 376 extern void html_ostream_write_mem (html_ostream_t first_arg, const void *data, size_t len); 377 extern void html_ostream_flush (html_ostream_t first_arg, ostream_flush_scope_t scope); 378 extern void html_ostream_free (html_ostream_t first_arg); 379 extern void html_ostream_begin_span (html_ostream_t first_arg, const char *classname); 380 extern void html_ostream_end_span (html_ostream_t first_arg, const char *classname); 381 extern const char *html_ostream_get_hyperlink_ref (html_ostream_t first_arg); 382 extern void html_ostream_set_hyperlink_ref (html_ostream_t first_arg, const char *ref); 383 /* Like html_ostream_flush (first_arg, FLUSH_THIS_STREAM), except that it 384 leaves the destination with the current text style enabled, instead 385 of with the default text style. 386 After calling this function, you can output strings without newlines(!) 387 to the underlying stream, and they will be rendered like strings passed 388 to 'ostream_write_mem', 'ostream_write_str', or 'ostream_write_printf'. */ 389 extern void html_ostream_flush_to_current_style (html_ostream_t stream); 390 #ifdef __cplusplus 391 } 392 #endif 393 394 #ifdef __cplusplus 395 extern "C" { 396 #endif 397 398 399 /* Create an output stream that takes input in the UTF-8 encoding and 400 writes it in HTML form on DESTINATION. 401 This stream produces a sequence of lines. The caller is responsible 402 for opening the <body><html> elements before and for closing them after 403 the use of this stream. 404 Note that the resulting stream must be closed before DESTINATION can be 405 closed. */ 406 extern html_ostream_t html_ostream_create (ostream_t destination); 407 408 409 #ifdef __cplusplus 410 } 411 #endif 412 413 /* ----------------------- From term-styled-ostream.h ----------------------- */ 414 415 /* term_styled_ostream_t is a subtype of styled_ostream_t. */ 416 typedef styled_ostream_t term_styled_ostream_t; 417 418 /* Functions that invoke the methods. */ 419 #ifdef __cplusplus 420 extern "C" { 421 #endif 422 extern void term_styled_ostream_write_mem (term_styled_ostream_t first_arg, const void *data, size_t len); 423 extern void term_styled_ostream_flush (term_styled_ostream_t first_arg, ostream_flush_scope_t scope); 424 extern void term_styled_ostream_free (term_styled_ostream_t first_arg); 425 extern void term_styled_ostream_begin_use_class (term_styled_ostream_t first_arg, const char *classname); 426 extern void term_styled_ostream_end_use_class (term_styled_ostream_t first_arg, const char *classname); 427 extern const char *term_styled_ostream_get_hyperlink_ref (term_styled_ostream_t first_arg); 428 extern const char *term_styled_ostream_get_hyperlink_id (term_styled_ostream_t first_arg); 429 extern void term_styled_ostream_set_hyperlink (term_styled_ostream_t first_arg, const char *ref, const char *id); 430 extern void term_styled_ostream_flush_to_current_style (term_styled_ostream_t first_arg); 431 #ifdef __cplusplus 432 } 433 #endif 434 435 #ifdef __cplusplus 436 extern "C" { 437 #endif 438 439 440 /* Create an output stream referring to the file descriptor FD, styled with 441 the file CSS_FILENAME. 442 FILENAME is used only for error messages. 443 TTY_CONTROL specifies the amount of control to take over the underlying tty. 444 Note that the resulting stream must be closed before FD can be closed. 445 Return NULL upon failure. */ 446 extern term_styled_ostream_t 447 term_styled_ostream_create (int fd, const char *filename, 448 ttyctl_t tty_control, 449 const char *css_filename); 450 451 452 #ifdef __cplusplus 453 } 454 #endif 455 456 /* ----------------------- From html-styled-ostream.h ----------------------- */ 457 458 /* html_styled_ostream_t is a subtype of styled_ostream_t. */ 459 typedef styled_ostream_t html_styled_ostream_t; 460 461 /* Functions that invoke the methods. */ 462 #ifdef __cplusplus 463 extern "C" { 464 #endif 465 extern void html_styled_ostream_write_mem (html_styled_ostream_t first_arg, const void *data, size_t len); 466 extern void html_styled_ostream_flush (html_styled_ostream_t first_arg, ostream_flush_scope_t scope); 467 extern void html_styled_ostream_free (html_styled_ostream_t first_arg); 468 extern void html_styled_ostream_begin_use_class (html_styled_ostream_t first_arg, const char *classname); 469 extern void html_styled_ostream_end_use_class (html_styled_ostream_t first_arg, const char *classname); 470 extern const char *html_styled_ostream_get_hyperlink_ref (html_styled_ostream_t first_arg); 471 extern const char *html_styled_ostream_get_hyperlink_id (html_styled_ostream_t first_arg); 472 extern void html_styled_ostream_set_hyperlink (html_styled_ostream_t first_arg, const char *ref, const char *id); 473 extern void html_styled_ostream_flush_to_current_style (html_styled_ostream_t first_arg); 474 #ifdef __cplusplus 475 } 476 #endif 477 478 #ifdef __cplusplus 479 extern "C" { 480 #endif 481 482 483 /* Create an output stream that takes input in the UTF-8 encoding and 484 writes it in HTML form on DESTINATION, styled with the file CSS_FILENAME. 485 Note that the resulting stream must be closed before DESTINATION can be 486 closed. */ 487 extern html_styled_ostream_t 488 html_styled_ostream_create (ostream_t destination, 489 const char *css_filename); 490 491 492 #ifdef __cplusplus 493 } 494 #endif 495 496 /* ----------------------- From noop-styled-ostream.h ----------------------- */ 497 498 /* noop_styled_ostream_t is a subtype of styled_ostream_t. */ 499 typedef styled_ostream_t noop_styled_ostream_t; 500 501 /* Functions that invoke the methods. */ 502 #ifdef __cplusplus 503 extern "C" { 504 #endif 505 extern void noop_styled_ostream_write_mem (noop_styled_ostream_t first_arg, const void *data, size_t len); 506 extern void noop_styled_ostream_flush (noop_styled_ostream_t first_arg, ostream_flush_scope_t scope); 507 extern void noop_styled_ostream_free (noop_styled_ostream_t first_arg); 508 extern void noop_styled_ostream_begin_use_class (noop_styled_ostream_t first_arg, const char *classname); 509 extern void noop_styled_ostream_end_use_class (noop_styled_ostream_t first_arg, const char *classname); 510 extern const char *noop_styled_ostream_get_hyperlink_ref (noop_styled_ostream_t first_arg); 511 extern const char *noop_styled_ostream_get_hyperlink_id (noop_styled_ostream_t first_arg); 512 extern void noop_styled_ostream_set_hyperlink (noop_styled_ostream_t first_arg, const char *ref, const char *id); 513 extern void noop_styled_ostream_flush_to_current_style (noop_styled_ostream_t first_arg); 514 #ifdef __cplusplus 515 } 516 #endif 517 518 #ifdef __cplusplus 519 extern "C" { 520 #endif 521 522 523 /* Create an output stream that delegates to DESTINATION and that supports 524 the styling operations as no-ops. 525 If PASS_OWNERSHIP is true, closing the resulting stream will automatically 526 close the DESTINATION. 527 Note that if PASS_OWNERSHIP is false, the resulting stream must be closed 528 before DESTINATION can be closed. */ 529 extern noop_styled_ostream_t 530 noop_styled_ostream_create (ostream_t destination, bool pass_ownership); 531 532 533 #ifdef __cplusplus 534 } 535 #endif 536 537 /* ------------------------------ From color.h ------------------------------ */ 538 539 #ifdef __cplusplus 540 extern "C" { 541 #endif 542 543 544 /* Whether to output a test page. */ 545 extern LIBTEXTSTYLE_DLL_VARIABLE bool color_test_mode; 546 547 /* Color option. */ 548 enum color_option { color_no, color_tty, color_yes, color_html }; 549 extern LIBTEXTSTYLE_DLL_VARIABLE enum color_option color_mode; 550 551 /* Style to use when coloring. */ 552 extern LIBTEXTSTYLE_DLL_VARIABLE const char *style_file_name; 553 554 /* --color argument handling. Return an error indicator. */ 555 extern bool handle_color_option (const char *option); 556 557 /* --style argument handling. */ 558 extern void handle_style_option (const char *option); 559 560 /* Print a color test page. */ 561 extern void print_color_test (void); 562 563 /* Assign a default value to style_file_name if necessary. 564 STYLE_FILE_ENVVAR is an environment variable that, when set to a non-empty 565 value, specifies the style file to use. This environment variable is meant 566 to be set by the user. 567 STYLESDIR_ENVVAR is an environment variable that, when set to a non-empty 568 value, specifies the directory with the style files, or NULL. This is 569 necessary for running the testsuite before "make install". 570 STYLESDIR_AFTER_INSTALL is the directory with the style files after 571 "make install". 572 DEFAULT_STYLE_FILE is the file name of the default style file, relative to 573 STYLESDIR. */ 574 extern void style_file_prepare (const char *style_file_envvar, 575 const char *stylesdir_envvar, 576 const char *stylesdir_after_install, 577 const char *default_style_file); 578 579 580 #ifdef __cplusplus 581 } 582 #endif 583 584 /* ------------------------------ From misc.h ------------------------------ */ 585 586 #ifdef __cplusplus 587 extern "C" { 588 #endif 589 590 /* Create an output stream referring to the file descriptor FD, styled with 591 the file CSS_FILENAME if possible. 592 FILENAME is used only for error messages. 593 TTY_CONTROL specifies the amount of control to take over the underlying tty. 594 Note that the resulting stream must be closed before FD can be closed. */ 595 extern styled_ostream_t 596 styled_ostream_create (int fd, const char *filename, 597 ttyctl_t tty_control, 598 const char *css_filename); 599 600 /* Set the exit value upon failure within libtextstyle. */ 601 extern void libtextstyle_set_failure_exit_code (int exit_code); 602 603 #ifdef __cplusplus 604 } 605 #endif 606 607 /* ----------------------- Exported gnulib overrides ----------------------- */ 608 609 #if defined _WIN32 && ! defined __CYGWIN__ 610 611 # include <io.h> 612 613 # ifdef __cplusplus 614 extern "C" { 615 # endif 616 617 extern int libtextstyle_isatty (int fd); 618 # undef isatty 619 # define isatty libtextstyle_isatty 620 621 # ifdef __cplusplus 622 } 623 # endif 624 625 #endif 626 627 /* ------------------------------------------------------------------------- */ 628 629 #endif /* _TEXTSTYLE_H */ 630