home *** CD-ROM | disk | FTP | other *** search
/ swCHIP 1991 January / swCHIP_95-1.bin / utility / gsview13 / epstool / epstool.h < prev    next >
C/C++ Source or Header  |  1995-12-09  |  4KB  |  145 lines

  1. /* Copyright (C) 1993, 1994, Russell Lang.  All rights reserved.
  2.   
  3.   This file is part of GSview.
  4.   
  5.   This program is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the GSview Free Public Licence 
  9.   (the "Licence") for full details.
  10.   
  11.   Every copy of GSview must include a copy of the Licence, normally in a 
  12.   plain ASCII text file named LICENCE.  The Licence grants you the right 
  13.   to copy, modify and redistribute GSview, but only under certain conditions 
  14.   described in the Licence.  Among other things, the Licence requires that 
  15.   the copyright notice and this notice be preserved on all copies.
  16. */
  17.  
  18. /* epstool.h */
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <string.h>
  22. #include <ctype.h>
  23. #include <time.h>
  24.  
  25. #ifdef __EMX__
  26. #define GSCOMMAND "gsos2"
  27. #define BYTE unsigned char    /* 8 bits unsigned */
  28. #define WORD  unsigned short    /* 16 bits unsigned */
  29. #define DWORD unsigned int    /* 32 bits unsigned */
  30. #define UINT  unsigned int    /* native unsigned */
  31. #define LONG  int        /* 32 bits signed */
  32. #define BOOL  int
  33. #define GVFAR 
  34. #define GVHUGE 
  35. #define READBIN  "rb"
  36. #define WRITEBIN "wb"
  37. #define MAXSTR 256
  38. #define DIRSEP '\\'
  39. #define EOLSTR "\r\n"
  40. #endif
  41.  
  42. #ifdef MSDOS
  43. #define GSCOMMAND "gsos2"
  44. #define BYTE unsigned char
  45. #define WORD  unsigned short
  46. #define DWORD unsigned long
  47. #define UINT  unsigned int
  48. #define LONG  long
  49. #define BOOL  int
  50. #define GVFAR far
  51. #define GVHUGE huge
  52. #define READBIN  "rb"
  53. #define WRITEBIN "wb"
  54. #define MAXSTR 126
  55. #define DIRSEP '\\'
  56. #define EOLSTR "\r\n"
  57. #include <alloc.h>
  58. #include <dir.h>
  59. #endif
  60.  
  61. #ifdef UNIX
  62. #define GSCOMMAND "gs"
  63. #define BYTE unsigned char
  64. #define WORD  unsigned short
  65. #define DWORD unsigned int
  66. #define UINT  unsigned int
  67. #define LONG  int
  68. #define BOOL  int
  69. #define GVFAR 
  70. #define GVHUGE
  71. #define READBIN  "r"
  72. #define WRITEBIN "w"
  73. #define MAXSTR 256
  74. #define DIRSEP '/'
  75. #define EOLSTR "\n"
  76. char *getcwd(char *, int);
  77. #define stricmp(s1, s2) strcasecmp(s1, s2)
  78. #ifndef SEEK_SET
  79. #define SEEK_SET 0
  80. #define SEEK_END 2
  81. #endif
  82. #endif
  83.  
  84. #include "ps.h"
  85. #include "gvceps.h"
  86.  
  87. #define TRUE 1
  88. #define FALSE 0
  89.  
  90. #ifndef min
  91. #define min(x,y)  ( (x) < (y) ? (x) : (y) )
  92. #endif
  93. #ifndef max
  94. #define max(x,y)  ( (x) > (y) ? (x) : (y) )
  95. #endif
  96.  
  97. extern char oname[MAXSTR];
  98. extern char szScratch[];
  99. extern char szAppName[];
  100.  
  101. typedef struct tagPSBBOX {
  102.     int    llx;
  103.     int    lly;
  104.     int    urx;
  105.     int    ury;
  106.     int    valid;
  107. } PSBBOX;
  108.  
  109. typedef struct document PSDOC;
  110.  
  111. typedef struct tagPSFILE {
  112.     BOOL    ignore_dsc;    /* true if DSC to be ignored */
  113.     PSDOC    *doc;        /* DSC structure.  NULL if not DSC */
  114.     int     pagenum;    /* current page number */
  115.     char     name[MAXSTR];    /* name of selected document file */
  116.     FILE     *file;        /* selected file */
  117.     int     preview;    /* preview type IDS_EPSF, IDS_EPSI, etc. */
  118. } PSFILE;
  119.  
  120. typedef struct tagOPTION {
  121.     float    xdpi;
  122.     float    ydpi;
  123. } OPTION;
  124.  
  125. FILE * gp_open_scratch_file(const char *prefix, char *fname, const char *mode);
  126. void gserror(UINT id, char *str, UINT icon, int sound);
  127. char * _getcwd(char *dirname, int size);
  128. void play_sound(int i);
  129.  
  130. /* temporary kludges */
  131. extern PSDOC *doc;
  132. extern PSFILE psfile;
  133. extern OPTION option;
  134. #define MB_ICONEXCLAMATION 1
  135. #define SOUND_ERROR 1
  136. #define IDM_EXTRACTPS  1
  137. #define IDM_EXTRACTPRE 2
  138. #define IDM_MAKEEPST   3
  139. #define IDM_MAKEEPST4  4
  140. #define IDS_TOPICEDIT 1
  141. #define COPY_BUF_SIZE 4096
  142.  
  143. /* error messages */
  144. #define IDS_NOPREVIEW 1
  145.