1 /* 2 Copyright 2020, Dirk Krause. All rights reserved. 3 SPDX-License-Identifier: BSD-3-Clause 4 */ 5 6 /** @file dk3const.h Constants for the dk3 libraries. 7 */ 8 9 #ifndef DK3_CONST_H_INCLUDED 10 /** Avoid multiple inclusion. */ 11 #define DK3_CONST_H_INCLUDED 1 12 13 #include "dk3conf.h" 14 15 /** @defgroup apptypes Application types. 16 */ 17 /**@{*/ 18 enum { 19 /** Application type: Not (yet) specified. 20 21 No application type was specified. 22 */ 23 DK3_APP_TYPE_UNKNOWN = 0, 24 25 /** Application type: Command line application. 26 27 Diagnostics go to a log file and to standard error output. 28 The log file is deleted by dk3app_close() unless keeping the 29 log file is required by the preference /log/file/keep. 30 */ 31 DK3_APP_TYPE_COMMAND, 32 33 /** Application type: GUI application. 34 35 Diagnostics go to a log file. 36 The log file is deleted by dk3app_close() unless keeping the 37 log file is required by the preference /log/file/keep. 38 */ 39 DK3_APP_TYPE_GUI, 40 41 /** Application type: Daemon. 42 43 Diagnostics go to a log file. 44 The same log file is used again and again, messages 45 are appended. The log file is not deleted automatically. 46 */ 47 DK3_APP_TYPE_DAEMON, 48 49 /** Application type: Silent application. 50 51 No diagnostic messages are produced. 52 */ 53 DK3_APP_TYPE_SILENT 54 }; 55 /**@}*/ 56 57 58 59 /** @defgroup fileenc Encodings for text files. 60 These encodings can be used when writing texts to file. 61 For multi-byte characters we have to decide whether to write 62 MSB first or LSB first. 63 */ 64 /**@{*/ 65 enum { 66 /** Plain ascii text. 67 */ 68 DK3_FILE_ENCODING_ASCII = 0, 69 70 /** UTF-8 encoding. 71 */ 72 DK3_FILE_ENCODING_UTF8, 73 74 /** UTF-16 encoding, MSB comes first. 75 */ 76 DK3_FILE_ENCODING_UTF16_MSB_FIRST, 77 78 /** UTF-16 encoding, LSB comes first. 79 */ 80 DK3_FILE_ENCODING_UTF16_LSB_FIRST, 81 82 /** 32-bit UNICODE used directly, MSB comes first. 83 */ 84 DK3_FILE_ENCODING_UNICODE_MSB_FIRST, 85 86 /** 32-bit UNICODE used directly, LSB comes first. 87 */ 88 DK3_FILE_ENCODING_UNICODE_LSB_FIRST 89 }; 90 /**@}*/ 91 92 93 94 /** @defgroup stringenc Encodings for text. 95 These encoding are used when keeping text in memory. 96 */ 97 /**@{*/ 98 enum { 99 /** Plain ascii text. 100 */ 101 DK3_ENCODING_PLAIN = DK3_FILE_ENCODING_ASCII, 102 103 /** UTF-8 encoding. 104 */ 105 DK3_ENCODING_UTF8 = DK3_FILE_ENCODING_UTF8, 106 107 /** UTF-16 encoding, MSB comes first. 108 */ 109 DK3_ENCODING_UTF16 = DK3_FILE_ENCODING_UTF16_MSB_FIRST, 110 111 /** 32-bit UNICODE used directly, MSB comes first. 112 */ 113 DK3_ENCODING_UNICODE = DK3_FILE_ENCODING_UNICODE_MSB_FIRST 114 }; 115 /**@}*/ 116 117 118 119 120 /** @defgroup filetypes File types 121 These file types are returned in the ft component of the 122 dk3_stat_t type. 123 */ 124 /**@{*/ 125 enum { 126 127 /** Regular file. 128 */ 129 DK3_FT_REGULAR = 1, 130 131 /** Directory. 132 */ 133 DK3_FT_DIRECTORY, 134 135 /** FIFO. 136 */ 137 DK3_FT_FIFO, 138 139 /** Character special device. 140 */ 141 DK3_FT_SPECIAL_CHAR, 142 143 /** Block special device. 144 */ 145 DK3_FT_SPECIAL_BLOCK, 146 147 /** Socket. 148 */ 149 DK3_FT_SOCKET, 150 151 /* Next there are some exotic file types. */ 152 153 /** Door. 154 */ 155 DK3_FT_DOOR, 156 157 /** Event port. 158 */ 159 DK3_FT_EVENT_PORT, 160 161 /** Xenix special file. 162 */ 163 DK3_FT_XENIX_SPECIAL, 164 165 /** Xenix semaphore. 166 */ 167 DK3_FT_XENIX_SEMAPHORE, 168 169 /** Xenix shared data. 170 */ 171 DK3_FT_XENIX_SHARED_DATA, 172 173 /** Multiplexed character device. 174 */ 175 DK3_FT_MUX_CHAR, 176 177 /** Multiplexed block device. 178 */ 179 DK3_FT_MUX_BLOCK, 180 181 /** VxFS compressed file. 182 */ 183 DK3_FT_VXFS_COMPRESSED, 184 185 /** Network special file. 186 */ 187 DK3_FT_NETWORK_SPECIAL, 188 189 /** Whiteout (not used for inode). 190 */ 191 DK3_FT_WHITEOUT, 192 193 /** ACL shadow inode. 194 */ 195 DK3_FT_ACL_SHADOW, 196 197 /** Symlink with non-existing target. 198 */ 199 DK3_FT_BAD_SYMLINK, 200 201 /** Maximum found so far. Applications must use int i[DK3_FT_MAX+1] 202 to store information about all the file types. 203 */ 204 DK3_FT_MAX = DK3_FT_BAD_SYMLINK, 205 206 /** Symbolic link (this flag is or-combined with one of the values below). 207 */ 208 DK3_FT_SYMLINK = 256, 209 210 }; 211 /**@}*/ 212 213 214 215 /** @defgroup filepermissions File permissions. 216 */ 217 /**@{*/ 218 enum { 219 /** Read permission for owner. 220 */ 221 DK3_FPERM_U_READ = 0400, 222 223 /** Write permission for owner. 224 */ 225 DK3_FPERM_U_WRITE = 0200, 226 227 /** Execute permission for owner. 228 */ 229 DK3_FPERM_U_EXEC = 0100, 230 231 /** Read permission for group. 232 */ 233 DK3_FPERM_G_READ = 0040, 234 235 /** Write permission for group. 236 */ 237 DK3_FPERM_G_WRITE = 0020, 238 239 /** Execute permission for group. 240 */ 241 DK3_FPERM_G_EXEC = 0010, 242 243 /** Read permission for others. 244 */ 245 DK3_FPERM_O_READ = 0004, 246 247 /** Write permission for others. 248 */ 249 DK3_FPERM_O_WRITE = 0002, 250 251 /** Execute permission for others. 252 */ 253 DK3_FPERM_O_EXEC = 0001, 254 255 /** Set user ID on execution. 256 */ 257 DK3_FPERM_SUID = 04000, 258 259 /** Set group ID on execution. 260 */ 261 DK3_FPERM_SGID = 02000, 262 263 /** VTX: Save swapped text segment even after use. 264 */ 265 DK3_FPERM_VTX = 01000, 266 267 /** Directory create mode: Only for user. 268 */ 269 DK3_FPERM_CREATE_PRIVATE = 0700, 270 271 /** File create mode: Only for user. 272 */ 273 DK3_FPERM_CREATE_FILE_PRIVATE = 0600, 274 275 /** Directory create mode: Full permissions for owner and group. 276 */ 277 DK3_FPERM_CREATE_GROUP = 0770, 278 279 /** File create mode: Full permissions for owner and group. 280 */ 281 DK3_FPERM_CREATE_FILE_GROUP = 0660 282 }; 283 /**@}*/ 284 285 286 287 /** @defgroup streamuseflags Flags how to use a stream. 288 A stream can be opened for reading, writing or both. 289 */ 290 /**@{*/ 291 enum { 292 /** Allowed to read from stream. 293 */ 294 DK3_STREAM_FLAG_READ = 1, 295 296 /** Allowed to write to stream. 297 */ 298 DK3_STREAM_FLAG_WRITE 299 }; 300 /**@}*/ 301 302 303 304 /** @defgroup streamapicommands Stream API commands. 305 These commands are used in the dk3stream.c module for 306 communication between the exported functions and the low-level 307 function dealing with the stream destination. 308 */ 309 /**@{*/ 310 enum { 311 /** Read into input buffer. 312 */ 313 DK3_STREAM_API_READ = 1, 314 315 /** Write output buffer. 316 */ 317 DK3_STREAM_API_WRITE, 318 319 /** Flush output buffer. 320 */ 321 DK3_STREAM_API_FLUSH, 322 323 /** Check whether we have reached the end of data. 324 */ 325 DK3_STREAM_API_AT_END, 326 327 /** Close the low-level data. 328 */ 329 DK3_STREAM_API_CLOSE, 330 331 /** Check whether a zero read result indicates end of data. 332 */ 333 DK3_STREAM_API_ZERO_IS_END, 334 335 /** Check for error. 336 */ 337 DK3_STREAM_API_ERROR 338 }; 339 /**@}*/ 340 341 342 343 /** @defgroup loglevels Log levels. 344 These levels are used to describe the importance of log messages. 345 Log messages are written to a log file, command line applications 346 also write to standard error output (stderr). 347 For both log destinations there is a required level, only messages 348 on that level or higher priorized (lower numeric value) are written 349 to that destination. 350 */ 351 /**@{*/ 352 enum { 353 /** This message priority never occurs. */ 354 DK3_LL_NONE = 0, 355 356 /** Panic message. */ 357 DK3_LL_PANIC, 358 359 /** Fatal error message. */ 360 DK3_LL_FATAL, 361 362 /** Error message. */ 363 DK3_LL_ERROR, 364 365 /** Warning message. */ 366 DK3_LL_WARNING, 367 368 /** Informational message. */ 369 DK3_LL_INFO, 370 371 /** Progress message. */ 372 DK3_LL_PROGRESS, 373 374 /** Debug message. */ 375 DK3_LL_DEBUG, 376 377 /** Message can be ignored. */ 378 DK3_LL_IGNORE 379 }; 380 /**@}*/ 381 382 383 384 /** Preferences priorities. 385 */ 386 enum { 387 /** Mask to retrieve scope value. 388 */ 389 DK3_PREF_SCOPE = 0x0007, 390 391 /** Scope: Host. 392 */ 393 DK3_PREF_SCOPE_HOST = 0x0001, 394 395 /** Scope: Application. 396 */ 397 DK3_PREF_SCOPE_APPLICATION = 0x0002, 398 399 /** Scope: User name. 400 */ 401 DK3_PREF_SCOPE_USER = 0x0004, 402 403 /** Mask to retrieve source. 404 */ 405 DK3_PREF_SOURCE = 0x0018, 406 407 /** Source: System configuration settings. 408 */ 409 DK3_PREF_SOURCE_SYSTEM = 0x0000, 410 411 /** Source: Users general configuration settings. 412 */ 413 DK3_PREF_SOURCE_USER = 0x0008, 414 415 /** Source: Command line arguments. 416 */ 417 DK3_PREF_SOURCE_COMMANDLINE = 0x0010, 418 }; 419 420 421 422 /** @defgroup errorcodes Error codes. */ 423 /**@{*/ 424 enum { 425 /** No error occured. 426 */ 427 DK3_ERROR_NONE = 0, 428 429 /** System error, see errno. 430 */ 431 DK3_ERROR_SYSTEM, 432 433 /** Aborted by user (cancel button). 434 */ 435 DK3_ERROR_ABORTED, 436 437 /** Mathematical error (division by zero). 438 */ 439 DK3_ERROR_MATH_DIVZERO, 440 441 /** Mathematical error (result out of range). 442 */ 443 DK3_ERROR_MATH_OVERFLOW, 444 445 /** Mathematical error (at least one argument out of range). 446 */ 447 DK3_ERROR_MATH_OUT_OF_RANGE, 448 449 /** Not enough memory. 450 */ 451 DK3_ERROR_MEMORY, 452 453 /** Invalid arguments passed to function. 454 */ 455 DK3_ERROR_INVALID_ARGS, 456 457 /** Incomplete configuration. 458 */ 459 DK3_ERROR_INCOMPLETE_CONFIGURATION, 460 461 /** Stream not opened for writing. 462 */ 463 DK3_ERROR_NOT_OPENED_FOR_WRITING, 464 465 /** Stream not opened for reading. 466 */ 467 DK3_ERROR_NOT_OPENED_FOR_READING, 468 469 /** An error occured during a write operation. 470 */ 471 DK3_ERROR_DURING_WRITE, 472 473 /** An error occured during a read operation. 474 */ 475 DK3_ERROR_DURING_READ, 476 477 /** No supported (library was not available during build time). 478 */ 479 DK3_ERROR_NOT_SUPPORTED, 480 481 /** Entry not found. 482 */ 483 DK3_ERROR_NOT_FOUND, 484 485 /** Conversion of binary data to text failed. 486 */ 487 DK3_ERROR_CONVERSION_FAILED, 488 489 /** Data too large. 490 */ 491 DK3_ERROR_TOO_LARGE, 492 493 /** Data unusable, probably damaged. 494 */ 495 DK3_ERROR_DATA_DAMAGED, 496 497 /** Syntax error in input file. 498 */ 499 DK3_ERROR_SYNTAX, 500 501 /** Network protocol is not supported. 502 */ 503 DK3_ERROR_PROTOCOL_NOT_SUPPORTED, 504 505 /** Network address family is not supported. 506 */ 507 DK3_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED, 508 509 /** Insufficient permissions. 510 */ 511 DK3_ERROR_INSUFFICIENT_PERMISSIONS, 512 513 /** Illegal network protocol family. 514 */ 515 DK3_ERROR_ILLEGAL_PROTOCOL_FAMILY, 516 517 /** Process table overflow. 518 */ 519 DK3_ERROR_PROCESS_TABLE_OVERFLOW, 520 521 /** Limit reached for number of open filedescriptors. 522 */ 523 DK3_ERROR_TOO_MANY_OPEN_FILES, 524 525 /** Error in I/O operation. 526 */ 527 DK3_ERROR_IO, 528 529 /** Signal was received. 530 */ 531 DK3_ERROR_INTERRUPTED, 532 533 /** IP address not found for host. 534 */ 535 DK3_ERROR_HOST_NOT_FOUND, 536 537 /** Local address already in use. 538 */ 539 DK3_ERROR_ADDR_IN_USE, 540 541 /** Out of resources. 542 */ 543 DK3_ERROR_RESOURCES, 544 545 /** Previous connection request in processing. 546 */ 547 DK3_ERROR_IN_PROGRESS, 548 549 /** Connection refused, no-one listening on the port. 550 */ 551 DK3_ERROR_CONNECTION_REFUSED, 552 553 /** Socket is already connected. 554 */ 555 DK3_ERROR_ALREADY_CONNECTED, 556 557 /** Network is unreachable. 558 */ 559 DK3_ERROR_NETWORK_UNREACHABLE, 560 561 /** Operation timed out. 562 */ 563 DK3_ERROR_TIMEOUT, 564 565 /** Failed to retrieve or set socket options. 566 */ 567 DK3_ERROR_SOCKET_OPTIONS, 568 569 /** Failed to bind local address. 570 */ 571 DK3_ERROR_BIND_FAILED, 572 573 /** The socket is already bound to an address. 574 */ 575 DK3_ERROR_ALREADY_BOUND, 576 577 /** Operation would block. 578 */ 579 DK3_ERROR_WOULD_BLOCK, 580 581 /** Connection reset by peer. 582 */ 583 DK3_ERROR_CONNECTION_RESET, 584 585 /** Peer address is required to send over connectionless socket. 586 */ 587 DK3_ERROR_ADDRESS_REQUIRED, 588 589 /** Writing to a pipe no-one is reading. 590 */ 591 DK3_ERROR_PIPE, 592 593 /** End of input found. 594 */ 595 DK3_ERROR_END_OF_INPUT, 596 597 /** Socket not connected. 598 */ 599 DK3_ERROR_SOCKET_NOT_CONNECTED, 600 601 /** Listen operation failed on socket. 602 */ 603 DK3_ERROR_LISTEN_FAILED, 604 605 /** Failed to accept incoming connection request. 606 */ 607 DK3_ERROR_ACCEPT_FAILED, 608 609 /** Connection attempt aborted. 610 */ 611 DK3_ERROR_CONNECTION_ABORTED, 612 613 /** Error in network protocol. 614 */ 615 DK3_ERROR_NETWORK_PROTOCOL, 616 617 /** Message was not sent completely. 618 */ 619 DK3_ERROR_MESSAGE_NOT_SENT_COMPLETELY, 620 621 /** Network subsystem or Winsock not ready. 622 */ 623 DK3_ERROR_NETWORK_SUBSYSTEM_NOT_READY, 624 625 /** The address is not available! 626 */ 627 DK3_ERROR_ADDRESS_NOT_AVAILABLE, 628 629 /** Host (temporarily) unreachable! 630 */ 631 DK3_ERROR_HOST_UNREACHABLE, 632 633 /** Stale NFS file handle. 634 */ 635 DK3_ERROR_STALE_NFS_FILE_HANDLE, 636 637 /** No select function available. 638 */ 639 DK3_ERROR_NO_SELECT, 640 641 /** Iteration failed (no result after maximum number of passes). 642 */ 643 DK3_ERROR_ITERATION 644 }; 645 /**@}*/ 646 647 648 649 /** Installation directories. 650 Order must correspond to order of directories in the dk3inst.c module. 651 */ 652 enum { 653 654 /** Installation prefix (/usr/local). 655 */ 656 DK3_INST_PREFIX = 0, 657 658 /** System configuration directory (/usr/local/etc). 659 */ 660 DK3_INST_SYSCONF = 1, 661 662 /** Data root directory (/usr/local/share). 663 */ 664 DK3_INST_DATAROOT = 2, 665 666 /** Local state directory (/usr/local/var). 667 */ 668 DK3_INST_LOCALSTATE = 3, 669 670 /** bin directory (/usr/local/bin). 671 */ 672 DK3_INST_BIN = 4, 673 674 /** sbin directory (/usr/local/sbin). 675 */ 676 DK3_INST_SBIN = 5, 677 678 /** lib directory (/usr/local/lib). 679 */ 680 DK3_INST_LIB = 6, 681 682 /** include directory (/usr/local/include). 683 */ 684 DK3_INST_INCLUDE = 7, 685 686 /** man directory (/usr/local/share/man). 687 */ 688 DK3_INST_MAN = 8, 689 690 /** Installation prefix again (/usr/local). 691 */ 692 DK3_INST_PREFIX2 = 9, 693 694 /** libexec directory (/usr/local/libexec). 695 */ 696 DK3_INST_LIBEXEC = 10 697 }; 698 699 700 701 /** @defgroup mdtypes Message digest types. 702 Order here must match order in dk3chks -> dk3_checksum_type_names. 703 */ 704 /**@{*/ 705 enum { 706 /** RSA Security, Inc. MD5 message digest. 707 */ 708 DK3_MD_TYPE_MD5 = 1, 709 710 /** SHA-1 message digest. 711 */ 712 DK3_MD_TYPE_SHA_1, 713 714 /** SHA-224 message digest. 715 */ 716 DK3_MD_TYPE_SHA_224, 717 718 /** SHA-256 message digest. 719 */ 720 DK3_MD_TYPE_SHA_256, 721 722 /** SHA-384 message digest. 723 */ 724 DK3_MD_TYPE_SHA_384, 725 726 /** SHA-512 message digest. 727 */ 728 DK3_MD_TYPE_SHA_512, 729 730 /** RIPEMD-160 message digest. 731 */ 732 DK3_MD_TYPE_RIPEMD_160, 733 734 /** Maximum number for digest type. 735 */ 736 DK3_MD_TYPE_MAX = DK3_MD_TYPE_RIPEMD_160 737 }; 738 /**@}*/ 739 740 741 742 /** @defgroup dataencoding Data encoding. 743 Order here must match order in dk3enc -> dk3_data_encoding_names. 744 */ 745 /**@{*/ 746 enum { 747 /** Hexadecimal encoding. 748 */ 749 DK3_DATA_ENCODING_HEX = 0, 750 751 /** ASCII-85 encoding. 752 */ 753 DK3_DATA_ENCODING_ASCII85, 754 755 /** Reverse ASCII-85 encoding. 756 */ 757 DK3_DATA_ENCODING_REVERSE_ASCII85, 758 759 /** Maximum number for encoding. 760 */ 761 DK3_DATA_ENCODING_MAX = DK3_DATA_ENCODING_REVERSE_ASCII85 762 }; 763 /**@}*/ 764 765 766 767 /** Signal handling types. 768 Different signal handling mechanisms are available for different 769 operating systems. 770 */ 771 enum { 772 /** No signal handling available. 773 */ 774 DK3_SIGNAL_HANDLING_TYPE_NONE = 0, 775 776 /** Use signal() function. 777 */ 778 DK3_SIGNAL_HANDLING_TYPE_SIGNAL, 779 780 /** Use sigset() function. 781 */ 782 DK3_SIGNAL_HANDLING_TYPE_SIGSET, 783 784 /** Use sigaction() function. 785 */ 786 DK3_SIGNAL_HANDLING_TYPE_SIGACTION 787 }; 788 789 790 /** @defgroup rndtypes Random number generator types. 791 Depending on the OS and the installed libraries there are different 792 PRNGs available. 793 */ 794 /**@{*/ 795 enum { 796 /** PRNG type: OpenSSL. 797 */ 798 DK3_PRNG_OPENSSL = 1, 799 800 /** PRNG type: initstate()/setstate(). 801 */ 802 DK3_PRNG_STATE = 2, 803 804 /** PRNG type: nrand48(). 805 */ 806 DK3_PRNG_RAND48 = 4, 807 808 /** PRNG type: rand(). 809 */ 810 DK3_PRNG_SIMPLE = 8, 811 812 /** Mask to enable all PRNG types. 813 */ 814 DK3_PRNG_ALL = 815 (DK3_PRNG_OPENSSL + DK3_PRNG_STATE + DK3_PRNG_RAND48 + DK3_PRNG_SIMPLE) 816 }; 817 /**@}*/ 818 819 820 821 /** Application commands. 822 */ 823 enum { 824 /** Show help. 825 */ 826 DK3_APP_CMD_HELP = 1, 827 828 /** Show version. 829 */ 830 DK3_APP_CMD_VERSION = 2, 831 832 /** Show license conditions. 833 */ 834 DK3_APP_CMD_LICENSE = 4 835 }; 836 837 838 /** @defgroup outputfiltercelltypes Output filter cell types. 839 */ 840 /**@{*/ 841 enum { 842 /** Output filter cell type: Binary to hex encoding. 843 */ 844 DK3_OF_CELL_TYPE_HEX = 0, 845 846 /** Output filter cell type: Binary to ASCII85 encoding. 847 */ 848 DK3_OF_CELL_TYPE_A85, 849 850 /** Output filter cell type: Run-length compression. 851 */ 852 DK3_OF_CELL_TYPE_RUN_LENGTH, 853 854 /** Output filter cell type: Flate compression. 855 */ 856 DK3_OF_CELL_TYPE_FLATE 857 }; 858 /**@}*/ 859 860 861 862 /** Sizes for flate buffers. */ 863 enum { 864 /** Input buffer size for flate compression. 865 */ 866 DK3_OF_FLATE_IN_BUFFER_SIZE = 1024, 867 868 /** Output buffer size for flate compression 869 (in theory 1057 would suffice). 870 */ 871 DK3_OF_FLATE_OUT_BUFFER_SIZE = 1536 872 }; 873 874 875 876 /** @defgroup databasetypes Database types. */ 877 /**@{*/ 878 enum { 879 /** Database type: Not yet set. 880 */ 881 DK3_DB_TYPE_UNKNOWN = -1, 882 /** Database type: In-memory database, synchronize on 883 explicit request and on close only. 884 */ 885 DK3_DB_TYPE_MEMORY = 0, 886 887 /** Database type: Berkeley DB. 888 */ 889 DK3_DB_TYPE_BDB = 1, 890 891 /** Database type: NDBM. 892 */ 893 DK3_DB_TYPE_NDBM = 2 894 }; 895 /**@}*/ 896 897 898 899 /** Database type for SQL databases. */ 900 enum { 901 /** SQL database type: Not type configured yet. 902 */ 903 DK3_SQLDB_TYPE_UNKNOWN = -1, 904 905 /** SQL database type: Not type configured yet. 906 */ 907 DK3_SQLDB_TYPE_MYSQL = 0 908 }; 909 910 911 912 /** @defgroup databaseaccess Access types for databases. */ 913 /**@{*/ 914 enum { 915 /** Database access: Read only. 916 */ 917 DK3_DB_ACCESS_READ = 1, 918 919 /** Database access: Write entries. 920 */ 921 DK3_DB_ACCESS_WRITE = 2 922 }; 923 /**@}*/ 924 925 926 927 /** Text and object alignments. 928 */ 929 enum { 930 /** Align: Horizontally and vertically centered. 931 */ 932 DK3_ALIGN_CENTER = 0, 933 934 /** Align: Horizontally centered. 935 */ 936 DK3_ALIGN_CENTER_HORIZONTAL = 0, 937 938 /** Align: Left. 939 */ 940 DK3_ALIGN_LEFT = 1, 941 942 /** Align: Right. 943 */ 944 DK3_ALIGN_RIGHT = 2, 945 946 /** Align: Mask to retrieve horizontal alignment. 947 */ 948 DK3_ALIGN_HORIZONTAL = 3, 949 950 /** Align: Vertically centered. 951 */ 952 DK3_ALIGN_CENTER_VERTICAL = 0, 953 954 /** Align: Top. 955 */ 956 DK3_ALIGN_TOP = 4, 957 958 /** Align: Bottom. 959 */ 960 DK3_ALIGN_BOTTOM = 8, 961 962 /** Align: Mask to retrieve vertical alignment. 963 */ 964 DK3_ALIGN_VERTICAL = 12 965 }; 966 967 968 969 /** @defgroup retrieveguialignment Retrieve GUI alignment. 970 */ 971 /**@{*/ 972 /** Retrieve horizontal alignment from horizontal/vertical combination. 973 */ 974 #define DK3_ALIGN_GET_HORIZONTAL(x) ((x) & DK3_ALIGN_HORIZONTAL) 975 976 /** Retrieve vertical alignment from horizontal/vertical combination. 977 */ 978 #define DK3_ALIGN_GET_VERTICAL(x) ((x) & DK3_ALIGN_VERTICAL) 979 /**@}*/ 980 981 982 983 /** @defgroup colorspaces Color spaces for bitmaps. 984 */ 985 /**@{*/ 986 enum { 987 /** Color space: Not defined yet. 988 */ 989 DK3_COLOR_SPACE_UNKNOWN = 0, 990 991 /** Color space: Grey. 992 */ 993 DK3_COLOR_SPACE_GRAY, 994 995 /** Color space: Grey with alpha channel. 996 */ 997 DK3_COLOR_SPACE_GRAY_ALPHA, 998 999 /** Color space: RGB. 1000 */ 1001 DK3_COLOR_SPACE_RGB, 1002 1003 /** Color space: RGB with alpha channel. 1004 */ 1005 DK3_COLOR_SPACE_RGBA, 1006 1007 /** Color space: CMYK. 1008 */ 1009 DK3_COLOR_SPACE_CMYK, 1010 1011 /** Color space: Y Cb Cr 1012 */ 1013 DK3_COLOR_SPACE_YCbCr, 1014 1015 /** Color space: Y Cb Cr K (inverted CMYK?) 1016 */ 1017 DK3_COLOR_SPACE_YCCK, 1018 1019 /** Color space: Hue, saturation, brightness. 1020 */ 1021 DK3_COLOR_SPACE_HSB, 1022 }; 1023 /**@}*/ 1024 1025 1026 1027 /** @defgroup linecap Line cap styles. */ 1028 /**@{*/ 1029 enum { 1030 /** Line cap: Butted. 1031 */ 1032 DK3_LINECAP_BUTT = 0, 1033 1034 /** Line cap: Rounded. 1035 */ 1036 DK3_LINECAP_ROUND, 1037 1038 /** Line cap: Half linewidt added. 1039 */ 1040 DK3_LINECAP_SQUARE 1041 }; 1042 /**@}*/ 1043 1044 1045 1046 /** Line join styles. */ 1047 enum { 1048 /** Line join: Mitered. 1049 */ 1050 DK3_LINEJOIN_MITER = 0, 1051 1052 /** Line join: Rounded corner. 1053 */ 1054 DK3_LINEJOIN_ROUND, 1055 1056 /** Line join: Cut corner. 1057 */ 1058 DK3_LINEJOIN_BEVEL 1059 }; 1060 1061 1062 1063 /** @defgroup bifimagetypes BIF image types. 1064 */ 1065 /**@{*/ 1066 enum { 1067 /** Image type: Unknown. 1068 */ 1069 DK3_BIF_IMAGE_TYPE_UNKNOWN = -1, 1070 1071 /** Image type: PNG. 1072 */ 1073 DK3_BIF_IMAGE_TYPE_PNG = 0, 1074 1075 /** Image type: JPEG. 1076 */ 1077 DK3_BIF_IMAGE_TYPE_JPEG = 1, 1078 1079 /** Image type: TIFF. 1080 */ 1081 DK3_BIF_IMAGE_TYPE_TIFF = 4 1082 }; 1083 /**@}*/ 1084 1085 1086 1087 /** @defgroup bifanalysis Analysis types for bitmap images. 1088 */ 1089 /**@{*/ 1090 enum { 1091 /** Bitmap image analysis: Number of bits necessary. 1092 */ 1093 DK3_BIF_ANALYSIS_BITS = 1, 1094 1095 /** Bitmap image analysis: Color really used. 1096 */ 1097 DK3_BIF_ANALYSIS_COLOR = 2, 1098 1099 /** Bitmap image analysis: Alpha channel really used. 1100 */ 1101 DK3_BIF_ANALYSIS_ALPHA = 4, 1102 1103 /** Bitmap image analysis: Complete analysis 1104 */ 1105 DK3_BIF_ANALYSIS_ALL = 7, 1106 1107 /** Bitmap image analysis: Analysis to prepare PS output. 1108 */ 1109 DK3_BIF_ANALYSIS_FOR_PS = 3, 1110 }; 1111 /**@}*/ 1112 1113 1114 1115 /** @defgroup dkbmmodes Run modes for dkbm and wxdkbm. 1116 */ 1117 /**@{*/ 1118 enum { 1119 /** Bitmap to PS/PDF conversion: Create standalone image. 1120 1121 Alpha channel: The image is mixed against a background color 1122 defined in the source file or on the command line or mixed against 1123 white if there is no background chunk. 1124 1125 Frames: If the input contains multiple frames only the first 1126 frame is used. 1127 1128 An optional resolution chunk from the source file is used 1129 to scale the image, otherwise each pixel is sized to 1 PS/PDF point. 1130 No automatic rotation. 1131 1132 A showpage instruction is written to PS output, not to EPS 1133 output. 1134 */ 1135 DK3_BMEPS_MODE_IMAGE = 0, 1136 1137 /** Bitmap to PS/PDF conversion: Create object to embed in a document. 1138 1139 Alpha channel for EPS output: The image is mixed against 1140 a background specified in the file or on the command line or against 1141 a white background. 1142 1143 Alpha channel for PDF output: The alpha channel is transferred 1144 to the output so the object can be placed over other objects. 1145 1146 Frames: If the input file contains multiple frames only the first 1147 frame is used. 1148 1149 Each pixel is sized to 1 PS/PDF point. No automatic rotation. 1150 Scaling and rotating is up to the application processing 1151 the document in which the object is embedded. 1152 1153 No showpage instruction is written to PS output. 1154 */ 1155 DK3_BMEPS_MODE_OBJECT = 1, 1156 1157 /** Bitmap to PS/PDF conversion: Create print job or standalone PDF file. 1158 1159 Alpha channel: The image is mixed against a background color 1160 defined in the source file or on command line or mixed against 1161 white if there is no background chunk. 1162 1163 Frames: If the input contains multiple frames all frames are 1164 used, the output contains multiple pages. 1165 1166 The image is placed in a given area to fill it optimally. 1167 Automatic rotation may occur to best fit the area. 1168 1169 For PS output a showpage instruction is written at the end 1170 of each page. 1171 */ 1172 DK3_BMEPS_MODE_DOCUMENT = 2, 1173 1174 /** Bitmap to PS/PDF conversion: Create object to embed in a document 1175 in a given area. 1176 1177 Alpha channel for EPS output: The image is mixed against 1178 a background specified in the file or on the command line or against 1179 a white background. 1180 1181 Alpha channel for PDF output: The alpha channel is transferred 1182 to the output so the object can be placed over other objects. 1183 1184 Frames: If the input contains multiple frames only the first 1185 frame is used. 1186 1187 The image is placed in a given area with a specified rotation 1188 mode. Rotation depends on a DK3_IMAGE_ORIGIN_xxx value, 1189 see @ref imageorigin. 1190 1191 No showpage instruction is written to PS output. 1192 */ 1193 DK3_BMEPS_MODE_PLACED_OBJECT = 3 1194 }; 1195 /**@}*/ 1196 1197 1198 1199 /** @defgroup bmepsdrivers Output drivers for dkbm/wxdkbm. 1200 */ 1201 /**@{*/ 1202 enum { 1203 /** Bitmap to PS/PDF conversion: Output driver to create PS. 1204 */ 1205 DK3_BMEPS_DRIVER_PS = 0, 1206 1207 /** Bitmap to PS/PDF conversion: Output driver to create EPS. 1208 */ 1209 DK3_BMEPS_DRIVER_EPS, 1210 1211 /** Bitmap to PS/PDF conversion: Output driver to create PDF. 1212 */ 1213 DK3_BMEPS_DRIVER_PDF, 1214 1215 /** Bitmap to PS/PDF conversion: Output driver to create a bounding box. 1216 */ 1217 DK3_BMEPS_DRIVER_BB, 1218 1219 /** Bitmap to PS/PDF conversion: Output driver for print using wxWidgets. 1220 */ 1221 DK3_BMEPS_DRIVER_WXPRINT 1222 }; 1223 /**@}*/ 1224 1225 1226 1227 /** @defgroup bmepssizehandling Size handling in bmeps. 1228 */ 1229 /**@{*/ 1230 enum { 1231 /** Bmeps size handling: 1 pixel corresponds to 1 PS point. 1232 */ 1233 DK3_BMEPS_SIZE_1_1 = 0, 1234 1235 /** Bmeps size handling: Use resolution chunk from input file. 1236 */ 1237 DK3_BMEPS_SIZE_CHUNK, 1238 1239 /** Bmeps size handling: DPI size specified. 1240 */ 1241 DK3_BMEPS_SIZE_SPECIFIED, 1242 1243 /** Bmeps size handling: Paper size specified. 1244 */ 1245 DK3_BMEPS_SIZE_PAPER 1246 }; 1247 /**@}*/ 1248 1249 1250 1251 /** @defgroup imageorigin Rotation instructions for images. 1252 In XFig and transfig images are rotated depending on the 1253 position of the first image rectangle point click and 1254 the flipped flag. 1255 */ 1256 /**@{*/ 1257 enum { 1258 /** Image placement: First click in left top point, not flipped. 1259 */ 1260 DK3_IMAGE_ORIGIN_LEFT_TOP = 0, 1261 1262 /** Image placement: First click in left bottom point, not flipped. 1263 */ 1264 DK3_IMAGE_ORIGIN_LEFT_BOTTOM, 1265 1266 /** Image placement: First click in right top point, not flipped. 1267 */ 1268 DK3_IMAGE_ORIGIN_RIGHT_TOP, 1269 1270 /** Image placement: First click in right bottom point, not flipped. 1271 */ 1272 DK3_IMAGE_ORIGIN_RIGHT_BOTTOM, 1273 1274 /** Image placement: First click in left top point, flipped. 1275 */ 1276 DK3_IMAGE_ORIGIN_LEFT_TOP_FLIPPED, 1277 1278 /** Image placement: First click in left bottom point, flipped. 1279 */ 1280 DK3_IMAGE_ORIGIN_LEFT_BOTTOM_FLIPPED, 1281 1282 /** Image placement: First click in right top point, flipped. 1283 */ 1284 DK3_IMAGE_ORIGIN_RIGHT_TOP_FLIPPED, 1285 1286 /** Image placement: First click in right bottom point, flipped. 1287 */ 1288 DK3_IMAGE_ORIGIN_RIGHT_BOTTOM_FLIPPED 1289 }; 1290 /**@}*/ 1291 1292 1293 1294 /** @defgroup flatepredictors Predictors for flate compression. 1295 */ 1296 /**@{*/ 1297 enum { 1298 /** Compression predictor: None. 1299 */ 1300 DK3_COMPRESSION_PREDICTOR_NONE = 0, 1301 1302 /** Compression predictor: TIFF. 1303 */ 1304 DK3_COMPRESSION_PREDICTOR_TIFF, 1305 1306 /** Compression predictor: PNG sub (value left). 1307 */ 1308 DK3_COMPRESSION_PREDICTOR_PNG_SUB, 1309 1310 /** Compression predictor: PNG up (value above). 1311 */ 1312 DK3_COMPRESSION_PREDICTOR_PNG_UP, 1313 1314 /** Compression predictor: PNG average. 1315 */ 1316 DK3_COMPRESSION_PREDICTOR_PNG_AVERAGE, 1317 1318 /** Compression predictor: PNG paeth. 1319 */ 1320 DK3_COMPRESSION_PREDICTOR_PNG_PAETH 1321 }; 1322 /**@}*/ 1323 1324 1325 1326 /** Run state. 1327 */ 1328 enum { 1329 /** Run state: No autorun required. 1330 */ 1331 DK3_WX_AUTOSTART_NORMAL = 0, 1332 1333 /** Run state: Waiting for autorun start. 1334 */ 1335 DK3_WX_AUTOSTART_START, 1336 1337 /** Run state: Running. 1338 */ 1339 DK3_WX_AUTOSTART_RUNNING, 1340 1341 /** Run state: Finished, application can exit. 1342 */ 1343 DK3_WX_AUTOSTART_FINISHED, 1344 1345 /** Run state: Application allowed to exit and notified about that. 1346 */ 1347 DK3_WX_AUTOSTART_WAIT_FOR_EXIT 1348 }; 1349 1350 1351 1352 /** OpenSSL PRNG seeding. 1353 */ 1354 enum { 1355 /** Number of bytes required to seed OpenSSL PRNG. 1356 */ 1357 DK3_SEED_OPENSSL_BYTES = 1024 1358 }; 1359 1360 1361 1362 /** Paper size configuration file. 1363 */ 1364 enum { 1365 /** Configuration line size for paper formats. 1366 */ 1367 DK3_PAPER_CONFIG_LINE_SIZE = 256 1368 }; 1369 1370 1371 1372 /** @defgroup pdfxobjecttype XObject types for PDF creation. 1373 */ 1374 /**@{*/ 1375 enum { 1376 /** XObject represents an image. 1377 */ 1378 DK3_PDF_XO_TYPE_IMAGE = 1, 1379 1380 /** XObject represents an alpha mask. 1381 */ 1382 DK3_PDF_XO_TYPE_ALPHA 1383 }; 1384 /**@}*/ 1385 1386 1387 1388 /** @defgroup shutdownvalues Values for socket shutdown. 1389 */ 1390 /**@{*/ 1391 enum { 1392 /** Shutdown socket for read access. 1393 */ 1394 DK3_TCPIP_SHUTDOWN_READ = 0, 1395 1396 /** Shutdown socket for write access. 1397 */ 1398 DK3_TCPIP_SHUTDOWN_WRITE, 1399 1400 /** Shutdown socket for both read and write access. 1401 */ 1402 DK3_TCPIP_SHUTDOWN_RW 1403 }; 1404 /**@}*/ 1405 1406 1407 1408 #if 0 1409 /** Socket states. 1410 */ 1411 enum { 1412 /** Socket state: Initialized. 1413 */ 1414 DK3_SOCKET_STATE_INITIALIZED = 1 1415 }; 1416 #endif 1417 1418 1419 1420 /** SNMP versions. 1421 */ 1422 enum { 1423 /** SNMP version not (yet) known. 1424 */ 1425 DK3_SNMP_VERSION_UNKNOWN = 0, 1426 1427 /** SNMP version: 1. 1428 */ 1429 DK3_SNMP_VERSION_1, 1430 1431 /** SNMP version: 2c. 1432 */ 1433 DK3_SNMP_VERSION_2C, 1434 1435 /** SNMP version: 2p. 1436 */ 1437 DK3_SNMP_VERSION_2P, 1438 1439 /** SNMP version: 3. 1440 */ 1441 DK3_SNMP_VERSION_3 1442 }; 1443 1444 1445 1446 /** Font features. 1447 */ 1448 enum { 1449 /** Roman font. 1450 */ 1451 DK3_FONT_ROMAN = 0, 1452 1453 /** Sans-serif font. 1454 */ 1455 DK3_FONT_SANS_SERIF = 1, 1456 1457 /** Typewriter font. 1458 */ 1459 DK3_FONT_TYPEWRITER = 2, 1460 1461 /** Mask to retrieve font category. 1462 */ 1463 DK3_FONT_FAMILY = 3, 1464 1465 /** Bold font. 1466 */ 1467 DK3_FONT_BOLD = 4, 1468 1469 /** Italic font (in german: kursiv). 1470 */ 1471 DK3_FONT_ITALIC = 8, 1472 1473 /** Oblique font (in german: schraeggestellt). 1474 */ 1475 DK3_FONT_OBLIQUE = 16, 1476 1477 /** Mask value to check if text is either bold or oblique. 1478 */ 1479 DK3_FONT_ITOB = 24 1480 }; 1481 1482 1483 1484 /** PS fonts. 1485 We use the same font order as the Fig file standard. 1486 */ 1487 enum { 1488 /** PS font: Default font (Times Roman). 1489 */ 1490 DK3_FONT_PS_DEFAULT = -1, 1491 1492 /** PS font: Times Roman. 1493 */ 1494 DK3_FONT_PS_TIMES_ROMAN = 0, 1495 1496 /** PS font: Times Roman Italic. 1497 */ 1498 DK3_FONT_PS_TIMES_ITALIC, 1499 1500 /** PS font: Times Roman Bold. 1501 */ 1502 DK3_FONT_PS_TIMES_BOLD, 1503 1504 /** PS font: Times Roman Bold Italic. 1505 */ 1506 DK3_FONT_PS_TIMES_BOLD_ITALIC, 1507 1508 /** PS font: Avantgarde Book. 1509 */ 1510 DK3_FONT_PS_AVANTGARDE_BOOK, 1511 1512 /** PS font: Avantgarde Book Oblique. 1513 */ 1514 DK3_FONT_PS_AVANTGARDE_BOOK_OBLIQUE, 1515 1516 /** PS font: Avantgarde Demi. 1517 */ 1518 DK3_FONT_PS_AVANTGARDE_DEMI, 1519 1520 /** PS font: Avantgarde Demi Oblique. 1521 */ 1522 DK3_FONT_PS_AVANTGARDE_DEMI_OBLIQUE, 1523 1524 /** PS font: Bookman Light. 1525 */ 1526 DK3_FONT_PS_BOOKMAN_LIGHT, 1527 1528 /** PS font: Bookman Light Italic. 1529 */ 1530 DK3_FONT_PS_BOOKMAN_LIGHT_ITALIC, 1531 1532 /** PS font: Bookman Demi. 1533 */ 1534 DK3_FONT_PS_BOOKMAN_DEMI, 1535 1536 /** PS font: Bookman Demi Italic. 1537 */ 1538 DK3_FONT_PS_BOOKMAN_DEMI_ITALIC, 1539 1540 /** PS font: Courier. 1541 */ 1542 DK3_FONT_PS_COURIER, 1543 1544 /** PS font: Courier Oblique. 1545 */ 1546 DK3_FONT_PS_COURIER_OBLIQUE, 1547 1548 /** PS font: Courier Bold. 1549 */ 1550 DK3_FONT_PS_COURIER_BOLD, 1551 1552 /** PS font: Courier Bold Oblique. 1553 */ 1554 DK3_FONT_PS_COURIER_BOLD_OBLIQUE, 1555 1556 /** PS font: Helvetica. 1557 */ 1558 DK3_FONT_PS_HELVETICA, 1559 1560 /** PS font: Helvetica Oblique. 1561 */ 1562 DK3_FONT_PS_HELVETICA_OBLIQUE, 1563 1564 /** PS font: Helvetica Bold. 1565 */ 1566 DK3_FONT_PS_HELVETICA_BOLD, 1567 1568 /** PS font: Helvetica Bold Oblique. 1569 */ 1570 DK3_FONT_PS_HELVETICA_BOLD_OBLIQUE, 1571 1572 /** PS font: Helvetica Narrow. 1573 */ 1574 DK3_FONT_PS_HELVETICA_NARROW, 1575 1576 /** PS font: Helvetica Narrow Oblique. 1577 */ 1578 DK3_FONT_PS_HELVETICA_NARROW_OBLIQUE, 1579 1580 /** PS font: Helvetica Narrow Bold. 1581 */ 1582 DK3_FONT_PS_HELVETICA_NARROW_BOLD, 1583 1584 /** PS font: Helvetica Narrow Bold Oblique. 1585 */ 1586 DK3_FONT_PS_HELVETICA_NARROW_BOLD_OBLIQUE, 1587 1588 /** PS font: New Century Schoolbook Roman. 1589 */ 1590 DK3_FONT_PS_NEW_CENTURY_SCHOOLBOOK_ROMAN, 1591 1592 /** PS font: New Century Schoolbook Italic. 1593 */ 1594 DK3_FONT_PS_NEW_CENTURY_SCHOOLBOOK_ITALIC, 1595 1596 /** PS font: New Century Schoolbook Bold. 1597 */ 1598 DK3_FONT_PS_NEW_CENTURY_SCHOOLBOOK_BOLD, 1599 1600 /** PS font: New Century Schoolbook Bold Italic. 1601 */ 1602 DK3_FONT_PS_NEW_CENTURY_SCHOOLBOOK_BOLD_ITALIC, 1603 1604 /** PS font: Palatino Roman. 1605 */ 1606 DK3_FONT_PS_PALATINO_ROMAN, 1607 1608 /** PS font: Palatino Roman Italic. 1609 */ 1610 DK3_FONT_PS_PALATINO_ITALIC, 1611 1612 /** PS font: Palatino Roman Bold. 1613 */ 1614 DK3_FONT_PS_PALATINO_BOLD, 1615 1616 /** PS font: Palatino Roman Bold Italic. 1617 */ 1618 DK3_FONT_PS_PALATINO_BOLD_ITALIC, 1619 1620 /** PS font: Symbol. 1621 */ 1622 DK3_FONT_PS_SYMBOL, 1623 1624 /** PS font: Zapf Chancery. 1625 */ 1626 DK3_FONT_PS_ZAPF_CHANCERY_MEDIUM_ITALIC, 1627 1628 /** PS font: Zapf Dingbats. 1629 */ 1630 DK3_FONT_PS_ZAPF_DINGBATS 1631 }; 1632 1633 1634 1635 /** @defgroup printertypes Printer types. 1636 */ 1637 /**@{*/ 1638 enum { 1639 /** Printer type: Unspecified/unknown. 1640 */ 1641 DK3_PRINTER_TYPE_NONE = 0, 1642 1643 /** Printer type: Windows system printer. 1644 */ 1645 DK3_PRINTER_TYPE_WINDOWS, 1646 1647 /** Printer type: Raw socket. 1648 */ 1649 DK3_PRINTER_TYPE_SOCKET, 1650 1651 /** Printer type: LPD. 1652 */ 1653 DK3_PRINTER_TYPE_LPD, 1654 1655 /** Printer type: LPRng. 1656 */ 1657 DK3_PRINTER_TYPE_LPRNG 1658 }; 1659 /**@}*/ 1660 1661 1662 1663 /* Not an enum: 1664 The dkChar data type has different size, can be 8, 16 or 1665 32 bit long. So our constants can not be type int, and thus 1666 not enum. 1667 */ 1668 /** @defgroup characters Characters. */ 1669 /**@{*/ 1670 #if DK3_CHAR_SIZE > 1 1671 #if DK3_CHAR_SIZE > 2 1672 /* +++ 32 bit +++ */ 1673 /** String finalizer. 1674 */ 1675 #define DK3_CHAR_0 0UL 1676 1677 /** Byte order marker (BOM) 1678 */ 1679 #define DK3_CHAR_BOM 0x0000FEFFUL 1680 1681 /** Backslash. 1682 */ 1683 #define DK3_CHAR_BS 0x0000005CUL 1684 1685 /** Slash. 1686 */ 1687 #define DK3_CHAR_SLASH 0x0000002FUL 1688 1689 /** Minus. 1690 */ 1691 #define DK3_CHAR_MINUS 0x0000002DUL 1692 1693 #if DK3_HAVE_BACKSLASH 1694 /** File name separator. 1695 */ 1696 #define DK3_CHAR_SEP 0x0000005CUL 1697 /** Not a file name separator. 1698 */ 1699 #define DK3_CHAR_NOSEP 0x0000002FUL 1700 #else 1701 /** File name separator. 1702 */ 1703 #define DK3_CHAR_SEP 0x0000002FUL 1704 /** Not a file name separator. 1705 */ 1706 #define DK3_CHAR_NOSEP 0x0000005CUL 1707 #endif 1708 /** Newline. 1709 */ 1710 #define DK3_CHAR_NL 0x0000000AUL 1711 /** Dot. 1712 */ 1713 #define DK3_CHAR_DOT 0x0000002EUL 1714 /* --- 32 bit --- */ 1715 #else 1716 /* +++ 16 bit +++ */ 1717 /** String finalizer. 1718 */ 1719 #define DK3_CHAR_0 0U 1720 1721 /** Byte order marker (BOM). 1722 */ 1723 #define DK3_CHAR_BOM 0xFEFFU 1724 1725 /** Backslash. 1726 */ 1727 #define DK3_CHAR_BS 0x005CU 1728 1729 /** Slash. 1730 */ 1731 #define DK3_CHAR_SLASH 0x002FU 1732 1733 /** Minus. 1734 */ 1735 #define DK3_CHAR_MINUS 0x002DU 1736 1737 #if DK3_HAVE_BACKSLASH 1738 /** File name separator. 1739 */ 1740 #define DK3_CHAR_SEP 0x005CU 1741 /** Not a file name separator. 1742 */ 1743 #define DK3_CHAR_NOSEP 0x002FU 1744 #else 1745 /** File name separator. 1746 */ 1747 #define DK3_CHAR_SEP 0x002FU 1748 /** Not a file name separator. 1749 */ 1750 #define DK3_CHAR_NOSEP 0x005CU 1751 #endif 1752 /** Newline. 1753 */ 1754 #define DK3_CHAR_NL 0x000AU 1755 /** Dot. 1756 */ 1757 #define DK3_CHAR_DOT 0x002EU 1758 /* --- 16 bit --- */ 1759 #endif 1760 #else 1761 /* +++ 8 bit +++ */ 1762 /** String finalizer. 1763 */ 1764 #define DK3_CHAR_0 '\0' 1765 1766 /** Backslash. 1767 */ 1768 #define DK3_CHAR_BS '\\' 1769 1770 /** Slash. 1771 */ 1772 #define DK3_CHAR_SLASH '/' 1773 1774 /** Minus 1775 */ 1776 #define DK3_CHAR_MINUS '-' 1777 1778 #if DK3_HAVE_BACKSLASH 1779 /** File name separator. 1780 */ 1781 #define DK3_CHAR_SEP '\\' 1782 /** Not a file name separator. 1783 */ 1784 #define DK3_CHAR_NOSEP '/' 1785 #else 1786 /** File name separator. 1787 */ 1788 #define DK3_CHAR_SEP '/' 1789 /** Not a file name separator. 1790 */ 1791 #define DK3_CHAR_NOSEP '\\' 1792 #endif 1793 /** Newline. 1794 */ 1795 #define DK3_CHAR_NL '\n' 1796 /** Dot. 1797 */ 1798 #define DK3_CHAR_DOT '.' 1799 /* --- 8 bit --- */ 1800 #endif 1801 1802 /**@}*/ 1803 1804 1805 1806 #ifndef DK3_MAX_PATH 1807 #if DK3_ON_WINDOWS 1808 #ifdef _MAX_PATH 1809 #define DK3_MAX_PATH _MAX_PATH 1810 #else 1811 /** Maximum file name (path) length. 1812 */ 1813 #define DK3_MAX_PATH 1024 1814 #endif 1815 #else 1816 #ifdef MAX_PATH_LEN 1817 /** Maximum file name (path) length. 1818 */ 1819 #define DK3_MAX_PATH MAX_PATH_LEN 1820 #else 1821 /** Maximum file name (path) length. 1822 */ 1823 #define DK3_MAX_PATH 1024 1824 #endif 1825 #endif 1826 #endif 1827 1828 1829 1830 /* Not an enum: 1831 As we might have multiple dk3_stat_t in use at same time 1832 we used the smallest possible data type -- unsigned char -- for 1833 this information. 1834 */ 1835 /** @defgroup statadditional Additional information from stat 1836 The dk3sf_stat() function internally uses both stat() and lstat() to 1837 retrieve information. 1838 */ 1839 /**@{*/ 1840 /** The link owner is not the same user as the link targets owner. 1841 */ 1842 #define DK3_STAT_AI_USER_DIFFERS 0x01 1843 1844 /** The link owner group is not the same as the link targets owner group. 1845 */ 1846 #define DK3_STAT_AI_GROUP_DIFFERS 0x02 1847 1848 /** Link and link target are on different file systems. 1849 */ 1850 #define DK3_STAT_AI_FAR_LINK 0x04 1851 /**@}*/ 1852 1853 1854 1855 /* Not an enum: 1856 As we might have multiple outut streams in use at same 1857 time we used the smallest possible data type. 1858 */ 1859 /** @defgroup outputfiltertypes Output filter flags. 1860 */ 1861 /**@{*/ 1862 /** Flag: Use cr/nl sequence. 1863 */ 1864 #define DK3_OF_FLAG_CRNL 0x01 1865 1866 /** Flag: Add finalizer to end of output. 1867 */ 1868 #define DK3_OF_FLAG_FINALIZE 0x02 1869 /**@}*/ 1870 1871 1872 1873 /* Not an enum: 1874 As there are a lot of probable error conditions we 1875 use an unsigned long here for the bits. 1876 */ 1877 /** @defgroup snmpprintererrors SNMP reported printer errors. 1878 Note: The unsigned long value is filled beginning from the LSB 1879 when reading the SNMP response beginning from the MSB of the 1880 first byte. 1881 */ 1882 /**@{*/ 1883 1884 /** Printer error condition: Paper low. 1885 */ 1886 #define DK3_SNMP_PRINTER_ERROR_LOW_PAPER 0x00000001UL 1887 1888 /** Printer error condition: No paper available. 1889 */ 1890 #define DK3_SNMP_PRINTER_ERROR_NO_PAPER 0x00000002UL 1891 1892 /** Printer error condition: Toner low. 1893 */ 1894 #define DK3_SNMP_PRINTER_ERROR_LOW_TONER 0x00000004UL 1895 1896 /** Printer error condition: Toner empty. 1897 */ 1898 #define DK3_SNMP_PRINTER_ERROR_NO_TONER 0x00000008UL 1899 1900 /** Printer error condition: Door is open 1901 */ 1902 #define DK3_SNMP_PRINTER_ERROR_DOOR_OPEN 0x00000010UL 1903 1904 /** Printer error condition: Paper jam. 1905 */ 1906 #define DK3_SNMP_PRINTER_ERROR_JAMMED 0x00000020UL 1907 1908 /** Printer error condition: Printer offline for whatever reason. 1909 */ 1910 #define DK3_SNMP_PRINTER_ERROR_OFFLINE 0x00000040UL 1911 1912 /** Printer error condition: Service needed. 1913 */ 1914 #define DK3_SNMP_PRINTER_ERROR_SERVICE_NEEDED 0x00000080UL 1915 1916 /** Printer error condition: Input tray is missing. 1917 */ 1918 #define DK3_SNMP_PRINTER_ERROR_INPUT_TRAY 0x00000100UL 1919 1920 /** Printer error condition: Output tray is missing. 1921 */ 1922 #define DK3_SNMP_PRINTER_ERROR_OUTPUT_TRAY 0x00000200UL 1923 1924 /** Printer error condition: Marker supply is missing. 1925 */ 1926 #define DK3_SNMP_PRINTER_ERROR_MARKER_SUPPLY 0x00000400UL 1927 1928 /** Printer error condition: Output tray nearly full. 1929 */ 1930 #define DK3_SNMP_PRINTER_ERROR_OUTPUT_NEAR 0x00000800UL 1931 1932 /** Printer error condition: Output tray full. 1933 */ 1934 #define DK3_SNMP_PRINTER_ERROR_OUTPUT_FULL 0x00001000UL 1935 1936 /** Printer error condition: Input tray is empty. 1937 */ 1938 #define DK3_SNMP_PRINTER_ERROR_INPUT_EMPTY 0x00002000UL 1939 1940 /** Printer error condition: Overdue preventive maintenance. 1941 */ 1942 #define DK3_SNMP_PRINTER_ERROR_MAINTENANCE 0x00004000UL 1943 /**@}*/ 1944 1945 1946 1947 /* Not an enum: 1948 As the font encoding information is stored for each 1949 Unicode to LaTeX character conversion we used the smallest 1950 possible data type. 1951 */ 1952 /** @defgroup fontenc LaTeX font encodings. 1953 */ 1954 /**@{*/ 1955 1956 /** No specific requirements. 1957 */ 1958 #define DK3_FONT_ENCODING_NONE ((dk3_font_encoding_t)0x00) 1959 1960 /** OT1 required. 1961 */ 1962 #define DK3_FONT_ENCODING_OT1 ((dk3_font_encoding_t)0x01) 1963 1964 /** Do not use OT1. 1965 */ 1966 #define DK3_FONT_ENCODING_NOT_OT1 ((dk3_font_encoding_t)0x02) 1967 1968 /** T1 required. 1969 */ 1970 #define DK3_FONT_ENCODING_T1 ((dk3_font_encoding_t)0x04) 1971 1972 /** Do not use T1. 1973 */ 1974 #define DK3_FONT_ENCODING_NOT_T1 ((dk3_font_encoding_t)0x08) 1975 1976 /** T4 required. 1977 */ 1978 #define DK3_FONT_ENCODING_T4 ((dk3_font_encoding_t)0x10) 1979 1980 /** Do not use T4. 1981 */ 1982 #define DK3_FONT_ENCODING_NOT_T4 ((dk3_font_encoding_t)0x20) 1983 1984 /** T5 required. 1985 */ 1986 #define DK3_FONT_ENCODING_T5 ((dk3_font_encoding_t)0x40) 1987 1988 /** Do not use T5. 1989 */ 1990 #define DK3_FONT_ENCODING_NOT_T5 ((dk3_font_encoding_t)0x80) 1991 /**@}*/ 1992 1993 1994 /** @defgroup tspres Results from processing one character or line. 1995 */ 1996 /**@{*/ 1997 enum { 1998 /** Text processed successfully. 1999 */ 2000 DK3_TSP_RES_OK = 0, 2001 2002 /** There was an error, but we should attempt 2003 to continue. 2004 */ 2005 DK3_TSP_RES_ERROR , 2006 2007 /** There was a fatal error, stop processing. 2008 */ 2009 DK3_TSP_RES_FATAL 2010 }; 2011 /**@}*/ 2012 2013 2014 2015 2016 #endif 2017 2018