summaryrefslogtreecommitdiff
path: root/support/dktools/plpdftex.h
blob: f40864297de5fb51b6c1172e2866ccb31f47b59f (plain)
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
/*
	WARNING: This file was generated by dkct.
	Changes you make here will be lost if dkct is run again!
	You should modify the original source and run dkct on it.
	Original source: plpdftex.ctr
*/

/*
Copyright (C) 2014-2017, Dirk Krause

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
  this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above opyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.
* Neither the name of the author nor the names of contributors may be used
  to endorse or promote products derived from this software without specific
  prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/**	@file plpdftex.h Header file for the plpdftex module.
*/

#ifndef PLPDFTEX_H_INCLUDED
/** Avoid multiple inclusions. */
#define PLPDFTEX_H_INCLUDED 1


#line 8 "plpdftex.ctr"

#include "dk3all.h"



/**	Current state of the program.
*/
enum {

  /**	No output produced yet.
  */
  PLPT_STATE_NO_OUTPUT_YET		=	0,

  /**	Document class line written.
  */
  PLPT_STATE_DOCUMENT_CLASS,

  /**	Lines of user-specified font setup written.
  */
  PLPT_STATE_USER_FONT_SETUP,

  /**	Lines of user-specified usepackage instructions written.
  */
  PLPT_STATE_USER_PACKAGES,

  /**	User-specified setup lines were written.
  */
  PLPT_STATE_USER_SETUP,

  /**	The begin document line was written, contents may be added.
  */
  PLPT_STATE_IN_DOCUMENT,

  /**	Finished, the end document line was written.
  */
  PLPT_STATE_AFTER_DOCUMENT

};



/**	Job structure for the plpdftex program.
*/
typedef struct {
  dk3_app_t		*app;	/**< Application structure. */
  dkChar const * const	*msg;	/**< Localized messages texts. */
  dkChar const * const	*kwnl;	/**< Keywords not localized. */
  dkChar const * const	*argv;	/**< Command line arguments array. */
  dkChar const		*infn;	/**< Input file name. */
  dk3_sto_t		*sco;	/**< Storage for colors. */
  dk3_sto_it_t		*sico;	/**< Storage iterator for colors. */
  char			*fnb1;	/**< File name as read from input. */
  char			*fnpdf;	/**< File name, PDF output file. */
  char			*fntex;	/**< File name, TeX output file. */
  char			*ilbuf;	/**< Input line buffer. */
  dk3_option_set_t	*opt;	/**< Options. */
  dk3_pdf_t		*opdf;	/**< PDF output structure. */
  FILE			*infi;	/**< Input file. */
  FILE			*fopdf;	/**< PDF output file. */
  FILE			*fotex;	/**< TeX output file. */
  long			 imgw;	/**< Image width. */
  long			 imgh;	/**< Image height. */
  size_t		 szfn;	/**< File name buffer size. */
  size_t		 szilb;	/**< Size of input line buffer. */
  int			 state;	/**< Current program state. */
  int			 exc;	/**< Exit code. */
  int			 argc;	/**< Number of command line arguments. */
  int			 stagr;	/**< Flag: Produce standalone graphics. */
} plpdftex_job_t;



/**	Named color.
*/
typedef struct {
  char const		*name;	/**< Color name. */
  double		r;	/**< Red. */
  double		g;	/**< Green. */
  double		b;	/**< Blue. */
} plpt_named_color_t;


#include "plptcol.h"




#endif