Commit 27ee889c0e74e84035c2c208c856729a16d866c7

Authored by Jay Berkenbilt
1 parent 95753c6b

tweak dll stuff again

git-svn-id: svn+q:///qpdf/trunk@851 71b93d88-0707-0410-a8cf-f5a4172ac649
include/qpdf/Buffer.hh
... ... @@ -13,21 +13,21 @@
13 13 class Buffer
14 14 {
15 15 public:
16   - DLL_EXPORT
  16 + QPDF_DLL
17 17 Buffer();
18   - DLL_EXPORT
  18 + QPDF_DLL
19 19 Buffer(unsigned long size);
20   - DLL_EXPORT
  20 + QPDF_DLL
21 21 Buffer(Buffer const&);
22   - DLL_EXPORT
  22 + QPDF_DLL
23 23 Buffer& operator=(Buffer const&);
24   - DLL_EXPORT
  24 + QPDF_DLL
25 25 ~Buffer();
26   - DLL_EXPORT
  26 + QPDF_DLL
27 27 unsigned long getSize() const;
28   - DLL_EXPORT
  28 + QPDF_DLL
29 29 unsigned char const* getBuffer() const;
30   - DLL_EXPORT
  30 + QPDF_DLL
31 31 unsigned char* getBuffer();
32 32  
33 33 private:
... ...
include/qpdf/DLL.h
1 1 #ifndef __QPDF_DLL_HH__
2 2 #define __QPDF_DLL_HH__
3 3  
4   -#ifdef _WIN32
5   -# define DLL_EXPORT __declspec(dllexport)
  4 +#if defined(_WIN32) && defined(DLL_EXPORT)
  5 +# define QPDF_DLL __declspec(dllexport)
6 6 #else
7   -# define DLL_EXPORT
  7 +# define QPDF_DLL
8 8 #endif
9 9  
10 10 #endif /* __QPDF_DLL_HH__ */
... ...
include/qpdf/Pipeline.hh
... ... @@ -36,22 +36,21 @@
36 36 class Pipeline
37 37 {
38 38 public:
39   - DLL_EXPORT
  39 + QPDF_DLL
40 40 Pipeline(char const* identifier, Pipeline* next);
41 41  
42   - DLL_EXPORT
  42 + QPDF_DLL
43 43 virtual ~Pipeline();
44 44  
45 45 // Subclasses should implement write and finish to do their jobs
46 46 // and then, if they are not end-of-line pipelines, call
47 47 // getNext()->write or getNext()->finish.
48   - DLL_EXPORT
  48 + QPDF_DLL
49 49 virtual void write(unsigned char* data, int len) = 0;
50   - DLL_EXPORT
  50 + QPDF_DLL
51 51 virtual void finish() = 0;
52 52  
53 53 protected:
54   - DLL_EXPORT
55 54 Pipeline* getNext(bool allow_null = false);
56 55 std::string identifier;
57 56  
... ...
include/qpdf/Pl_Buffer.hh
... ... @@ -27,19 +27,19 @@
27 27 class Pl_Buffer: public Pipeline
28 28 {
29 29 public:
30   - DLL_EXPORT
  30 + QPDF_DLL
31 31 Pl_Buffer(char const* identifier, Pipeline* next = 0);
32   - DLL_EXPORT
  32 + QPDF_DLL
33 33 virtual ~Pl_Buffer();
34   - DLL_EXPORT
  34 + QPDF_DLL
35 35 virtual void write(unsigned char*, int);
36   - DLL_EXPORT
  36 + QPDF_DLL
37 37 virtual void finish();
38 38  
39 39 // Each call to getBuffer() resets this object -- see notes above.
40 40 // The caller is responsible for deleting the returned Buffer
41 41 // object.
42   - DLL_EXPORT
  42 + QPDF_DLL
43 43 Buffer* getBuffer();
44 44  
45 45 private:
... ...
include/qpdf/Pl_Count.hh
... ... @@ -16,20 +16,20 @@
16 16 class Pl_Count: public Pipeline
17 17 {
18 18 public:
19   - DLL_EXPORT
  19 + QPDF_DLL
20 20 Pl_Count(char const* identifier, Pipeline* next);
21   - DLL_EXPORT
  21 + QPDF_DLL
22 22 virtual ~Pl_Count();
23   - DLL_EXPORT
  23 + QPDF_DLL
24 24 virtual void write(unsigned char*, int);
25   - DLL_EXPORT
  25 + QPDF_DLL
26 26 virtual void finish();
27 27 // Returns the number of bytes written
28   - DLL_EXPORT
  28 + QPDF_DLL
29 29 int getCount() const;
30 30 // Returns the last character written, or '\0' if no characters
31 31 // have been written (in which case getCount() returns 0)
32   - DLL_EXPORT
  32 + QPDF_DLL
33 33 unsigned char getLastChar() const;
34 34  
35 35 private:
... ...
include/qpdf/Pl_Discard.hh
... ... @@ -19,13 +19,13 @@
19 19 class Pl_Discard: public Pipeline
20 20 {
21 21 public:
22   - DLL_EXPORT
  22 + QPDF_DLL
23 23 Pl_Discard();
24   - DLL_EXPORT
  24 + QPDF_DLL
25 25 virtual ~Pl_Discard();
26   - DLL_EXPORT
  26 + QPDF_DLL
27 27 virtual void write(unsigned char*, int);
28   - DLL_EXPORT
  28 + QPDF_DLL
29 29 virtual void finish();
30 30 };
31 31  
... ...
include/qpdf/Pl_Flate.hh
... ... @@ -19,15 +19,15 @@ class Pl_Flate: public Pipeline
19 19  
20 20 enum action_e { a_inflate, a_deflate };
21 21  
22   - DLL_EXPORT
  22 + QPDF_DLL
23 23 Pl_Flate(char const* identifier, Pipeline* next,
24 24 action_e action, int out_bufsize = def_bufsize);
25   - DLL_EXPORT
  25 + QPDF_DLL
26 26 virtual ~Pl_Flate();
27 27  
28   - DLL_EXPORT
  28 + QPDF_DLL
29 29 virtual void write(unsigned char* data, int len);
30   - DLL_EXPORT
  30 + QPDF_DLL
31 31 virtual void finish();
32 32  
33 33 private:
... ...
include/qpdf/Pl_StdioFile.hh
... ... @@ -23,14 +23,14 @@ class Pl_StdioFile: public Pipeline
23 23 public:
24 24 // f is externally maintained; this class just writes to and
25 25 // flushes it. It does not close it.
26   - DLL_EXPORT
  26 + QPDF_DLL
27 27 Pl_StdioFile(char const* identifier, FILE* f);
28   - DLL_EXPORT
  28 + QPDF_DLL
29 29 virtual ~Pl_StdioFile();
30 30  
31   - DLL_EXPORT
  31 + QPDF_DLL
32 32 virtual void write(unsigned char* buf, int len);
33   - DLL_EXPORT
  33 + QPDF_DLL
34 34 virtual void finish();
35 35  
36 36 private:
... ...
include/qpdf/QPDF.hh
... ... @@ -28,9 +28,9 @@ class QPDFExc;
28 28 class QPDF
29 29 {
30 30 public:
31   - DLL_EXPORT
  31 + QPDF_DLL
32 32 QPDF();
33   - DLL_EXPORT
  33 + QPDF_DLL
34 34 ~QPDF();
35 35  
36 36 // Associate a file with a QPDF object and do initial parsing of
... ... @@ -43,7 +43,7 @@ class QPDF
43 43 // encrypted,either a null password or an empty password can be
44 44 // used. If the file is encrypted, either the user password or
45 45 // the owner password may be supplied.
46   - DLL_EXPORT
  46 + QPDF_DLL
47 47 void processFile(char const* filename, char const* password = 0);
48 48  
49 49 // Parameter settings
... ... @@ -52,21 +52,21 @@ class QPDF
52 52 // (one that contains both cross-reference streams and
53 53 // cross-reference tables). This can be useful for testing to
54 54 // ensure that a hybrid file would work with an older reader.
55   - DLL_EXPORT
  55 + QPDF_DLL
56 56 void setIgnoreXRefStreams(bool);
57 57  
58 58 // By default, any warnings are issued to stderr as they are
59 59 // encountered. If this is called with a true value, reporting of
60 60 // warnings is suppressed. You may still retrieve warnings by
61 61 // calling getWarnings.
62   - DLL_EXPORT
  62 + QPDF_DLL
63 63 void setSuppressWarnings(bool);
64 64  
65 65 // By default, QPDF will try to recover if it finds certain types
66 66 // of errors in PDF files. If turned off, it will throw an
67 67 // exception on the first such problem it finds without attempting
68 68 // recovery.
69   - DLL_EXPORT
  69 + QPDF_DLL
70 70 void setAttemptRecovery(bool);
71 71  
72 72 // Other public methods
... ... @@ -76,26 +76,26 @@ class QPDF
76 76 // throws an exception. Note that if setSuppressWarnings was not
77 77 // called or was called with a false value, any warnings retrieved
78 78 // here will have already been issued to stderr.
79   - DLL_EXPORT
  79 + QPDF_DLL
80 80 std::vector<QPDFExc> getWarnings();
81 81  
82   - DLL_EXPORT
  82 + QPDF_DLL
83 83 std::string getFilename() const;
84   - DLL_EXPORT
  84 + QPDF_DLL
85 85 std::string getPDFVersion() const;
86   - DLL_EXPORT
  86 + QPDF_DLL
87 87 QPDFObjectHandle getTrailer();
88   - DLL_EXPORT
  88 + QPDF_DLL
89 89 QPDFObjectHandle getRoot();
90 90  
91 91 // Install this object handle as an indirect object and return an
92 92 // indirect reference to it.
93   - DLL_EXPORT
  93 + QPDF_DLL
94 94 QPDFObjectHandle makeIndirectObject(QPDFObjectHandle);
95 95  
96 96 // Retrieve an object by object ID and generation. Returns an
97 97 // indirect reference to it.
98   - DLL_EXPORT
  98 + QPDF_DLL
99 99 QPDFObjectHandle getObjectByID(int objid, int generation);
100 100  
101 101 // Encryption support
... ... @@ -128,46 +128,46 @@ class QPDF
128 128 bool encrypt_metadata;
129 129 };
130 130  
131   - DLL_EXPORT
  131 + QPDF_DLL
132 132 bool isEncrypted() const;
133 133  
134   - DLL_EXPORT
  134 + QPDF_DLL
135 135 bool isEncrypted(int& R, int& P);
136 136  
137 137 // Encryption permissions -- not enforced by QPDF
138   - DLL_EXPORT
  138 + QPDF_DLL
139 139 bool allowAccessibility();
140   - DLL_EXPORT
  140 + QPDF_DLL
141 141 bool allowExtractAll();
142   - DLL_EXPORT
  142 + QPDF_DLL
143 143 bool allowPrintLowRes();
144   - DLL_EXPORT
  144 + QPDF_DLL
145 145 bool allowPrintHighRes();
146   - DLL_EXPORT
  146 + QPDF_DLL
147 147 bool allowModifyAssembly();
148   - DLL_EXPORT
  148 + QPDF_DLL
149 149 bool allowModifyForm();
150   - DLL_EXPORT
  150 + QPDF_DLL
151 151 bool allowModifyAnnotation();
152   - DLL_EXPORT
  152 + QPDF_DLL
153 153 bool allowModifyOther();
154   - DLL_EXPORT
  154 + QPDF_DLL
155 155 bool allowModifyAll();
156 156  
157 157 // Helper function to trim padding from user password. Calling
158 158 // trim_user_password on the result of getPaddedUserPassword gives
159 159 // getTrimmedUserPassword's result.
160   - DLL_EXPORT
  160 + QPDF_DLL
161 161 static void trim_user_password(std::string& user_password);
162   - DLL_EXPORT
  162 + QPDF_DLL
163 163 static std::string compute_data_key(
164 164 std::string const& encryption_key, int objid, int generation,
165 165 bool use_aes);
166   - DLL_EXPORT
  166 + QPDF_DLL
167 167 static std::string compute_encryption_key(
168 168 std::string const& password, EncryptionData const& data);
169 169  
170   - DLL_EXPORT
  170 + QPDF_DLL
171 171 static void compute_encryption_O_U(
172 172 char const* user_password, char const* owner_password,
173 173 int V, int R, int key_len, int P, bool encrypt_metadata,
... ... @@ -176,23 +176,23 @@ class QPDF
176 176 // Return the full user password as stored in the PDF file. If
177 177 // you are attempting to recover the user password in a
178 178 // user-presentable form, call getTrimmedUserPassword() instead.
179   - DLL_EXPORT
  179 + QPDF_DLL
180 180 std::string const& getPaddedUserPassword() const;
181 181 // Return human-readable form of user password.
182   - DLL_EXPORT
  182 + QPDF_DLL
183 183 std::string getTrimmedUserPassword() const;
184 184  
185 185 // Linearization support
186 186  
187 187 // Returns true iff the file starts with a linearization parameter
188 188 // dictionary. Does no additional validation.
189   - DLL_EXPORT
  189 + QPDF_DLL
190 190 bool isLinearized();
191 191  
192 192 // Performs various sanity checks on a linearized file. Return
193 193 // true if no errors or warnings. Otherwise, return false and
194 194 // output errors and warnings to stdout.
195   - DLL_EXPORT
  195 + QPDF_DLL
196 196 bool checkLinearization();
197 197  
198 198 // Calls checkLinearization() and, if possible, prints normalized
... ... @@ -200,11 +200,11 @@ class QPDF
200 200 // includes adding min values to delta values and adjusting
201 201 // offsets based on the location and size of the primary hint
202 202 // stream.
203   - DLL_EXPORT
  203 + QPDF_DLL
204 204 void showLinearizationData();
205 205  
206 206 // Shows the contents of the cross-reference table
207   - DLL_EXPORT
  207 + QPDF_DLL
208 208 void showXRefTable();
209 209  
210 210 // Optimization support -- see doc/optimization. Implemented in
... ... @@ -218,31 +218,31 @@ class QPDF
218 218 // This is available so that the test suite can make sure that a
219 219 // linearized file is already optimized. When called in this way,
220 220 // optimize() still populates the object <-> user maps
221   - DLL_EXPORT
  221 + QPDF_DLL
222 222 void optimize(std::map<int, int> const& object_stream_data,
223 223 bool allow_changes = true);
224 224  
225 225 // Replace all references to indirect objects that are "scalars"
226 226 // (i.e., things that don't have children: not arrays, streams, or
227 227 // dictionaries) with direct objects.
228   - DLL_EXPORT
  228 + QPDF_DLL
229 229 void flattenScalarReferences();
230 230  
231 231 // Decode all streams, discarding the output. Used to check
232 232 // correctness of stream encoding.
233   - DLL_EXPORT
  233 + QPDF_DLL
234 234 void decodeStreams();
235 235  
236 236 // For QPDFWriter:
237 237  
238 238 // Remove /ID, /Encrypt, and /Prev keys from the trailer
239 239 // dictionary since these are regenerated during write.
240   - DLL_EXPORT
  240 + QPDF_DLL
241 241 void trimTrailerForWrite();
242 242  
243 243 // Get lists of all objects in order according to the part of a
244 244 // linearized file that they belong to.
245   - DLL_EXPORT
  245 + QPDF_DLL
246 246 void getLinearizedParts(
247 247 std::map<int, int> const& object_stream_data,
248 248 std::vector<QPDFObjectHandle>& part4,
... ... @@ -251,7 +251,7 @@ class QPDF
251 251 std::vector<QPDFObjectHandle>& part8,
252 252 std::vector<QPDFObjectHandle>& part9);
253 253  
254   - DLL_EXPORT
  254 + QPDF_DLL
255 255 void generateHintStream(std::map<int, QPDFXRefEntry> const& xref,
256 256 std::map<int, size_t> const& lengths,
257 257 std::map<int, int> const& obj_renumber,
... ... @@ -259,18 +259,18 @@ class QPDF
259 259 int& S, int& O);
260 260  
261 261 // Map object to object stream that contains it
262   - DLL_EXPORT
  262 + QPDF_DLL
263 263 void getObjectStreamData(std::map<int, int>&);
264 264 // Get a list of objects that would be permitted in an object
265 265 // stream
266   - DLL_EXPORT
  266 + QPDF_DLL
267 267 std::vector<int> getCompressibleObjects();
268 268  
269 269 // Convenience routines for common functions. See also
270 270 // QPDFObjectHandle.hh for additional convenience routines.
271 271  
272 272 // Traverse page tree return all /Page objects.
273   - DLL_EXPORT
  273 + QPDF_DLL
274 274 std::vector<QPDFObjectHandle> const& getAllPages();
275 275  
276 276 // Resolver class is restricted to QPDFObjectHandle so that only
... ...
include/qpdf/QPDFExc.hh
... ... @@ -15,13 +15,13 @@
15 15 class QPDFExc: public std::runtime_error
16 16 {
17 17 public:
18   - DLL_EXPORT
  18 + QPDF_DLL
19 19 QPDFExc(qpdf_error_code_e error_code,
20 20 std::string const& filename,
21 21 std::string const& object,
22 22 off_t offset,
23 23 std::string const& message);
24   - DLL_EXPORT
  24 + QPDF_DLL
25 25 virtual ~QPDFExc() throw ();
26 26  
27 27 // To get a complete error string, call what(), provided by
... ... @@ -34,15 +34,15 @@ class QPDFExc: public std::runtime_error
34 34 // the underlying issue, but it is more programmer-friendly than
35 35 // trying to parse a string that is subject to change.
36 36  
37   - DLL_EXPORT
  37 + QPDF_DLL
38 38 qpdf_error_code_e getErrorCode() const;
39   - DLL_EXPORT
  39 + QPDF_DLL
40 40 std::string const& getFilename() const;
41   - DLL_EXPORT
  41 + QPDF_DLL
42 42 std::string const& getObject() const;
43   - DLL_EXPORT
  43 + QPDF_DLL
44 44 off_t getFilePosition() const;
45   - DLL_EXPORT
  45 + QPDF_DLL
46 46 std::string const& getMessageDetail() const;
47 47  
48 48 private:
... ...
include/qpdf/QPDFObjectHandle.hh
... ... @@ -26,58 +26,58 @@ class QPDF;
26 26 class QPDFObjectHandle
27 27 {
28 28 public:
29   - DLL_EXPORT
  29 + QPDF_DLL
30 30 QPDFObjectHandle();
31   - DLL_EXPORT
  31 + QPDF_DLL
32 32 bool isInitialized() const;
33 33  
34 34 // Exactly one of these will return true for any object.
35   - DLL_EXPORT
  35 + QPDF_DLL
36 36 bool isBool();
37   - DLL_EXPORT
  37 + QPDF_DLL
38 38 bool isNull();
39   - DLL_EXPORT
  39 + QPDF_DLL
40 40 bool isInteger();
41   - DLL_EXPORT
  41 + QPDF_DLL
42 42 bool isReal();
43   - DLL_EXPORT
  43 + QPDF_DLL
44 44 bool isName();
45   - DLL_EXPORT
  45 + QPDF_DLL
46 46 bool isString();
47   - DLL_EXPORT
  47 + QPDF_DLL
48 48 bool isArray();
49   - DLL_EXPORT
  49 + QPDF_DLL
50 50 bool isDictionary();
51   - DLL_EXPORT
  51 + QPDF_DLL
52 52 bool isStream();
53 53  
54 54 // This returns true in addition to the query for the specific
55 55 // type for indirect objects.
56   - DLL_EXPORT
  56 + QPDF_DLL
57 57 bool isIndirect();
58 58  
59 59 // True for everything except array, dictionary, and stream
60   - DLL_EXPORT
  60 + QPDF_DLL
61 61 bool isScalar();
62 62  
63 63 // Public factory methods
64 64  
65   - DLL_EXPORT
  65 + QPDF_DLL
66 66 static QPDFObjectHandle newNull();
67   - DLL_EXPORT
  67 + QPDF_DLL
68 68 static QPDFObjectHandle newBool(bool value);
69   - DLL_EXPORT
  69 + QPDF_DLL
70 70 static QPDFObjectHandle newInteger(int value);
71   - DLL_EXPORT
  71 + QPDF_DLL
72 72 static QPDFObjectHandle newReal(std::string const& value);
73   - DLL_EXPORT
  73 + QPDF_DLL
74 74 static QPDFObjectHandle newName(std::string const& name);
75   - DLL_EXPORT
  75 + QPDF_DLL
76 76 static QPDFObjectHandle newString(std::string const& str);
77   - DLL_EXPORT
  77 + QPDF_DLL
78 78 static QPDFObjectHandle newArray(
79 79 std::vector<QPDFObjectHandle> const& items);
80   - DLL_EXPORT
  80 + QPDF_DLL
81 81 static QPDFObjectHandle newDictionary(
82 82 std::map<std::string, QPDFObjectHandle> const& items);
83 83  
... ... @@ -86,78 +86,78 @@ class QPDFObjectHandle
86 86 // type, an exception is thrown.
87 87  
88 88 // Methods for bool objects
89   - DLL_EXPORT
  89 + QPDF_DLL
90 90 bool getBoolValue();
91 91  
92 92 // Methods for integer objects
93   - DLL_EXPORT
  93 + QPDF_DLL
94 94 int getIntValue();
95 95  
96 96 // Methods for real objects
97   - DLL_EXPORT
  97 + QPDF_DLL
98 98 std::string getRealValue();
99 99  
100 100 // Methods that work for both integer and real objects
101   - DLL_EXPORT
  101 + QPDF_DLL
102 102 bool isNumber();
103   - DLL_EXPORT
  103 + QPDF_DLL
104 104 double getNumericValue();
105 105  
106 106 // Methods for name objects; see also name and array objects
107   - DLL_EXPORT
  107 + QPDF_DLL
108 108 std::string getName();
109 109  
110 110 // Methods for string objects
111   - DLL_EXPORT
  111 + QPDF_DLL
112 112 std::string getStringValue();
113   - DLL_EXPORT
  113 + QPDF_DLL
114 114 std::string getUTF8Value();
115 115  
116 116 // Methods for array objects; see also name and array objects
117   - DLL_EXPORT
  117 + QPDF_DLL
118 118 int getArrayNItems();
119   - DLL_EXPORT
  119 + QPDF_DLL
120 120 QPDFObjectHandle getArrayItem(int n);
121 121  
122 122 // Methods for dictionary objects
123   - DLL_EXPORT
  123 + QPDF_DLL
124 124 bool hasKey(std::string const&);
125   - DLL_EXPORT
  125 + QPDF_DLL
126 126 QPDFObjectHandle getKey(std::string const&);
127   - DLL_EXPORT
  127 + QPDF_DLL
128 128 std::set<std::string> getKeys();
129 129  
130 130 // Methods for name and array objects
131   - DLL_EXPORT
  131 + QPDF_DLL
132 132 bool isOrHasName(std::string const&);
133 133  
134 134 // Mutator methods. Use with caution.
135 135  
136 136 // Recursively copy this object, making it direct. Throws an
137 137 // exception if a loop is detected or any sub-object is a stream.
138   - DLL_EXPORT
  138 + QPDF_DLL
139 139 void makeDirect();
140 140  
141 141 // Mutator methods for array objects
142   - DLL_EXPORT
  142 + QPDF_DLL
143 143 void setArrayItem(int, QPDFObjectHandle const&);
144 144  
145 145 // Mutator methods for dictionary objects
146 146  
147 147 // Replace value of key, adding it if it does not exist
148   - DLL_EXPORT
  148 + QPDF_DLL
149 149 void replaceKey(std::string const& key, QPDFObjectHandle const&);
150 150 // Remove key, doing nothing if key does not exist
151   - DLL_EXPORT
  151 + QPDF_DLL
152 152 void removeKey(std::string const& key);
153 153  
154 154 // Methods for stream objects
155   - DLL_EXPORT
  155 + QPDF_DLL
156 156 QPDFObjectHandle getDict();
157 157  
158 158 // Returns filtered (uncompressed) stream data. Throws an
159 159 // exception if the stream is filtered and we can't decode it.
160   - DLL_EXPORT
  160 + QPDF_DLL
161 161 PointerHolder<Buffer> getStreamData();
162 162  
163 163 // Write stream data through the given pipeline. A null pipeline
... ... @@ -177,19 +177,19 @@ class QPDFObjectHandle
177 177 // value of this function to determine whether or not the /Filter
178 178 // and /DecodeParms keys in the stream dictionary should be
179 179 // replaced if writing a new stream object.
180   - DLL_EXPORT
  180 + QPDF_DLL
181 181 bool pipeStreamData(Pipeline*, bool filter,
182 182 bool normalize, bool compress);
183 183  
184 184 // return 0 for direct objects
185   - DLL_EXPORT
  185 + QPDF_DLL
186 186 int getObjectID() const;
187   - DLL_EXPORT
  187 + QPDF_DLL
188 188 int getGeneration() const;
189 189  
190   - DLL_EXPORT
  190 + QPDF_DLL
191 191 std::string unparse();
192   - DLL_EXPORT
  192 + QPDF_DLL
193 193 std::string unparseResolved();
194 194  
195 195 // Convenience routines for commonly performed functions
... ... @@ -199,7 +199,7 @@ class QPDFObjectHandle
199 199 // function does not presently support inherited resources. See
200 200 // comment in the source for details. Return value is a map from
201 201 // XObject name to the image object, which is always a stream.
202   - DLL_EXPORT
  202 + QPDF_DLL
203 203 std::map<std::string, QPDFObjectHandle> getPageImages();
204 204  
205 205 // Throws an exception if this is not a Page object. Returns a
... ... @@ -207,7 +207,7 @@ class QPDFObjectHandle
207 207 // the given page. This routine allows the caller to not care
208 208 // whether there are one or more than one content streams for a
209 209 // page.
210   - DLL_EXPORT
  210 + QPDF_DLL
211 211 std::vector<QPDFObjectHandle> getPageContents();
212 212  
213 213 // Initializers for objects. This Factory class gives the QPDF
... ...
include/qpdf/QPDFTokenizer.hh
... ... @@ -84,7 +84,7 @@ class QPDFTokenizer
84 84 std::string error_message;
85 85 };
86 86  
87   - DLL_EXPORT
  87 + QPDF_DLL
88 88 QPDFTokenizer();
89 89  
90 90 // PDF files with version < 1.2 allowed the pound character
... ... @@ -92,7 +92,7 @@ class QPDFTokenizer
92 92 // character was allowed only when followed by two hexadecimal
93 93 // digits. This method should be called when parsing a PDF file
94 94 // whose version is older than 1.2.
95   - DLL_EXPORT
  95 + QPDF_DLL
96 96 void allowPoundAnywhereInName();
97 97  
98 98 // Mode of operation:
... ... @@ -103,23 +103,23 @@ class QPDFTokenizer
103 103  
104 104 // It these are called when a token is available, an exception
105 105 // will be thrown.
106   - DLL_EXPORT
  106 + QPDF_DLL
107 107 void presentCharacter(char ch);
108   - DLL_EXPORT
  108 + QPDF_DLL
109 109 void presentEOF();
110 110  
111 111 // If a token is available, return true and initialize token with
112 112 // the token, unread_char with whether or not we have to unread
113 113 // the last character, and if unread_char, ch with the character
114 114 // to unread.
115   - DLL_EXPORT
  115 + QPDF_DLL
116 116 bool getToken(Token& token, bool& unread_char, char& ch);
117 117  
118 118 // This function returns true of the current character is between
119 119 // tokens (i.e., white space that is not part of a string) or is
120 120 // part of a comment. A tokenizing filter can call this to
121 121 // determine whether to output the character.
122   - DLL_EXPORT
  122 + QPDF_DLL
123 123 bool betweenTokens();
124 124  
125 125 private:
... ...
include/qpdf/QPDFWriter.hh
... ... @@ -42,9 +42,9 @@ class QPDFWriter
42 42 // useful for tracking down problems. If your application doesn't
43 43 // want the partially written file to be left behind, you should
44 44 // delete it the eventual call to write fails.
45   - DLL_EXPORT
  45 + QPDF_DLL
46 46 QPDFWriter(QPDF& pdf, char const* filename);
47   - DLL_EXPORT
  47 + QPDF_DLL
48 48 ~QPDFWriter();
49 49  
50 50 // Set the value of object stream mode. In disable mode, we never
... ... @@ -54,7 +54,7 @@ class QPDFWriter
54 54 // generate a conventional cross-reference table if there are no
55 55 // object streams and a cross-reference stream if there are object
56 56 // streams. The default is o_preserve.
57   - DLL_EXPORT
  57 + QPDF_DLL
58 58 void setObjectStreamMode(qpdf_object_stream_e);
59 59  
60 60 // Set value of stream data mode. In uncompress mode, we attempt
... ... @@ -62,7 +62,7 @@ class QPDFWriter
62 62 // preserve any filtering applied to streams. In compress mode,
63 63 // if we can apply all filters and the stream is not already
64 64 // optimally compressed, recompress the stream.
65   - DLL_EXPORT
  65 + QPDF_DLL
66 66 void setStreamDataMode(qpdf_stream_data_e);
67 67  
68 68 // Set value of content stream normalization. The default is
... ... @@ -72,7 +72,7 @@ class QPDFWriter
72 72 // damage the content stream. This flag should be used only for
73 73 // debugging and experimenting with PDF content streams. Never
74 74 // use it for production files.
75   - DLL_EXPORT
  75 + QPDF_DLL
76 76 void setContentNormalization(bool);
77 77  
78 78 // Set QDF mode. QDF mode causes special "pretty printing" of
... ... @@ -80,7 +80,7 @@ class QPDFWriter
80 80 // Resulting PDF files can be edited in a text editor and then run
81 81 // through fix-qdf to update cross reference tables and stream
82 82 // lengths.
83   - DLL_EXPORT
  83 + QPDF_DLL
84 84 void setQDFMode(bool);
85 85  
86 86 // Set the minimum PDF version. If the PDF version of the input
... ... @@ -92,7 +92,7 @@ class QPDFWriter
92 92 // QPDFWriter automatically sets the minimum version to 1.4 when
93 93 // R3 encryption parameters are used, and to 1.5 when object
94 94 // streams are used.
95   - DLL_EXPORT
  95 + QPDF_DLL
96 96 void setMinimumPDFVersion(std::string const&);
97 97  
98 98 // Force the PDF version of the output file to be a given version.
... ... @@ -110,32 +110,32 @@ class QPDFWriter
110 110 // that type of encryption will explicitly disable decryption.
111 111 // Additionally, forcing to a version below 1.5 will disable
112 112 // object streams.
113   - DLL_EXPORT
  113 + QPDF_DLL
114 114 void forcePDFVersion(std::string const&);
115 115  
116 116 // Cause a static /ID value to be generated. Use only in test
117 117 // suites.
118   - DLL_EXPORT
  118 + QPDF_DLL
119 119 void setStaticID(bool);
120 120  
121 121 // Use a fixed initialization vector for AES-CBC encryption. This
122 122 // is not secure. It should be used only in test suites for
123 123 // creating predictable encrypted output.
124   - DLL_EXPORT
  124 + QPDF_DLL
125 125 void setStaticAesIV(bool);
126 126  
127 127 // Suppress inclusion of comments indicating original object IDs
128 128 // when writing QDF files. This can also be useful for testing,
129 129 // particularly when using comparison of two qdf files to
130 130 // determine whether two PDF files have identical content.
131   - DLL_EXPORT
  131 + QPDF_DLL
132 132 void setSuppressOriginalObjectIDs(bool);
133 133  
134 134 // Preserve encryption. The default is true unless prefilering,
135 135 // content normalization, or qdf mode has been selected in which
136 136 // case encryption is never preserved. Encryption is also not
137 137 // preserved if we explicitly set encryption parameters.
138   - DLL_EXPORT
  138 + QPDF_DLL
139 139 void setPreserveEncryption(bool);
140 140  
141 141 // Set up for encrypted output. Disables stream prefiltering and
... ... @@ -144,17 +144,17 @@ class QPDFWriter
144 144 // encryption parameters pushes the PDF version number to at least
145 145 // 1.4, and setting R4 parameters pushes the version to at least
146 146 // 1.5, or if AES is used, 1.6.
147   - DLL_EXPORT
  147 + QPDF_DLL
148 148 void setR2EncryptionParameters(
149 149 char const* user_password, char const* owner_password,
150 150 bool allow_print, bool allow_modify,
151 151 bool allow_extract, bool allow_annotate);
152   - DLL_EXPORT
  152 + QPDF_DLL
153 153 void setR3EncryptionParameters(
154 154 char const* user_password, char const* owner_password,
155 155 bool allow_accessibility, bool allow_extract,
156 156 qpdf_r3_print_e print, qpdf_r3_modify_e modify);
157   - DLL_EXPORT
  157 + QPDF_DLL
158 158 void setR4EncryptionParameters(
159 159 char const* user_password, char const* owner_password,
160 160 bool allow_accessibility, bool allow_extract,
... ... @@ -163,16 +163,13 @@ class QPDFWriter
163 163  
164 164 // Create linearized output. Disables qdf mode, content
165 165 // normalization, and stream prefiltering.
166   - DLL_EXPORT
  166 + QPDF_DLL
167 167 void setLinearization(bool);
168 168  
169   - DLL_EXPORT
  169 + QPDF_DLL
170 170 void write();
171 171  
172 172 private:
173   - QPDFWriter(QPDFWriter const&);
174   - QPDFWriter& operator=(QPDFWriter const&);
175   -
176 173 // flags used by unparseObject
177 174 static int const f_stream = 1 << 0;
178 175 static int const f_filtered = 1 << 1;
... ...
include/qpdf/QPDFXRefEntry.hh
... ... @@ -19,18 +19,18 @@ class QPDFXRefEntry
19 19 // 1 = "uncompressed"; field 1 = offset
20 20 // 2 = "compressed"; field 1 = object stream number, field 2 = index
21 21  
22   - DLL_EXPORT
  22 + QPDF_DLL
23 23 QPDFXRefEntry();
24   - DLL_EXPORT
  24 + QPDF_DLL
25 25 QPDFXRefEntry(int type, int field1, int field2);
26 26  
27   - DLL_EXPORT
  27 + QPDF_DLL
28 28 int getType() const;
29   - DLL_EXPORT
  29 + QPDF_DLL
30 30 int getOffset() const; // only for type 1
31   - DLL_EXPORT
  31 + QPDF_DLL
32 32 int getObjStreamNumber() const; // only for type 2
33   - DLL_EXPORT
  33 + QPDF_DLL
34 34 int getObjStreamIndex() const; // only for type 2
35 35  
36 36 private:
... ...
include/qpdf/QTC.hh
... ... @@ -12,7 +12,7 @@
12 12  
13 13 namespace QTC
14 14 {
15   - DLL_EXPORT
  15 + QPDF_DLL
16 16 void TC(char const* const scope, char const* const ccase, int n = 0);
17 17 };
18 18  
... ...
include/qpdf/QUtil.hh
... ... @@ -19,15 +19,15 @@ namespace QUtil
19 19 {
20 20 // This is a collection of useful utility functions that don't
21 21 // really go anywhere else.
22   - DLL_EXPORT
  22 + QPDF_DLL
23 23 std::string int_to_string(int, int length = 0);
24   - DLL_EXPORT
  24 + QPDF_DLL
25 25 std::string double_to_string(double, int decimal_places = 0);
26 26  
27 27 // Throw std::runtime_error with a string formed by appending to
28 28 // "description: " the standard string corresponding to the
29 29 // current value of errno.
30   - DLL_EXPORT
  30 + QPDF_DLL
31 31 void throw_system_error(std::string const& description);
32 32  
33 33 // The status argument is assumed to be the return value of a
... ... @@ -35,40 +35,40 @@ namespace QUtil
35 35 // is -1, convert the current value of errno to a
36 36 // std::runtime_error that includes the standard error string.
37 37 // Otherwise, return status.
38   - DLL_EXPORT
  38 + QPDF_DLL
39 39 int os_wrapper(std::string const& description, int status);
40 40  
41 41 // The FILE* argument is assumed to be the return of fopen. If
42 42 // null, throw std::runtime_error. Otherwise, return the FILE*
43 43 // argument.
44   - DLL_EXPORT
  44 + QPDF_DLL
45 45 FILE* fopen_wrapper(std::string const&, FILE*);
46 46  
47   - DLL_EXPORT
  47 + QPDF_DLL
48 48 char* copy_string(std::string const&);
49 49  
50 50 // Set stdin, stdout to binary mode
51   - DLL_EXPORT
  51 + QPDF_DLL
52 52 void binary_stdout();
53   - DLL_EXPORT
  53 + QPDF_DLL
54 54 void binary_stdin();
55 55  
56 56 // May modify argv0
57   - DLL_EXPORT
  57 + QPDF_DLL
58 58 char* getWhoami(char* argv0);
59 59  
60 60 // Get the value of an environment variable in a portable fashion.
61 61 // Returns true iff the variable is defined. If `value' is
62 62 // non-null, initializes it with the value of the variable.
63   - DLL_EXPORT
  63 + QPDF_DLL
64 64 bool get_env(std::string const& var, std::string* value = 0);
65 65  
66   - DLL_EXPORT
  66 + QPDF_DLL
67 67 time_t get_current_time();
68 68  
69 69 // Return a string containing the byte representation of the UTF-8
70 70 // encoding for the unicode value passed in.
71   - DLL_EXPORT
  71 + QPDF_DLL
72 72 std::string toUTF8(unsigned long uval);
73 73 };
74 74  
... ...
include/qpdf/qpdf-c.h
... ... @@ -87,13 +87,13 @@ extern &quot;C&quot; {
87 87 /* Returns dynamically allocated qpdf_data pointer; must be freed
88 88 * by calling qpdf_cleanup.
89 89 */
90   - DLL_EXPORT
  90 + QPDF_DLL
91 91 qpdf_data qpdf_init();
92 92  
93 93 /* Pass a pointer to the qpdf_data pointer created by qpdf_init to
94 94 * clean up resources.
95 95 */
96   - DLL_EXPORT
  96 + QPDF_DLL
97 97 void qpdf_cleanup(qpdf_data* qpdf);
98 98  
99 99 /* ERROR REPORTING */
... ... @@ -102,37 +102,37 @@ extern &quot;C&quot; {
102 102 * pointer to data that will become invalid the next time an error
103 103 * occurs or after this function is called gain.
104 104 */
105   - DLL_EXPORT
  105 + QPDF_DLL
106 106 qpdf_error qpdf_get_error(qpdf_data qpdf);
107 107  
108 108 /* Returns 1 if there are any unretrieved warnings, and zero
109 109 * otherwise.
110 110 */
111   - DLL_EXPORT
  111 + QPDF_DLL
112 112 QPDF_BOOL qpdf_more_warnings(qpdf_data qpdf);
113 113  
114 114 /* If there are any warnings, returns a pointer to the next
115 115 * warning. Otherwise returns a null pointer.
116 116 */
117   - DLL_EXPORT
  117 + QPDF_DLL
118 118 qpdf_error qpdf_next_warning(qpdf_data qpdf);
119 119  
120 120 /* Extract fields of the error. */
121 121  
122 122 /* Use this function to get a full error message suitable for
123 123 * showing to the user. */
124   - DLL_EXPORT
  124 + QPDF_DLL
125 125 char const* qpdf_get_error_full_text(qpdf_data q, qpdf_error e);
126 126  
127 127 /* Use these functions to extract individual fields from the
128 128 * error; see QPDFExc.hh for details. */
129   - DLL_EXPORT
  129 + QPDF_DLL
130 130 enum qpdf_error_code_e qpdf_get_error_code(qpdf_data q, qpdf_error e);
131   - DLL_EXPORT
  131 + QPDF_DLL
132 132 char const* qpdf_get_error_filename(qpdf_data q, qpdf_error e);
133   - DLL_EXPORT
  133 + QPDF_DLL
134 134 unsigned long qpdf_get_error_file_position(qpdf_data q, qpdf_error e);
135   - DLL_EXPORT
  135 + QPDF_DLL
136 136 char const* qpdf_get_error_message_detail(qpdf_data q, qpdf_error e);
137 137  
138 138 /* By default, warnings are written to stderr. Passing true to
... ... @@ -140,17 +140,17 @@ extern &quot;C&quot; {
140 140 * stderr. They will still be available by calls to
141 141 * qpdf_next_warning.
142 142 */
143   - DLL_EXPORT
  143 + QPDF_DLL
144 144 void qpdf_set_suppress_warnings(qpdf_data qpdf, QPDF_BOOL value);
145 145  
146 146 /* READ FUNCTIONS */
147 147  
148 148 /* READ PARAMETER FUNCTIONS -- must be called before qpdf_read */
149 149  
150   - DLL_EXPORT
  150 + QPDF_DLL
151 151 void qpdf_set_ignore_xref_streams(qpdf_data qpdf, QPDF_BOOL value);
152 152  
153   - DLL_EXPORT
  153 + QPDF_DLL
154 154 void qpdf_set_attempt_recovery(qpdf_data qpdf, QPDF_BOOL value);
155 155  
156 156 /* Calling qpdf_read causes processFile to be called in the C++
... ... @@ -158,14 +158,14 @@ extern &quot;C&quot; {
158 158 * only read as needed. For files without passwords, pass a null
159 159 * pointer as the password.
160 160 */
161   - DLL_EXPORT
  161 + QPDF_DLL
162 162 QPDF_ERROR_CODE qpdf_read(qpdf_data qpdf, char const* filename,
163 163 char const* password);
164 164  
165 165 /* Read functions below must be called after qpdf_read. */
166 166  
167 167 /* Return the version of the PDF file. */
168   - DLL_EXPORT
  168 + QPDF_DLL
169 169 char const* qpdf_get_pdf_version(qpdf_data qpdf);
170 170  
171 171 /* Return the user password. If the file is opened using the
... ... @@ -173,34 +173,34 @@ extern &quot;C&quot; {
173 173 * function. If the file is opened using the user password, this
174 174 * function will return that user password.
175 175 */
176   - DLL_EXPORT
  176 + QPDF_DLL
177 177 char const* qpdf_get_user_password(qpdf_data qpdf);
178 178  
179 179 /* Indicate whether the input file is linearized. */
180   - DLL_EXPORT
  180 + QPDF_DLL
181 181 QPDF_BOOL qpdf_is_linearized(qpdf_data qpdf);
182 182  
183 183 /* Indicate whether the input file is encrypted. */
184   - DLL_EXPORT
  184 + QPDF_DLL
185 185 QPDF_BOOL qpdf_is_encrypted(qpdf_data qpdf);
186 186  
187   - DLL_EXPORT
  187 + QPDF_DLL
188 188 QPDF_BOOL qpdf_allow_accessibility(qpdf_data qpdf);
189   - DLL_EXPORT
  189 + QPDF_DLL
190 190 QPDF_BOOL qpdf_allow_extract_all(qpdf_data qpdf);
191   - DLL_EXPORT
  191 + QPDF_DLL
192 192 QPDF_BOOL qpdf_allow_print_low_res(qpdf_data qpdf);
193   - DLL_EXPORT
  193 + QPDF_DLL
194 194 QPDF_BOOL qpdf_allow_print_high_res(qpdf_data qpdf);
195   - DLL_EXPORT
  195 + QPDF_DLL
196 196 QPDF_BOOL qpdf_allow_modify_assembly(qpdf_data qpdf);
197   - DLL_EXPORT
  197 + QPDF_DLL
198 198 QPDF_BOOL qpdf_allow_modify_form(qpdf_data qpdf);
199   - DLL_EXPORT
  199 + QPDF_DLL
200 200 QPDF_BOOL qpdf_allow_modify_annotation(qpdf_data qpdf);
201   - DLL_EXPORT
  201 + QPDF_DLL
202 202 QPDF_BOOL qpdf_allow_modify_other(qpdf_data qpdf);
203   - DLL_EXPORT
  203 + QPDF_DLL
204 204 QPDF_BOOL qpdf_allow_modify_all(qpdf_data qpdf);
205 205  
206 206 /* WRITE FUNCTIONS */
... ... @@ -219,72 +219,72 @@ extern &quot;C&quot; {
219 219 * etc.) is lost, so any write parameter functions must be called
220 220 * again.
221 221 */
222   - DLL_EXPORT
  222 + QPDF_DLL
223 223 QPDF_ERROR_CODE qpdf_init_write(qpdf_data qpdf, char const* filename);
224 224  
225   - DLL_EXPORT
  225 + QPDF_DLL
226 226 void qpdf_set_object_stream_mode(qpdf_data qpdf,
227 227 enum qpdf_object_stream_e mode);
228 228  
229   - DLL_EXPORT
  229 + QPDF_DLL
230 230 void qpdf_set_stream_data_mode(qpdf_data qpdf,
231 231 enum qpdf_stream_data_e mode);
232 232  
233   - DLL_EXPORT
  233 + QPDF_DLL
234 234 void qpdf_set_content_normalization(qpdf_data qpdf, QPDF_BOOL value);
235 235  
236   - DLL_EXPORT
  236 + QPDF_DLL
237 237 void qpdf_set_qdf_mode(qpdf_data qpdf, QPDF_BOOL value);
238 238  
239 239 /* Never use qpdf_set_static_ID except in test suites to suppress
240 240 * generation of a random /ID.
241 241 */
242   - DLL_EXPORT
  242 + QPDF_DLL
243 243 void qpdf_set_static_ID(qpdf_data qpdf, QPDF_BOOL value);
244 244  
245 245 /* Never use qpdf_set_static_aes_IV except in test suites to
246 246 * create predictable AES encrypted output.
247 247 */
248   - DLL_EXPORT
  248 + QPDF_DLL
249 249 void qpdf_set_static_aes_IV(qpdf_data qpdf, QPDF_BOOL value);
250 250  
251   - DLL_EXPORT
  251 + QPDF_DLL
252 252 void qpdf_set_suppress_original_object_IDs(
253 253 qpdf_data qpdf, QPDF_BOOL value);
254 254  
255   - DLL_EXPORT
  255 + QPDF_DLL
256 256 void qpdf_set_preserve_encryption(qpdf_data qpdf, QPDF_BOOL value);
257 257  
258   - DLL_EXPORT
  258 + QPDF_DLL
259 259 void qpdf_set_r2_encryption_parameters(
260 260 qpdf_data qpdf, char const* user_password, char const* owner_password,
261 261 QPDF_BOOL allow_print, QPDF_BOOL allow_modify,
262 262 QPDF_BOOL allow_extract, QPDF_BOOL allow_annotate);
263 263  
264   - DLL_EXPORT
  264 + QPDF_DLL
265 265 void qpdf_set_r3_encryption_parameters(
266 266 qpdf_data qpdf, char const* user_password, char const* owner_password,
267 267 QPDF_BOOL allow_accessibility, QPDF_BOOL allow_extract,
268 268 enum qpdf_r3_print_e print, enum qpdf_r3_modify_e modify);
269 269  
270   - DLL_EXPORT
  270 + QPDF_DLL
271 271 void qpdf_set_r4_encryption_parameters(
272 272 qpdf_data qpdf, char const* user_password, char const* owner_password,
273 273 QPDF_BOOL allow_accessibility, QPDF_BOOL allow_extract,
274 274 enum qpdf_r3_print_e print, enum qpdf_r3_modify_e modify,
275 275 QPDF_BOOL encrypt_metadata, QPDF_BOOL use_aes);
276 276  
277   - DLL_EXPORT
  277 + QPDF_DLL
278 278 void qpdf_set_linearization(qpdf_data qpdf, QPDF_BOOL value);
279 279  
280   - DLL_EXPORT
  280 + QPDF_DLL
281 281 void qpdf_set_minimum_pdf_version(qpdf_data qpdf, char const* version);
282 282  
283   - DLL_EXPORT
  283 + QPDF_DLL
284 284 void qpdf_force_pdf_version(qpdf_data qpdf, char const* version);
285 285  
286 286 /* Do actual write operation. */
287   - DLL_EXPORT
  287 + QPDF_DLL
288 288 QPDF_ERROR_CODE qpdf_write(qpdf_data qpdf);
289 289  
290 290 #ifdef __cplusplus
... ...
libqpdf/qpdf/BitStream.hh
... ... @@ -8,13 +8,13 @@
8 8 class BitStream
9 9 {
10 10 public:
11   - DLL_EXPORT
  11 + QPDF_DLL
12 12 BitStream(unsigned char const* p, int nbytes);
13   - DLL_EXPORT
  13 + QPDF_DLL
14 14 void reset();
15   - DLL_EXPORT
  15 + QPDF_DLL
16 16 unsigned long getBits(int nbits);
17   - DLL_EXPORT
  17 + QPDF_DLL
18 18 void skipToNextByte();
19 19  
20 20 private:
... ...
libqpdf/qpdf/BitWriter.hh
... ... @@ -12,12 +12,12 @@ class BitWriter
12 12 public:
13 13 // Write bits to the pipeline. It is the caller's responsibility
14 14 // to eventually call finish on the pipeline.
15   - DLL_EXPORT
  15 + QPDF_DLL
16 16 BitWriter(Pipeline* pl);
17   - DLL_EXPORT
  17 + QPDF_DLL
18 18 void writeBits(unsigned long val, int bits);
19 19 // Force any partial byte to be written to the pipeline.
20   - DLL_EXPORT
  20 + QPDF_DLL
21 21 void flush();
22 22  
23 23 private:
... ...
libqpdf/qpdf/MD5.hh
... ... @@ -13,50 +13,50 @@ class MD5
13 13 public:
14 14 typedef unsigned char Digest[16];
15 15  
16   - DLL_EXPORT
  16 + QPDF_DLL
17 17 MD5();
18   - DLL_EXPORT
  18 + QPDF_DLL
19 19 void reset();
20 20  
21 21 // encodes string and finalizes
22   - DLL_EXPORT
  22 + QPDF_DLL
23 23 void encodeString(char const* input_string);
24 24  
25 25 // encodes file and finalizes
26   - DLL_EXPORT
  26 + QPDF_DLL
27 27 void encodeFile(char const* filename, int up_to_size = -1);
28 28  
29 29 // appends string to current md5 object
30   - DLL_EXPORT
  30 + QPDF_DLL
31 31 void appendString(char const* input_string);
32 32  
33 33 // appends arbitrary data to current md5 object
34   - DLL_EXPORT
  34 + QPDF_DLL
35 35 void encodeDataIncrementally(char const* input_data, int len);
36 36  
37 37 // computes a raw digest
38   - DLL_EXPORT
  38 + QPDF_DLL
39 39 void digest(Digest);
40 40  
41 41 // prints the digest to stdout terminated with \r\n (primarily for
42 42 // testing)
43   - DLL_EXPORT
  43 + QPDF_DLL
44 44 void print();
45 45  
46 46 // returns the digest as a hexadecimal string
47   - DLL_EXPORT
  47 + QPDF_DLL
48 48 std::string unparse();
49 49  
50 50 // Convenience functions
51   - DLL_EXPORT
  51 + QPDF_DLL
52 52 static std::string getDataChecksum(char const* buf, int len);
53   - DLL_EXPORT
  53 + QPDF_DLL
54 54 static std::string getFileChecksum(char const* filename,
55 55 int up_to_size = -1);
56   - DLL_EXPORT
  56 + QPDF_DLL
57 57 static bool checkDataChecksum(char const* const checksum,
58 58 char const* buf, int len);
59   - DLL_EXPORT
  59 + QPDF_DLL
60 60 static bool checkFileChecksum(char const* const checksum,
61 61 char const* filename, int up_to_size = -1);
62 62  
... ...
libqpdf/qpdf/PCRE.hh
... ... @@ -25,7 +25,7 @@ class PCRE
25 25 class NoBackref: public std::logic_error
26 26 {
27 27 public:
28   - DLL_EXPORT
  28 + QPDF_DLL
29 29 NoBackref();
30 30 virtual ~NoBackref() throw() {}
31 31 };
... ... @@ -34,15 +34,15 @@ class PCRE
34 34 {
35 35 friend class PCRE;
36 36 public:
37   - DLL_EXPORT
  37 + QPDF_DLL
38 38 Match(int nbackrefs, char const* subject);
39   - DLL_EXPORT
  39 + QPDF_DLL
40 40 Match(Match const&);
41   - DLL_EXPORT
  41 + QPDF_DLL
42 42 Match& operator=(Match const&);
43   - DLL_EXPORT
  43 + QPDF_DLL
44 44 ~Match();
45   - DLL_EXPORT
  45 + QPDF_DLL
46 46 operator bool();
47 47  
48 48 // All the back reference accessing routines may throw the
... ... @@ -54,13 +54,13 @@ class PCRE
54 54 // and not matching at all.
55 55  
56 56 // see getMatch flags below
57   - DLL_EXPORT
  57 + QPDF_DLL
58 58 std::string getMatch(int n, int flags = 0);
59   - DLL_EXPORT
  59 + QPDF_DLL
60 60 void getOffsetLength(int n, int& offset, int& length);
61   - DLL_EXPORT
  61 + QPDF_DLL
62 62 int getOffset(int n);
63   - DLL_EXPORT
  63 + QPDF_DLL
64 64 int getLength(int n);
65 65  
66 66 // nMatches returns the number of available matches including
... ... @@ -70,7 +70,7 @@ class PCRE
70 70 // will return the whole string, getMatch(1) will return the
71 71 // text that matched the backreference, and getMatch(2) will
72 72 // throw an exception because it is out of range.
73   - DLL_EXPORT
  73 + QPDF_DLL
74 74 int nMatches() const;
75 75  
76 76 // Flags for getMatch
... ... @@ -93,16 +93,16 @@ class PCRE
93 93  
94 94 // The value passed in as options is passed to pcre_exec. See man
95 95 // pcreapi for details.
96   - DLL_EXPORT
  96 + QPDF_DLL
97 97 PCRE(char const* pattern, int options = 0);
98   - DLL_EXPORT
  98 + QPDF_DLL
99 99 ~PCRE();
100 100  
101   - DLL_EXPORT
  101 + QPDF_DLL
102 102 Match match(char const* subject, int options = 0, int startoffset = 0,
103 103 int size = -1);
104 104  
105   - DLL_EXPORT
  105 + QPDF_DLL
106 106 static void test(int n = 0);
107 107  
108 108 private:
... ...
libqpdf/qpdf/Pl_AES_PDF.hh
... ... @@ -12,22 +12,22 @@ class Pl_AES_PDF: public Pipeline
12 12 public:
13 13 // key_data should be a pointer to key_size bytes of data
14 14 static unsigned int const key_size = 16;
15   - DLL_EXPORT
  15 + QPDF_DLL
16 16 Pl_AES_PDF(char const* identifier, Pipeline* next,
17 17 bool encrypt, unsigned char const key[key_size]);
18   - DLL_EXPORT
  18 + QPDF_DLL
19 19 virtual ~Pl_AES_PDF();
20 20  
21   - DLL_EXPORT
  21 + QPDF_DLL
22 22 virtual void write(unsigned char* data, int len);
23   - DLL_EXPORT
  23 + QPDF_DLL
24 24 virtual void finish();
25 25  
26 26 // For testing only; PDF always uses CBC
27   - DLL_EXPORT
  27 + QPDF_DLL
28 28 void disableCBC();
29 29 // For testing only: use a fixed initialization vector for CBC
30   - DLL_EXPORT
  30 + QPDF_DLL
31 31 static void useStaticIV();
32 32  
33 33 private:
... ...
libqpdf/qpdf/Pl_ASCII85Decoder.hh
... ... @@ -6,13 +6,13 @@
6 6 class Pl_ASCII85Decoder: public Pipeline
7 7 {
8 8 public:
9   - DLL_EXPORT
  9 + QPDF_DLL
10 10 Pl_ASCII85Decoder(char const* identifier, Pipeline* next);
11   - DLL_EXPORT
  11 + QPDF_DLL
12 12 virtual ~Pl_ASCII85Decoder();
13   - DLL_EXPORT
  13 + QPDF_DLL
14 14 virtual void write(unsigned char* buf, int len);
15   - DLL_EXPORT
  15 + QPDF_DLL
16 16 virtual void finish();
17 17  
18 18 private:
... ...
libqpdf/qpdf/Pl_ASCIIHexDecoder.hh
... ... @@ -6,13 +6,13 @@
6 6 class Pl_ASCIIHexDecoder: public Pipeline
7 7 {
8 8 public:
9   - DLL_EXPORT
  9 + QPDF_DLL
10 10 Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next);
11   - DLL_EXPORT
  11 + QPDF_DLL
12 12 virtual ~Pl_ASCIIHexDecoder();
13   - DLL_EXPORT
  13 + QPDF_DLL
14 14 virtual void write(unsigned char* buf, int len);
15   - DLL_EXPORT
  15 + QPDF_DLL
16 16 virtual void finish();
17 17  
18 18 private:
... ...
libqpdf/qpdf/Pl_LZWDecoder.hh
... ... @@ -9,14 +9,14 @@
9 9 class Pl_LZWDecoder: public Pipeline
10 10 {
11 11 public:
12   - DLL_EXPORT
  12 + QPDF_DLL
13 13 Pl_LZWDecoder(char const* identifier, Pipeline* next,
14 14 bool early_code_change);
15   - DLL_EXPORT
  15 + QPDF_DLL
16 16 virtual ~Pl_LZWDecoder();
17   - DLL_EXPORT
  17 + QPDF_DLL
18 18 virtual void write(unsigned char* buf, int len);
19   - DLL_EXPORT
  19 + QPDF_DLL
20 20 virtual void finish();
21 21  
22 22 private:
... ...
libqpdf/qpdf/Pl_MD5.hh
... ... @@ -15,15 +15,15 @@
15 15 class Pl_MD5: public Pipeline
16 16 {
17 17 public:
18   - DLL_EXPORT
  18 + QPDF_DLL
19 19 Pl_MD5(char const* identifier, Pipeline* next);
20   - DLL_EXPORT
  20 + QPDF_DLL
21 21 virtual ~Pl_MD5();
22   - DLL_EXPORT
  22 + QPDF_DLL
23 23 virtual void write(unsigned char*, int);
24   - DLL_EXPORT
  24 + QPDF_DLL
25 25 virtual void finish();
26   - DLL_EXPORT
  26 + QPDF_DLL
27 27 std::string getHexDigest();
28 28  
29 29 private:
... ...
libqpdf/qpdf/Pl_PNGFilter.hh
... ... @@ -22,16 +22,16 @@ class Pl_PNGFilter: public Pipeline
22 22 // Encoding is not presently supported
23 23 enum action_e { a_encode, a_decode };
24 24  
25   - DLL_EXPORT
  25 + QPDF_DLL
26 26 Pl_PNGFilter(char const* identifier, Pipeline* next,
27 27 action_e action, unsigned int columns,
28 28 unsigned int bytes_per_pixel);
29   - DLL_EXPORT
  29 + QPDF_DLL
30 30 virtual ~Pl_PNGFilter();
31 31  
32   - DLL_EXPORT
  32 + QPDF_DLL
33 33 virtual void write(unsigned char* data, int len);
34   - DLL_EXPORT
  34 + QPDF_DLL
35 35 virtual void finish();
36 36  
37 37 private:
... ...
libqpdf/qpdf/Pl_RC4.hh
... ... @@ -11,16 +11,16 @@ class Pl_RC4: public Pipeline
11 11 static int const def_bufsize = 65536;
12 12  
13 13 // key_len of -1 means treat key_data as a null-terminated string
14   - DLL_EXPORT
  14 + QPDF_DLL
15 15 Pl_RC4(char const* identifier, Pipeline* next,
16 16 unsigned char const* key_data, int key_len = -1,
17 17 int out_bufsize = def_bufsize);
18   - DLL_EXPORT
  18 + QPDF_DLL
19 19 virtual ~Pl_RC4();
20 20  
21   - DLL_EXPORT
  21 + QPDF_DLL
22 22 virtual void write(unsigned char* data, int len);
23   - DLL_EXPORT
  23 + QPDF_DLL
24 24 virtual void finish();
25 25  
26 26 private:
... ...
make/mingw.mk
... ... @@ -33,8 +33,23 @@ define c_compile
33 33 -c $(1) -o $(call c_src_to_obj,$(1))
34 34 endef
35 35  
36   -libcompile = $(compile)
37   -c_libcompile = $(c_compile)
  36 +# 1 2
  37 +# Usage: $(call libcompile,src,includes)
  38 +define libcompile
  39 + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -DDLL_EXPORT \
  40 + $(call depflags,$(basename $(call src_to_obj,$(1)))) \
  41 + $(foreach I,$(2),-I$(I)) \
  42 + -c $(1) -o $(call src_to_obj,$(1))
  43 +endef
  44 +
  45 +# 1 2
  46 +# Usage: $(call c_libcompile,src,includes)
  47 +define c_libcompile
  48 + $(CC) $(CPPFLAGS) $(CFLAGS) -DDLL_EXPORT \
  49 + $(call depflags,$(basename $(call src_to_obj,$(1)))) \
  50 + $(foreach I,$(2),-I$(I)) \
  51 + -c $(1) -o $(call c_src_to_obj,$(1))
  52 +endef
38 53  
39 54 # 1 2
40 55 # Usage: $(call makeslib,objs,library)
... ...
make/msvc.mk
... ... @@ -40,8 +40,21 @@ define c_compile
40 40 /c $(1) /Fo$(call c_src_to_obj,$(1))
41 41 endef
42 42  
43   -libcompile = $(compile)
44   -c_libcompile = $(c_compile)
  43 +# 1 2
  44 +# Usage: $(call libcompile,src,includes)
  45 +define libcompile
  46 + cl /nologo /Zi /Gy /EHsc /MD /TP /GR $(CPPFLAGS) $(CXXFLAGS) \
  47 + -DDLL_EXPORT $(foreach I,$(2),-I$(I)) \
  48 + /c $(1) /Fo$(call src_to_obj,$(1))
  49 +endef
  50 +
  51 +# 1 2
  52 +# Usage: $(call c_libcompile,src,includes)
  53 +define c_libcompile
  54 + cl /nologo /Zi /Gy /EHsc /MD $(CPPFLAGS) $(CXXFLAGS) \
  55 + -DDLL_EXPORT $(foreach I,$(2),-I$(I)) \
  56 + /c $(1) /Fo$(call c_src_to_obj,$(1))
  57 +endef
45 58  
46 59 # 1 2
47 60 # Usage: $(call makeslib,objs,library)
... ...