home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / printing / ghostscrip / source / _gs / h / gp < prev    next >
Encoding:
Text File  |  1991-10-25  |  3.9 KB  |  96 lines

  1. /* Copyright (C) 1991 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* gp.h */
  21. /* Interface to platform-specific routines for Ghostscript */
  22.  
  23. /*
  24.  * This file defines ***ALL*** the routines that are Ghostscript- and
  25.  * platform-specific.  The routines are implemented in a gp_*.c file
  26.  * specific to each platform.  We try very hard to keep this list
  27.  * as short as possible!
  28.  */
  29.  
  30. /* ------ Initialization ------ */
  31.  
  32. /* This routine is called early in the Ghostscript initialization. */
  33. /* It should do as little as possible.  In particular, it should not */
  34. /* do things like open display connections: that is the responsibility */
  35. /* of the display device driver. */
  36. extern void gp_init(P0());
  37.  
  38. /* ------ Date and time ------ */
  39.  
  40. /* Read the current date (in days since Jan. 1, 1980) into pdt[0], */
  41. /* and time (in milliseconds since midnight) into pdt[1]. */
  42. extern void gp_get_clock(P1(long *pdt));
  43.  
  44. /* ------ File names ------ */
  45.  
  46. /* Define the character used for separating file names in a list. */
  47. extern char gp_file_name_list_separator;
  48.  
  49. /* Define the default scratch file name template. */
  50. extern char gp_scratch_file_name_template[];
  51.  
  52. /* Answer whether a file name contains a directory/device specification, */
  53. /* i.e. is absolute (not directory- or device-relative). */
  54. extern int gp_file_name_is_absolute(P2(char *fname, uint len));
  55.  
  56. /* Answer the string to be used for combining a directory/device prefix */
  57. /* with a base file name.  The file name is known to not be absolute. */
  58. extern char *gp_file_name_concat_string(P4(char *prefix, uint plen,
  59.                        char *fname, uint len));
  60.  
  61. /* ------ File enumeration ------ */
  62.  
  63. struct file_enum_s;    /* opaque to client, defined by implementor */
  64. typedef struct file_enum_s file_enum;
  65.  
  66. /*
  67.  * Begin an enumeration.  pat is a C string that may contain *s or ?s.
  68.  * The implementor should copy the string to a safe place.
  69.  * If the operating system doesn't support correct, arbitrarily placed
  70.  * *s and ?s, the implementation should modify the string so that it
  71.  * will return a conservative superset of the request.  E.g., if the OS
  72.  * doesn't implement ? (single-character wild card), any consecutive
  73.  * string of ?s should be interpreted as *.  Note that \ can appear in
  74.  * the pattern also, as a quoting character.
  75.  */
  76. extern file_enum *gp_enumerate_files_init(P4(char *pat, uint patlen,
  77.                          proc_alloc_t palloc,
  78.                          proc_free_t pfree));
  79.  
  80. /*
  81.  * Return the next file name in the enumeration.  The client passes in
  82.  * a scratch string and a max length.  If the name of the next file fits,
  83.  * the procedure returns the length.  If it doesn't fit, the procedure
  84.  * returns max length +1.  If there are no more files, the procedure
  85.  * returns -1.
  86.  */
  87. extern uint gp_enumerate_files_next(P3(file_enum *pfen, char *ptr, uint maxlen));
  88.  
  89. /*
  90.  * Clean up a file enumeration.  This is only called to abandon
  91.  * an enumeration partway through: ...next should do it if there are
  92.  * no more files to enumerate.  This should deallocate the file_enum
  93.  * structure and any subsidiary structures, strings, buffers, etc.
  94.  */
  95. extern void gp_enumerate_files_close(P1(file_enum *pfen));
  96.