/usr/include/gspool.h is in libgnuspool-dev 1.7ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 | /* xtapi.pre -- preamble for API header file
Copyright 2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _XTAPI_H
#define _XTAPI_H
/* This section built from config.h */
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* Define if Motif combo boxes don't work */
/* #undef BROKEN_COMBOBOX */
/* Define if Motif renditions don't work */
/* #undef BROKEN_RENDITION */
/* Define if Motif spin boxes don't work properly */
/* #undef BROKEN_SPINBOX */
/* Define if read from a raw terminal can return zero bytes */
/* #undef BROKEN_TERM_READ */
/* Define if "delcurterm" is unreliable and causes core dumps */
#define BUGGY_DELCURTERM 1
/* Define if signal(SIGCLD, SIG_IGN) cannot be relied upon */
/* #undef BUGGY_SIGCLD */
/* Define if "sprintf" returns a char* rather than an int */
/* #undef CHARSPRINTF */
/* Define if curses messes-up overlapping subwindows */
#define CURSES_OVERLAP_BUG 1
/* Define to 1 if the `getpgrp' function requires zero arguments. */
#define GETPGRP_VOID 1
/* Define to 1 if you have the `atexit' function. */
#define HAVE_ATEXIT 1
/* Define to 1 if you have the `bcopy' function. */
#define HAVE_BCOPY 1
/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
*/
/* #undef HAVE_DECL_TZNAME */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the `fchmod' function. */
#define HAVE_FCHMOD 1
/* Define to 1 if you have the `fchown' function. */
#define HAVE_FCHOWN 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `fgetc' function. */
#define HAVE_FGETC 1
/* Define to 1 if you have the `ftruncate' function. */
#define HAVE_FTRUNCATE 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `c_s' library (-lc_s). */
/* #undef HAVE_LIBC_S */
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you support file names longer than 14 characters. */
#define HAVE_LONG_FILE_NAMES 1
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mkdir' function. */
#define HAVE_MKDIR 1
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the `rename' function. */
#define HAVE_RENAME 1
/* Define to 1 if you have the `rmdir' function. */
#define HAVE_RMDIR 1
/* Define to 1 if you have the `seteuid' function. */
#define HAVE_SETEUID 1
/* Define to 1 if you have the `setreuid' function. */
#define HAVE_SETREUID 1
/* Define to 1 if you have the `sigaction' function. */
#define HAVE_SIGACTION 1
/* Define to 1 if you have the `sigset' function. */
#define HAVE_SIGSET 1
/* Define to 1 if you have the `sigvec' function. */
#define HAVE_SIGVEC 1
/* Define to 1 if you have the `sigvector' function. */
/* #undef HAVE_SIGVECTOR */
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if `tm_zone' is a member of `struct tm'. */
#define HAVE_STRUCT_TM_TM_ZONE 1
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/filio.h> header file. */
/* #undef HAVE_SYS_FILIO_H */
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define if we are using the terminfo library not termcap */
#define HAVE_TERMINFO 1
/* Define to 1 if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1
/* Define to 1 if you have the <termio.h> header file. */
#define HAVE_TERMIO_H 1
/* Define if terminfo supports the TIGETSTR call */
#define HAVE_TIGETSTR 1
/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
`HAVE_STRUCT_TM_TM_ZONE' instead. */
#define HAVE_TM_ZONE 1
/* Define to 1 if you don't have `tm_zone' but do have the external array
`tzname'. */
/* #undef HAVE_TZNAME */
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `waitpid' function. */
#define HAVE_WAITPID 1
/* Define to 1 if you have the <wait.h> header file. */
#define HAVE_WAIT_H 1
/* Define if Motif version has renditions in */
/* #undef HAVE_XMRENDITION */
/* Define to 1 if you have the <Xm/ComboBox.h> header file. */
/* #undef HAVE_XM_COMBOBOX_H */
/* Define to 1 if you have the <Xm/SpinB.h> header file. */
/* #undef HAVE_XM_SPINB_H */
/* Define if kernel permits setuid to shuffle between uid and euid */
#define ID_SWAP 1
/* Define to set initial job allocation */
#define INITJALLOC 20000
/* Define to set initial printer allocation */
#define INITPALLOC 200
/* Define if motif vn 2 */
/* #undef MOTIF_VN2 */
/* Define to compile for network version */
#define NETWORK_VERSION 1
/* Define if kernel doesn't honour suid bit for root */
/* #undef NHONSUID */
/* Define if DialogTemplates aren't defined in motif libraries */
/* #undef NO_DTEMPLATE */
/* Define if curses.h doesn't include termio.h */
#define NO_TERMIO_IN_CURSES 1
/* Define to size of message queue */
#define NUMXBUFS 409
/* Define if on AIX */
/* #undef OS_AIX */
/* Define if on AIX 4.3 */
/* #undef OS_AIX_4_3 */
/* Define if on AIX 5.0 */
/* #undef OS_AIX_5_0 */
/* Define if on BSDI */
/* #undef OS_BSDI */
/* Define if on DGUX */
/* #undef OS_DGUX */
/* Define if on DPX_2 */
/* #undef OS_DPX_2 */
/* Define if on Dynix (not ptx) */
/* #undef OS_DYNIX */
/* Define if on FreeBSD */
/* #undef OS_FREEBSD */
/* Define if on HPUX */
/* #undef OS_HPUX */
/* Define if on HPUX Itanium */
/* #undef OS_HPUX_IA64 */
/* Define if on GNU/Linux */
#define OS_LINUX 1
/* Define if on OSF1 */
/* #undef OS_OSF1 */
/* Define if on PTX */
/* #undef OS_PTX */
/* Define if on Ultrix */
/* #undef OS_ULTRIX */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME "src/spshed.c"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "src/spshed.c 1.7"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "src-spshed-c"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.7"
/* Define type for process ids */
#define PIDTYPE pid_t
/* Indicate that the poll(2) call is available on sockets */
/* #undef POLLSOCKETS */
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* Indicate that scheduler must run as root - funny "kill" sematics */
/* #undef RUN_AS_ROOT */
/* Define to turn on SCO-style C2 security stuff */
/* #undef SCO_SECURITY */
/* Define to 1 if the `setpgrp' function takes no argument. */
#define SETPGRP_VOID 1
/* Indicate that we are using shadow password files */
#define SHADOW_PW 1
/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of `int *', as computed by sizeof. */
#define SIZEOF_INT_P 8
/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 8
/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
/* The size of `unsigned', as computed by sizeof. */
#define SIZEOF_UNSIGNED 4
/* The size of `unsigned long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG 8
/* The size of `unsigned short', as computed by sizeof. */
#define SIZEOF_UNSIGNED_SHORT 2
/* Define type for final arg of accept etc thanq HP */
#define SOCKLEN_T socklen_t
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if stdio.h defines sys_errlist */
#define SYS_ERRLIST_IN_STDIO_H 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
/* Define to use file locking instead of semaphores */
#define USING_FLOCK 1
/* Define to use Memory-mapped files rather than shared memory */
#define USING_MMAP 1
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#define YYTEXT_POINTER 1
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define this if the C preprocessor doesn't */
/* #undef unix */
#ifdef OS_HPUX
#ifdef OS_HPUX_IA64
#ifndef CID_T_DEFINED
#define CID_T_DEFINED 1
typedef int cid_t;
#endif
#endif
#define _XOPEN_SOURCE_EXTENDED 1
#include <stdarg.h>
#endif
#if SIZEOF_LONG != 4
#if SIZEOF_INT != 4
error: no basic signed 4-byte
#else
#define LONG int
#endif
#else
#define LONG long
#endif
#if SIZEOF_UNSIGNED_LONG != 4
#if SIZEOF_UNSIGNED != 4
error: no basic unsigned 4-byte
#else
#define ULONG unsigned
#endif
#else
#define ULONG unsigned long
#endif
#if SIZEOF_SHORT != 2 || SIZEOF_UNSIGNED_SHORT != 2
error: no basic 2-byte
#else
#define SHORT short
#define USHORT unsigned short
#endif
#if SIZEOF_INT_P != SIZEOF_INT
#define INT_TO_XTPOINTER(X) (XtPointer)(long)(X)
#define XTPOINTER_TO_INT(X) (int)(long)(X)
#else
#define INT_TO_XTPOINTER(X) (XtPointer)(X)
#define XTPOINTER_TO_INT(X) (int)(X)
#endif
#define ROOTID 0
#ifdef __GNUC__
#define NORETURN_FUNC __attribute__ ((noreturn))
#define MAINFN_TYPE int
#else
#define NORETURN_FUNC
#define MAINFN_TYPE
#endif
/* Copied from defaults.h */
#define NAMESIZE 14 /* File name size allowing for restricted names */
#define MAXTITLE 30 /* Size of header */
#define PTRNAMESIZE 28 /* Printer name size */
#define JPTRNAMESIZE (PTRNAMESIZE*2+2)/* Printer name size in job */
#define LINESIZE 29 /* Size of dev field */
#define MAXFORM 34 /* Size of form field INCREASED */
#define MAXFLAGS 62 /* Size of P/P flags buffer */
#define UIDSIZE 11 /* Size of UID field */
#define HOSTNSIZE 14 /* Host name size */
#define PFEEDBACK 39 /* Feedback field on printer */
#define COMMENTSIZE 41 /* Comment size on printer */
#define ALLOWFORMSIZE 63
typedef LONG jobno_t;
typedef LONG netid_t;
typedef LONG slotno_t; /* May be -ve */
typedef LONG int_ugid_t;
typedef LONG int_pid_t;
typedef ULONG classcode_t;
/* Copied from spq.h */
struct apispq { /* Entry in spool queue */
jobno_t apispq_job; /* Job number */
netid_t apispq_netid; /* Network id (local byte order) 0 local */
netid_t apispq_orighost; /* Who it came from 0 if this machine or APISPQ_ROAMUSER set*/
slotno_t apispq_rslot; /* Slot number remote machine */
LONG apispq_time; /* When submitted (these were time_t but 64-bit m/cs choked) */
LONG apispq_proptime; /* Proposal (etc) time in cases messages go astray */
LONG apispq_starttime; /* When (first) started */
LONG apispq_hold; /* Hold until ... */
USHORT apispq_nptimeout; /* Timeout if not printed (hours) */
USHORT apispq_ptimeout; /* Timeout if printed (hours) */
LONG apispq_size; /* Size of job in bytes */
LONG apispq_posn; /* Position in job in bytes */
LONG apispq_pagec; /* Page count in job */
ULONG apispq_npages; /* Number of pages */
unsigned char apispq_cps; /* Copies */
unsigned char apispq_pri; /* Priority */
SHORT apispq_wpri; /* Working priority */
USHORT apispq_jflags; /* Job flags */
#define APISPQ_NOH (1 << 0) /* Suppress heading */
#define APISPQ_WRT (1 << 1) /* Send message to users terminal */
#define APISPQ_MAIL (1 << 2) /* Mail message to user */
#define APISPQ_RETN (1 << 3) /* Retain in Q */
#define APISPQ_ODDP (1 << 4) /* Omit Odd pages */
#define APISPQ_EVENP (1 << 5) /* Omit Even pages */
#define APISPQ_REVOE (1 << 6) /* Reverse odd/even */
#define APISPQ_MATTN (1 << 7) /* Mail attention message */
#define APISPQ_WATTN (1 << 8) /* Write attention message */
#define APISPQ_LOCALONLY (1 << 9) /* Local only */
#define APISPQ_CLIENTJOB (1 << 10) /* Job arrived from client */
#define APISPQ_ROAMUSER (1 << 11) /* Roaming user */
unsigned char apispq_sflags; /* Flags set by scheduler */
#define APISPQ_ASSIGN (1 << 0) /* Assigned to printer */
#define APISPQ_WARNED (1 << 1) /* Warned about top of queue */
#define APISPQ_PROPOSED (1 << 2) /* Proposed non-local print */
#define APISPQ_ABORTJ (1 << 3) /* Set for job abort */
unsigned char apispq_dflags; /* Flags set by spd */
#define APISPQ_PQ (1 << 0) /* Being printed */
#define APISPQ_PRINTED (1 << 1) /* Printed it at least once */
#define APISPQ_STARTED (1 << 2) /* Job has been started sometime */
#define APISPQ_PAGEFILE (1 << 3) /* Has a page delimiter file */
#define APISPQ_ERRLIMIT (1 << 4) /* Error if exceeds upper bound */
#define APISPQ_PGLIMIT (1 << 5) /* Limit is by pages */
USHORT apispq_extrn; /* External job index 0=Xi-Text */
USHORT apispq_pglim; /* K byte limit or number of pages (enqueue only) */
classcode_t apispq_class; /* Class code */
slotno_t apispq_pslot; /* Printer slot if printing or -1
also -1 if printing by unknown remote */
ULONG apispq_start,
apispq_end, /* Record to start/finish at */
apispq_haltat; /* Page number we were halted at */
int_ugid_t apispq_uid; /* Originating user (binary) */
char apispq_uname[UIDSIZE+1]; /* Originating user */
char apispq_puname[UIDSIZE+1]; /* User to post output to */
char apispq_file[MAXTITLE+1]; /* File name */
char apispq_form[MAXFORM+1]; /* Paper type */
char apispq_ptr[JPTRNAMESIZE+1]; /* Printer type */
char apispq_flags[MAXFLAGS+1]; /* Flags to use for filter */
};
struct apispptr { /* Details of printer */
netid_t apispp_netid; /* Network id 0 local */
slotno_t apispp_rslot; /* Slot number on remote machine */
int_pid_t apispp_pid; /* Process id of spd process if applicable */
jobno_t apispp_job; /* Current job */
netid_t apispp_rjhostid; /* Machine owning job being printed or 0 */
slotno_t apispp_rjslot; /* Slot on remote of job being printed or same as apispp_jslot */
slotno_t apispp_jslot; /* Slot in Jlist on this machine or -1 */
char apispp_state; /* Process state */
unsigned char apispp_sflags; /* Scheduler flags */
#define APISPP_SELECT (1 << 0) /* Selected for printing */
#define APISPP_INTER (1 << 1) /* Set for job interrupt */
#define APISPP_HEOJ (1 << 2) /* Set for halt end of job */
#define APISPP_PROPOSED (1 << 3) /* Proposed */
unsigned char apispp_dflags; /* Flags set by spd */
#define APISPP_HADAB (1 << 0) /* Had abort message */
#define APISPP_REQALIGN (1 << 1) /* Requires alignment */
unsigned char apispp_netflags; /* Network printer flags */
#define APISPP_LOCALNET (1 << 0) /* Access by network= stuff */
#define APISPP_LOCALONLY (1 << 1) /* local printer only */
classcode_t apispp_class; /* Class */
ULONG apispp_minsize; /* Minimum size we'll accept */
ULONG apispp_maxsize; /* Maximum size we'll accept */
USHORT apispp_extrn; /* External printer index 0=Xi-Text */
USHORT apispp_resvd; /* Reserved pad to 4 bytes */
char apispp_dev[LINESIZE+1]; /* Device */
char apispp_form[MAXFORM+1]; /* Paper type */
char apispp_ptr[PTRNAMESIZE+1]; /* Printer type */
char apispp_feedback[PFEEDBACK+1]; /* Feedback from terminal server */
char apispp_comment[COMMENTSIZE+1];/* Description of printer */
};
struct apipages {
LONG delimnum; /* Number of delimiters */
LONG deliml; /* Length of delimiters */
LONG lastpage; /* Delimiters remaining on last page */
};
#define PV_ADMIN_BIT 0 /* Administrator */
#define PV_SSTOP_BIT 1 /* Can run sstop */
#define PV_FORMS_BIT 2 /* Can use other forms */
#define PV_CPRIO_BIT 3 /* Can change priority on spq */
#define PV_OTHERJ_BIT 4 /* Can change other users' jobs */
#define PV_PRINQ_BIT 5 /* Can move to printer queue */
#define PV_HALTGO_BIT 6 /* Can halt, restart printer */
#define PV_ANYPRIO_BIT 7 /* Can set any priority on spq */
#define PV_CDEFLT_BIT 8 /* Can change own default prio */
#define PV_ADDDEL_BIT 9 /* Can add/delete printers */
#define PV_COVER_BIT 10 /* Can override class */
#define PV_UNQUEUE_BIT 11 /* Can undump queue */
#define PV_VOTHERJ_BIT 12 /* Can view other jobs not necc edit */
#define PV_REMOTEJ_BIT 13 /* Can access remote jobs */
#define PV_REMOTEP_BIT 14 /* Can access remote printers */
#define PV_FREEZEOK_BIT 15 /* Can freeze parameters */
#define PV_ACCESSOK_BIT 16 /* Can access other options */
#define PV_OTHERP_BIT 17 /* Can use other printers */
#define PV_ADMIN (1 << PV_ADMIN_BIT) /* Administrator */
#define PV_SSTOP (1 << PV_SSTOP_BIT) /* Can run sstop */
#define PV_FORMS (1 << PV_FORMS_BIT) /* Can use other forms */
#define PV_CPRIO (1 << PV_CPRIO_BIT) /* Can change priority on spq */
#define PV_OTHERJ (1 << PV_OTHERJ_BIT) /* Can change other users' jobs */
#define PV_PRINQ (1 << PV_PRINQ_BIT) /* Can move to printer queue */
#define PV_HALTGO (1 << PV_HALTGO_BIT) /* Can halt, restart printer */
#define PV_ANYPRIO (1 << PV_ANYPRIO_BIT) /* Can set any priority on spq */
#define PV_CDEFLT (1 << PV_CDEFLT_BIT) /* Can change own default prio */
#define PV_ADDDEL (1 << PV_ADDDEL_BIT) /* Can add/delete printers */
#define PV_COVER (1 << PV_COVER_BIT) /* Can override class */
#define PV_UNQUEUE (1 << PV_UNQUEUE_BIT) /* Can undump queue */
#define PV_VOTHERJ (1 << PV_VOTHERJ_BIT) /* Can view other jobs not necc edit */
#define PV_REMOTEJ (1 << PV_REMOTEJ_BIT) /* Can access remote jobs */
#define PV_REMOTEP (1 << PV_REMOTEP_BIT) /* Can access remote printers */
#define PV_FREEZEOK (1 << PV_FREEZEOK_BIT) /* Can freeze parameters */
#define PV_ACCESSOK (1 << PV_ACCESSOK_BIT) /* Can access other options */
#define PV_OTHERP (1 << PV_OTHERP_BIT) /* Can use other printers */
#define ALLPRIVS 0x3ffff /* All of the above */
#ifdef unix
/* DOS C++ Version we aren't interested in header file stuff. */
struct apisphdr {
unsigned char sph_version; /* Major GNUspool version number */
char sph_form[MAXFORM+1]; /* Form type (35 bytes) */
time_t sph_lastp; /* Last read password file */
unsigned char sph_minp, /* Minimum pri */
sph_maxp, /* Maximum pri */
sph_defp, /* Default pri */
sph_cps; /* Copies */
ULONG sph_flgs; /* Privileges */
classcode_t sph_class; /* Class code */
char sph_formallow[ALLOWFORMSIZE+1]; /* Allowed form types (pattern) */
char sph_ptr[PTRNAMESIZE+1]; /* Default printer */
char sph_ptrallow[JPTRNAMESIZE+1]; /* Allow printer types (pattern) */
};
#endif
struct apispdet {
unsigned char spu_isvalid; /* Valid user id = 1, valid */
#define SPU_INVALID 0
#define SPU_VALID 1
char spu_form[MAXFORM+1]; /* Default form (35 bytes) */
int_ugid_t spu_user; /* User id */
unsigned char spu_minp, /* Minimum priority */
spu_maxp, /* Maximum priority */
spu_defp, /* Default priority */
spu_cps; /* Copies */
ULONG spu_flgs; /* Privileges */
classcode_t spu_class; /* Class of printers */
char spu_formallow[ALLOWFORMSIZE+1]; /* Allowed form types (pattern) */
char spu_ptr[PTRNAMESIZE+1]; /* Default printer */
char spu_ptrallow[JPTRNAMESIZE+1]; /* Allow printer types (pattern) */
#ifdef __cplusplus
classcode_t resultclass(const classcode_t rclass) const
{
return (spu_flgs & PV_COVER) ? rclass: rclass & spu_class;
}
int ispriv(const ULONG flag) const
{
return flag & spu_flgs? 1: 0;
}
#endif
};
/* Charge record generated by scheduler */
struct spcharge {
time_t spch_when; /* When it happened */
netid_t spch_host; /* Host responsible */
int_ugid_t spch_user; /* Uid charged for */
USHORT spch_pri; /* Priority */
USHORT spch_what; /* Type of charge */
#define SPCH_RECORD 0 /* Record left by spshed */
#define SPCH_FEE 1 /* Impose fee */
#define SPCH_FEEALL 2 /* Impose fee everywhere */
#define SPCH_CONSOL 3 /* Consolidation of previous charges */
#define SPCH_ZERO 4 /* Zero record for given user */
#define SPCH_ZEROALL 5 /* Zero record for all users */
LONG spch_chars; /* Chars printed */
LONG spch_cpc; /* Charge per character or charge (FEE/CONSOL) */
};
/* Printer state codes */
#define API_PRNULL 0 /* Null entry */
#define API_PROFFLINE 1 /* Device is offline */
#define API_PRERROR 2 /* Some error */
#define API_PRHALT 3 /* Halted */
#define API_PRINIT 4 /* Initialising */
#define API_PRWAIT 5 /* Idle */
#define API_PRSHUTD 6 /* Shutdown */
#define API_PRRUN 7 /* Printing something */
#define API_PROPER 8 /* Awaiting operator */
#define API_PRPROC API_PRINIT /* Process allocated from this state up */
#define API_PRPREST API_PRRUN /* Print details of job etc */
#define API_PRNSTATES 9
/* Printer op codes */
#define PRINOP_RSP 26 /* restart printer */
#define PRINOP_PHLT 27 /* halt printer at eoj */
#define PRINOP_PSTP 28 /* halt printer at once */
#define PRINOP_PGO 29 /* start printer */
#define PRINOP_OYES 32 /* spq->spshed operator continue */
#define PRINOP_ONO 33 /* spq->spshed operator retry */
#define PRINOP_INTER 34 /* interrupt printer */
#define PRINOP_PJAB 35 /* abort job on printer */
/* Error codes */
#define GSPOOL_OK (0)
#define GSPOOL_INVALID_FD (-1)
#define GSPOOL_NOMEM (-2)
#define GSPOOL_INVALID_HOSTNAME (-3)
#define GSPOOL_INVALID_SERVICE (-4)
#define GSPOOL_NODEFAULT_SERVICE (-5)
#define GSPOOL_NOSOCKET (-6)
#define GSPOOL_NOBIND (-7)
#define GSPOOL_NOCONNECT (-8)
#define GSPOOL_BADREAD (-9)
#define GSPOOL_BADWRITE (-10)
#define GSPOOL_CHILDPROC (-11)
/* These errors should correspond to client_if.h sort of */
#define GSPOOL_CONVERT_XTNR(code) (-20-(code))
#define GSPOOL_UNKNOWN_USER (-23)
#define GSPOOL_ZERO_CLASS (-24)
#define GSPOOL_BAD_PRIORITY (-25)
#define GSPOOL_BAD_COPIES (-26)
#define GSPOOL_BAD_FORM (-27)
#define GSPOOL_NOMEM_QF (-28)
#define GSPOOL_BAD_PF (-29)
#define GSPOOL_NOMEM_PF (-30)
#define GSPOOL_CC_PAGEFILE (-31)
#define GSPOOL_FILE_FULL (-32)
#define GSPOOL_QFULL (-33)
#define GSPOOL_EMPTYFILE (-34)
#define GSPOOL_BAD_PTR (-35)
#define GSPOOL_WARN_LIMIT (-36)
#define GSPOOL_PAST_LIMIT (-37)
#define GSPOOL_NO_PASSWD (-38)
#define GSPOOL_PASSWD_INVALID (-39)
#define GSPOOL_UNKNOWN_COMMAND (-40)
#define GSPOOL_SEQUENCE (-41)
#define GSPOOL_UNKNOWN_JOB (-42)
#define GSPOOL_UNKNOWN_PTR (-43)
#define GSPOOL_NOPERM (-44)
#define GSPOOL_NOTPRINTED (-45)
#define GSPOOL_PTR_NOTRUNNING (-46)
#define GSPOOL_PTR_RUNNING (-47)
#define GSPOOL_PTR_NULL (-48)
#define GSPOOL_PTR_CDEV (-49)
#define GSPOOL_INVALIDSLOT (-50)
/* Flags for accessing things */
#define GSPOOL_FLAG_LOCALONLY (1 << 0)
#define GSPOOL_FLAG_USERONLY (1 << 1)
#define GSPOOL_FLAG_IGNORESEQ (1 << 2)
#define GSPOOL_FLAG_FORCE (1 << 3)
/* xtapi.pre -- preamble for API header file
Copyright 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef __cplusplus
extern "C" {
#endif
extern int gspool_open(const char *, const char *, const classcode_t),
gspool_close(const int),
gspool_jobfind(const int, const unsigned, const jobno_t, const netid_t, slotno_t *, struct apispq *),
gspool_jobfindslot(const int, const unsigned, const jobno_t, const netid_t, slotno_t *),
gspool_jobmon(const int, void (*)(const int)),
gspool_joblist(const int, const unsigned, int *, slotno_t **),
gspool_jobread(const int, const unsigned, const slotno_t, struct apispq *),
gspool_jobdel(const int, const unsigned, const slotno_t),
gspool_jobupd(const int, const unsigned, const slotno_t, const struct apispq *),
gspool_jobres(const int, jobno_t *),
gspool_ptrfind(const int, const unsigned, const char *, const netid_t, slotno_t *, struct apispptr *),
gspool_ptrfindslot(const int, const unsigned, const char *, const netid_t, slotno_t *),
gspool_ptrmon(const int, void (*)(const int)),
gspool_ptrlist(const int, const unsigned, int *, slotno_t **),
gspool_ptrread(const int, const unsigned, const slotno_t, struct apispptr *),
gspool_ptradd(const int, const struct apispptr *),
gspool_ptrdel(const int, const unsigned, const slotno_t),
gspool_ptrop(const int, const unsigned, const slotno_t, const unsigned),
gspool_ptrupd(const int, const unsigned, const slotno_t, const struct apispptr *),
gspool_getspd(const int, struct apisphdr *),
gspool_getspu(const int, const char *, struct apispdet *),
gspool_putspd(const int, const struct apisphdr *),
gspool_putspu(const int, const char *, const struct apispdet *);
extern FILE *gspool_jobadd(const int, struct apispq *, const char *, const unsigned, const unsigned),
*gspool_jobdata(const int, const unsigned, const slotno_t),
*gspool_jobpbrk(const int, const unsigned, const slotno_t);
#ifdef __cplusplus
}
#endif
extern int gspool_dataerror;
#endif /*_XTAPI_H*/
|