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