Commit 1e74c03acd39c000103b843d5acd3c0313da443a

Authored by Jay Berkenbilt
1 parent ed13d907

stick DLL_EXPORT in front of every public method of every public class

git-svn-id: svn+q:///qpdf/trunk@688 71b93d88-0707-0410-a8cf-f5a4172ac649
include/qpdf/Buffer.hh
@@ -8,16 +8,26 @@ @@ -8,16 +8,26 @@
8 #ifndef __BUFFER_HH__ 8 #ifndef __BUFFER_HH__
9 #define __BUFFER_HH__ 9 #define __BUFFER_HH__
10 10
  11 +#include <qpdf/DLL.hh>
  12 +
11 class Buffer 13 class Buffer
12 { 14 {
13 public: 15 public:
  16 + DLL_EXPORT
14 Buffer(); 17 Buffer();
  18 + DLL_EXPORT
15 Buffer(unsigned long size); 19 Buffer(unsigned long size);
  20 + DLL_EXPORT
16 Buffer(Buffer const&); 21 Buffer(Buffer const&);
  22 + DLL_EXPORT
17 Buffer& operator=(Buffer const&); 23 Buffer& operator=(Buffer const&);
  24 + DLL_EXPORT
18 ~Buffer(); 25 ~Buffer();
  26 + DLL_EXPORT
19 unsigned long getSize() const; 27 unsigned long getSize() const;
  28 + DLL_EXPORT
20 unsigned char const* getBuffer() const; 29 unsigned char const* getBuffer() const;
  30 + DLL_EXPORT
21 unsigned char* getBuffer(); 31 unsigned char* getBuffer();
22 32
23 private: 33 private:
include/qpdf/Pipeline.hh
@@ -30,6 +30,8 @@ @@ -30,6 +30,8 @@
30 #ifndef __PIPELINE_HH__ 30 #ifndef __PIPELINE_HH__
31 #define __PIPELINE_HH__ 31 #define __PIPELINE_HH__
32 32
  33 +#include <qpdf/DLL.hh>
  34 +
33 #include <qpdf/QEXC.hh> 35 #include <qpdf/QEXC.hh>
34 36
35 class Pipeline 37 class Pipeline
@@ -38,24 +40,30 @@ class Pipeline @@ -38,24 +40,30 @@ class Pipeline
38 class Exception: public QEXC::General 40 class Exception: public QEXC::General
39 { 41 {
40 public: 42 public:
  43 + DLL_EXPORT
41 Exception(std::string const& message) : 44 Exception(std::string const& message) :
42 QEXC::General(message) 45 QEXC::General(message)
43 { 46 {
44 } 47 }
45 48
  49 + DLL_EXPORT
46 virtual ~Exception() throw() 50 virtual ~Exception() throw()
47 { 51 {
48 } 52 }
49 }; 53 };
50 54
  55 + DLL_EXPORT
51 Pipeline(char const* identifier, Pipeline* next); 56 Pipeline(char const* identifier, Pipeline* next);
52 57
  58 + DLL_EXPORT
53 virtual ~Pipeline(); 59 virtual ~Pipeline();
54 60
55 // Subclasses should implement write and finish to do their jobs 61 // Subclasses should implement write and finish to do their jobs
56 // and then, if they are not end-of-line pipelines, call 62 // and then, if they are not end-of-line pipelines, call
57 // getNext()->write or getNext()->finish. 63 // getNext()->write or getNext()->finish.
  64 + DLL_EXPORT
58 virtual void write(unsigned char* data, int len) = 0; 65 virtual void write(unsigned char* data, int len) = 0;
  66 + DLL_EXPORT
59 virtual void finish() = 0; 67 virtual void finish() = 0;
60 68
61 protected: 69 protected:
include/qpdf/Pl_Count.hh
@@ -16,14 +16,20 @@ @@ -16,14 +16,20 @@
16 class Pl_Count: public Pipeline 16 class Pl_Count: public Pipeline
17 { 17 {
18 public: 18 public:
  19 + DLL_EXPORT
19 Pl_Count(char const* identifier, Pipeline* next); 20 Pl_Count(char const* identifier, Pipeline* next);
  21 + DLL_EXPORT
20 virtual ~Pl_Count(); 22 virtual ~Pl_Count();
  23 + DLL_EXPORT
21 virtual void write(unsigned char*, int); 24 virtual void write(unsigned char*, int);
  25 + DLL_EXPORT
22 virtual void finish(); 26 virtual void finish();
23 // Returns the number of bytes written 27 // Returns the number of bytes written
  28 + DLL_EXPORT
24 int getCount() const; 29 int getCount() const;
25 // Returns the last character written, or '\0' if no characters 30 // Returns the last character written, or '\0' if no characters
26 // have been written (in which case getCount() returns 0) 31 // have been written (in which case getCount() returns 0)
  32 + DLL_EXPORT
27 unsigned char getLastChar() const; 33 unsigned char getLastChar() const;
28 34
29 private: 35 private:
include/qpdf/Pl_Discard.hh
@@ -19,9 +19,13 @@ @@ -19,9 +19,13 @@
19 class Pl_Discard: public Pipeline 19 class Pl_Discard: public Pipeline
20 { 20 {
21 public: 21 public:
  22 + DLL_EXPORT
22 Pl_Discard(); 23 Pl_Discard();
  24 + DLL_EXPORT
23 virtual ~Pl_Discard(); 25 virtual ~Pl_Discard();
  26 + DLL_EXPORT
24 virtual void write(unsigned char*, int); 27 virtual void write(unsigned char*, int);
  28 + DLL_EXPORT
25 virtual void finish(); 29 virtual void finish();
26 }; 30 };
27 31
include/qpdf/Pl_Flate.hh
@@ -18,11 +18,13 @@ class Pl_Flate: public Pipeline @@ -18,11 +18,13 @@ class Pl_Flate: public Pipeline
18 class Exception: public Pipeline::Exception 18 class Exception: public Pipeline::Exception
19 { 19 {
20 public: 20 public:
  21 + DLL_EXPORT
21 Exception(std::string const& message) : 22 Exception(std::string const& message) :
22 Pipeline::Exception(message) 23 Pipeline::Exception(message)
23 { 24 {
24 } 25 }
25 26
  27 + DLL_EXPORT
26 virtual ~Exception() throw () 28 virtual ~Exception() throw ()
27 { 29 {
28 } 30 }
@@ -32,11 +34,15 @@ class Pl_Flate: public Pipeline @@ -32,11 +34,15 @@ class Pl_Flate: public Pipeline
32 34
33 enum action_e { a_inflate, a_deflate }; 35 enum action_e { a_inflate, a_deflate };
34 36
  37 + DLL_EXPORT
35 Pl_Flate(char const* identifier, Pipeline* next, 38 Pl_Flate(char const* identifier, Pipeline* next,
36 action_e action, int out_bufsize = def_bufsize); 39 action_e action, int out_bufsize = def_bufsize);
  40 + DLL_EXPORT
37 virtual ~Pl_Flate(); 41 virtual ~Pl_Flate();
38 42
  43 + DLL_EXPORT
39 virtual void write(unsigned char* data, int len); 44 virtual void write(unsigned char* data, int len);
  45 + DLL_EXPORT
40 virtual void finish(); 46 virtual void finish();
41 47
42 private: 48 private:
include/qpdf/Pl_StdioFile.hh
@@ -24,11 +24,13 @@ class Pl_StdioFile: public Pipeline @@ -24,11 +24,13 @@ class Pl_StdioFile: public Pipeline
24 class Exception: public Pipeline::Exception 24 class Exception: public Pipeline::Exception
25 { 25 {
26 public: 26 public:
  27 + DLL_EXPORT
27 Exception(std::string const& message) : 28 Exception(std::string const& message) :
28 Pipeline::Exception(message) 29 Pipeline::Exception(message)
29 { 30 {
30 } 31 }
31 32
  33 + DLL_EXPORT
32 virtual ~Exception() throw () 34 virtual ~Exception() throw ()
33 { 35 {
34 } 36 }
@@ -36,10 +38,14 @@ class Pl_StdioFile: public Pipeline @@ -36,10 +38,14 @@ class Pl_StdioFile: public Pipeline
36 38
37 // f is externally maintained; this class just writes to and 39 // f is externally maintained; this class just writes to and
38 // flushes it. It does not close it. 40 // flushes it. It does not close it.
  41 + DLL_EXPORT
39 Pl_StdioFile(char const* identifier, FILE* f); 42 Pl_StdioFile(char const* identifier, FILE* f);
  43 + DLL_EXPORT
40 virtual ~Pl_StdioFile(); 44 virtual ~Pl_StdioFile();
41 45
  46 + DLL_EXPORT
42 virtual void write(unsigned char* buf, int len); 47 virtual void write(unsigned char* buf, int len);
  48 + DLL_EXPORT
43 virtual void finish(); 49 virtual void finish();
44 50
45 private: 51 private:
include/qpdf/QEXC.hh
@@ -8,6 +8,8 @@ @@ -8,6 +8,8 @@
8 #ifndef __QEXC_HH__ 8 #ifndef __QEXC_HH__
9 #define __QEXC_HH__ 9 #define __QEXC_HH__
10 10
  11 +#include <qpdf/DLL.hh>
  12 +
11 #include <string> 13 #include <string>
12 #include <exception> 14 #include <exception>
13 #include <errno.h> 15 #include <errno.h>
@@ -69,13 +71,19 @@ namespace QEXC @@ -69,13 +71,19 @@ namespace QEXC
69 // Application/library code should not generally catch this 71 // Application/library code should not generally catch this
70 // directly. See above for caveats. 72 // directly. See above for caveats.
71 public: 73 public:
  74 + DLL_EXPORT
72 Base(); 75 Base();
  76 + DLL_EXPORT
73 Base(std::string const& message); 77 Base(std::string const& message);
  78 + DLL_EXPORT
74 virtual ~Base() throw() {} 79 virtual ~Base() throw() {}
  80 + DLL_EXPORT
75 virtual std::string const& unparse() const; 81 virtual std::string const& unparse() const;
  82 + DLL_EXPORT
76 virtual const char* what() const throw(); 83 virtual const char* what() const throw();
77 84
78 protected: 85 protected:
  86 + DLL_EXPORT
79 void setMessage(std::string const& message); 87 void setMessage(std::string const& message);
80 88
81 private: 89 private:
@@ -87,8 +95,11 @@ namespace QEXC @@ -87,8 +95,11 @@ namespace QEXC
87 // This is the base class for normal user/library-defined 95 // This is the base class for normal user/library-defined
88 // error conditions. 96 // error conditions.
89 public: 97 public:
  98 + DLL_EXPORT
90 General(); 99 General();
  100 + DLL_EXPORT
91 General(std::string const& message); 101 General(std::string const& message);
  102 + DLL_EXPORT
92 virtual ~General() throw() {}; 103 virtual ~General() throw() {};
93 }; 104 };
94 105
@@ -100,15 +111,20 @@ namespace QEXC @@ -100,15 +111,20 @@ namespace QEXC
100 class Internal: public Base 111 class Internal: public Base
101 { 112 {
102 public: 113 public:
  114 + DLL_EXPORT
103 Internal(std::string const& message); 115 Internal(std::string const& message);
  116 + DLL_EXPORT
104 virtual ~Internal() throw() {}; 117 virtual ~Internal() throw() {};
105 }; 118 };
106 119
107 class System: public General 120 class System: public General
108 { 121 {
109 public: 122 public:
  123 + DLL_EXPORT
110 System(std::string const& prefix, int sys_errno); 124 System(std::string const& prefix, int sys_errno);
  125 + DLL_EXPORT
111 virtual ~System() throw() {}; 126 virtual ~System() throw() {};
  127 + DLL_EXPORT
112 int getErrno() const; 128 int getErrno() const;
113 129
114 private: 130 private:
include/qpdf/QPDF.hh
@@ -13,6 +13,8 @@ @@ -13,6 +13,8 @@
13 #include <map> 13 #include <map>
14 #include <list> 14 #include <list>
15 15
  16 +#include <qpdf/DLL.hh>
  17 +
16 #include <qpdf/QPDFXRefEntry.hh> 18 #include <qpdf/QPDFXRefEntry.hh>
17 #include <qpdf/QPDFObjectHandle.hh> 19 #include <qpdf/QPDFObjectHandle.hh>
18 #include <qpdf/QPDFTokenizer.hh> 20 #include <qpdf/QPDFTokenizer.hh>
@@ -26,7 +28,9 @@ class QPDFExc; @@ -26,7 +28,9 @@ class QPDFExc;
26 class QPDF 28 class QPDF
27 { 29 {
28 public: 30 public:
  31 + DLL_EXPORT
29 QPDF(); 32 QPDF();
  33 + DLL_EXPORT
30 ~QPDF(); 34 ~QPDF();
31 35
32 // 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
@@ -36,6 +40,7 @@ class QPDF @@ -36,6 +40,7 @@ class QPDF
36 // potentially ask for information about the PDF file are called. 40 // potentially ask for information about the PDF file are called.
37 // Prior to calling this, the only methods that are allowed are 41 // Prior to calling this, the only methods that are allowed are
38 // those that set parameters. 42 // those that set parameters.
  43 + DLL_EXPORT
39 void processFile(char const* filename, char const* password = ""); 44 void processFile(char const* filename, char const* password = "");
40 45
41 // Parameter settings 46 // Parameter settings
@@ -44,18 +49,21 @@ class QPDF @@ -44,18 +49,21 @@ class QPDF
44 // (one that contains both cross-reference streams and 49 // (one that contains both cross-reference streams and
45 // cross-reference tables). This can be useful for testing to 50 // cross-reference tables). This can be useful for testing to
46 // ensure that a hybrid file would work with an older reader. 51 // ensure that a hybrid file would work with an older reader.
  52 + DLL_EXPORT
47 void setIgnoreXRefStreams(bool); 53 void setIgnoreXRefStreams(bool);
48 54
49 // By default, any warnings are issued to stderr as they are 55 // By default, any warnings are issued to stderr as they are
50 // encountered. If this is called with a true value, reporting of 56 // encountered. If this is called with a true value, reporting of
51 // warnings is suppressed. You may still retrieve warnings by 57 // warnings is suppressed. You may still retrieve warnings by
52 // calling getWarnings. 58 // calling getWarnings.
  59 + DLL_EXPORT
53 void setSuppressWarnings(bool); 60 void setSuppressWarnings(bool);
54 61
55 // By default, QPDF will try to recover if it finds certain types 62 // By default, QPDF will try to recover if it finds certain types
56 // of errors in PDF files. If turned off, it will throw an 63 // of errors in PDF files. If turned off, it will throw an
57 // exception on the first such problem it finds without attempting 64 // exception on the first such problem it finds without attempting
58 // recovery. 65 // recovery.
  66 + DLL_EXPORT
59 void setAttemptRecovery(bool); 67 void setAttemptRecovery(bool);
60 68
61 // Other public methods 69 // Other public methods
@@ -65,19 +73,26 @@ class QPDF @@ -65,19 +73,26 @@ class QPDF
65 // throws an exception. Note that if setSuppressWarnings was not 73 // throws an exception. Note that if setSuppressWarnings was not
66 // called or was called with a false value, any warnings retrieved 74 // called or was called with a false value, any warnings retrieved
67 // here will have already been issued to stderr. 75 // here will have already been issued to stderr.
  76 + DLL_EXPORT
68 std::vector<std::string> getWarnings(); 77 std::vector<std::string> getWarnings();
69 78
  79 + DLL_EXPORT
70 std::string getFilename() const; 80 std::string getFilename() const;
  81 + DLL_EXPORT
71 std::string getPDFVersion() const; 82 std::string getPDFVersion() const;
  83 + DLL_EXPORT
72 QPDFObjectHandle getTrailer(); 84 QPDFObjectHandle getTrailer();
  85 + DLL_EXPORT
73 QPDFObjectHandle getRoot(); 86 QPDFObjectHandle getRoot();
74 87
75 // Install this object handle as an indirect object and return an 88 // Install this object handle as an indirect object and return an
76 // indirect reference to it. 89 // indirect reference to it.
  90 + DLL_EXPORT
77 QPDFObjectHandle makeIndirectObject(QPDFObjectHandle); 91 QPDFObjectHandle makeIndirectObject(QPDFObjectHandle);
78 92
79 // Retrieve an object by object ID and generation. Returns an 93 // Retrieve an object by object ID and generation. Returns an
80 // indirect reference to it. 94 // indirect reference to it.
  95 + DLL_EXPORT
81 QPDFObjectHandle getObjectByID(int objid, int generation); 96 QPDFObjectHandle getObjectByID(int objid, int generation);
82 97
83 // Encryption support 98 // Encryption support
@@ -85,6 +100,7 @@ class QPDF @@ -85,6 +100,7 @@ class QPDF
85 struct EncryptionData 100 struct EncryptionData
86 { 101 {
87 // This class holds data read from the encryption dictionary. 102 // This class holds data read from the encryption dictionary.
  103 + DLL_EXPORT
88 EncryptionData(int V, int R, int Length_bytes, int P, 104 EncryptionData(int V, int R, int Length_bytes, int P,
89 std::string const& O, std::string const& U, 105 std::string const& O, std::string const& U,
90 std::string const& id1) : 106 std::string const& id1) :
@@ -107,28 +123,35 @@ class QPDF @@ -107,28 +123,35 @@ class QPDF
107 std::string id1; 123 std::string id1;
108 }; 124 };
109 125
  126 + DLL_EXPORT
110 static void trim_user_password(std::string& user_password); 127 static void trim_user_password(std::string& user_password);
  128 + DLL_EXPORT
111 static std::string compute_data_key( 129 static std::string compute_data_key(
112 std::string const& encryption_key, int objid, int generation); 130 std::string const& encryption_key, int objid, int generation);
  131 + DLL_EXPORT
113 static std::string compute_encryption_key( 132 static std::string compute_encryption_key(
114 std::string const& password, EncryptionData const& data); 133 std::string const& password, EncryptionData const& data);
115 134
  135 + DLL_EXPORT
116 static void compute_encryption_O_U( 136 static void compute_encryption_O_U(
117 char const* user_password, char const* owner_password, 137 char const* user_password, char const* owner_password,
118 int V, int R, int key_len, int P, 138 int V, int R, int key_len, int P,
119 std::string const& id1, 139 std::string const& id1,
120 std::string& O, std::string& U); 140 std::string& O, std::string& U);
  141 + DLL_EXPORT
121 std::string const& getUserPassword() const; 142 std::string const& getUserPassword() const;
122 143
123 // Linearization support 144 // Linearization support
124 145
125 // Returns true iff the file starts with a linearization parameter 146 // Returns true iff the file starts with a linearization parameter
126 // dictionary. Does no additional validation. 147 // dictionary. Does no additional validation.
  148 + DLL_EXPORT
127 bool isLinearized(); 149 bool isLinearized();
128 150
129 // Performs various sanity checks on a linearized file. Return 151 // Performs various sanity checks on a linearized file. Return
130 // true if no errors or warnings. Otherwise, return false and 152 // true if no errors or warnings. Otherwise, return false and
131 // output errors and warnings to stdout. 153 // output errors and warnings to stdout.
  154 + DLL_EXPORT
132 bool checkLinearization(); 155 bool checkLinearization();
133 156
134 // Calls checkLinearization() and, if possible, prints normalized 157 // Calls checkLinearization() and, if possible, prints normalized
@@ -136,9 +159,11 @@ class QPDF @@ -136,9 +159,11 @@ class QPDF
136 // includes adding min values to delta values and adjusting 159 // includes adding min values to delta values and adjusting
137 // offsets based on the location and size of the primary hint 160 // offsets based on the location and size of the primary hint
138 // stream. 161 // stream.
  162 + DLL_EXPORT
139 void showLinearizationData(); 163 void showLinearizationData();
140 164
141 // Shows the contents of the cross-reference table 165 // Shows the contents of the cross-reference table
  166 + DLL_EXPORT
142 void showXRefTable(); 167 void showXRefTable();
143 168
144 // Optimization support -- see doc/optimization. Implemented in 169 // Optimization support -- see doc/optimization. Implemented in
@@ -152,26 +177,31 @@ class QPDF @@ -152,26 +177,31 @@ class QPDF
152 // This is available so that the test suite can make sure that a 177 // This is available so that the test suite can make sure that a
153 // linearized file is already optimized. When called in this way, 178 // linearized file is already optimized. When called in this way,
154 // optimize() still populates the object <-> user maps 179 // optimize() still populates the object <-> user maps
  180 + DLL_EXPORT
155 void optimize(std::map<int, int> const& object_stream_data, 181 void optimize(std::map<int, int> const& object_stream_data,
156 bool allow_changes = true); 182 bool allow_changes = true);
157 183
158 // Replace all references to indirect objects that are "scalars" 184 // Replace all references to indirect objects that are "scalars"
159 // (i.e., things that don't have children: not arrays, streams, or 185 // (i.e., things that don't have children: not arrays, streams, or
160 // dictionaries) with direct objects. 186 // dictionaries) with direct objects.
  187 + DLL_EXPORT
161 void flattenScalarReferences(); 188 void flattenScalarReferences();
162 189
163 // Decode all streams, discarding the output. Used to check 190 // Decode all streams, discarding the output. Used to check
164 // correctness of stream encoding. 191 // correctness of stream encoding.
  192 + DLL_EXPORT
165 void decodeStreams(); 193 void decodeStreams();
166 194
167 // For QPDFWriter: 195 // For QPDFWriter:
168 196
169 // Remove /ID, /Encrypt, and /Prev keys from the trailer 197 // Remove /ID, /Encrypt, and /Prev keys from the trailer
170 // dictionary since these are regenerated during write. 198 // dictionary since these are regenerated during write.
  199 + DLL_EXPORT
171 void trimTrailerForWrite(); 200 void trimTrailerForWrite();
172 201
173 // Get lists of all objects in order according to the part of a 202 // Get lists of all objects in order according to the part of a
174 // linearized file that they belong to. 203 // linearized file that they belong to.
  204 + DLL_EXPORT
175 void getLinearizedParts( 205 void getLinearizedParts(
176 std::map<int, int> const& object_stream_data, 206 std::map<int, int> const& object_stream_data,
177 std::vector<QPDFObjectHandle>& part4, 207 std::vector<QPDFObjectHandle>& part4,
@@ -180,6 +210,7 @@ class QPDF @@ -180,6 +210,7 @@ class QPDF
180 std::vector<QPDFObjectHandle>& part8, 210 std::vector<QPDFObjectHandle>& part8,
181 std::vector<QPDFObjectHandle>& part9); 211 std::vector<QPDFObjectHandle>& part9);
182 212
  213 + DLL_EXPORT
183 void generateHintStream(std::map<int, QPDFXRefEntry> const& xref, 214 void generateHintStream(std::map<int, QPDFXRefEntry> const& xref,
184 std::map<int, size_t> const& lengths, 215 std::map<int, size_t> const& lengths,
185 std::map<int, int> const& obj_renumber, 216 std::map<int, int> const& obj_renumber,
@@ -187,15 +218,18 @@ class QPDF @@ -187,15 +218,18 @@ class QPDF
187 int& S, int& O); 218 int& S, int& O);
188 219
189 // Map object to object stream that contains it 220 // Map object to object stream that contains it
  221 + DLL_EXPORT
190 void getObjectStreamData(std::map<int, int>&); 222 void getObjectStreamData(std::map<int, int>&);
191 // Get a list of objects that would be permitted in an object 223 // Get a list of objects that would be permitted in an object
192 // stream 224 // stream
  225 + DLL_EXPORT
193 std::vector<int> getCompressibleObjects(); 226 std::vector<int> getCompressibleObjects();
194 227
195 // Convenience routines for common functions. See also 228 // Convenience routines for common functions. See also
196 // QPDFObjectHandle.hh for additional convenience routines. 229 // QPDFObjectHandle.hh for additional convenience routines.
197 230
198 // Traverse page tree return all /Page objects. 231 // Traverse page tree return all /Page objects.
  232 + DLL_EXPORT
199 std::vector<QPDFObjectHandle> const& getAllPages(); 233 std::vector<QPDFObjectHandle> const& getAllPages();
200 234
201 // Resolver class is restricted to QPDFObjectHandle so that only 235 // Resolver class is restricted to QPDFObjectHandle so that only
include/qpdf/QPDFExc.hh
@@ -13,9 +13,12 @@ @@ -13,9 +13,12 @@
13 class QPDFExc: public QEXC::General 13 class QPDFExc: public QEXC::General
14 { 14 {
15 public: 15 public:
  16 + DLL_EXPORT
16 QPDFExc(std::string const& message); 17 QPDFExc(std::string const& message);
  18 + DLL_EXPORT
17 QPDFExc(std::string const& filename, int offset, 19 QPDFExc(std::string const& filename, int offset,
18 std::string const& message); 20 std::string const& message);
  21 + DLL_EXPORT
19 virtual ~QPDFExc() throw (); 22 virtual ~QPDFExc() throw ();
20 }; 23 };
21 24
include/qpdf/QPDFObject.hh
@@ -8,12 +8,16 @@ @@ -8,12 +8,16 @@
8 #ifndef __QPDFOBJECT_HH__ 8 #ifndef __QPDFOBJECT_HH__
9 #define __QPDFOBJECT_HH__ 9 #define __QPDFOBJECT_HH__
10 10
  11 +#include <qpdf/DLL.hh>
  12 +
11 #include <string> 13 #include <string>
12 14
13 class QPDFObject 15 class QPDFObject
14 { 16 {
15 public: 17 public:
  18 + DLL_EXPORT
16 virtual ~QPDFObject() {} 19 virtual ~QPDFObject() {}
  20 + DLL_EXPORT
17 virtual std::string unparse() = 0; 21 virtual std::string unparse() = 0;
18 }; 22 };
19 23
include/qpdf/QPDFObjectHandle.hh
@@ -13,6 +13,8 @@ @@ -13,6 +13,8 @@
13 #include <set> 13 #include <set>
14 #include <map> 14 #include <map>
15 15
  16 +#include <qpdf/DLL.hh>
  17 +
16 #include <qpdf/PointerHolder.hh> 18 #include <qpdf/PointerHolder.hh>
17 #include <qpdf/Buffer.hh> 19 #include <qpdf/Buffer.hh>
18 20
@@ -24,37 +26,58 @@ class QPDF; @@ -24,37 +26,58 @@ class QPDF;
24 class QPDFObjectHandle 26 class QPDFObjectHandle
25 { 27 {
26 public: 28 public:
  29 + DLL_EXPORT
27 QPDFObjectHandle(); 30 QPDFObjectHandle();
  31 + DLL_EXPORT
28 bool isInitialized() const; 32 bool isInitialized() const;
29 33
30 // Exactly one of these will return true for any object. 34 // Exactly one of these will return true for any object.
  35 + DLL_EXPORT
31 bool isBool(); 36 bool isBool();
  37 + DLL_EXPORT
32 bool isNull(); 38 bool isNull();
  39 + DLL_EXPORT
33 bool isInteger(); 40 bool isInteger();
  41 + DLL_EXPORT
34 bool isReal(); 42 bool isReal();
  43 + DLL_EXPORT
35 bool isName(); 44 bool isName();
  45 + DLL_EXPORT
36 bool isString(); 46 bool isString();
  47 + DLL_EXPORT
37 bool isArray(); 48 bool isArray();
  49 + DLL_EXPORT
38 bool isDictionary(); 50 bool isDictionary();
  51 + DLL_EXPORT
39 bool isStream(); 52 bool isStream();
40 53
41 // This returns true in addition to the query for the specific 54 // This returns true in addition to the query for the specific
42 // type for indirect objects. 55 // type for indirect objects.
  56 + DLL_EXPORT
43 bool isIndirect(); 57 bool isIndirect();
44 58
45 // True for everything except array, dictionary, and stream 59 // True for everything except array, dictionary, and stream
  60 + DLL_EXPORT
46 bool isScalar(); 61 bool isScalar();
47 62
48 // Public factory methods 63 // Public factory methods
49 64
  65 + DLL_EXPORT
50 static QPDFObjectHandle newNull(); 66 static QPDFObjectHandle newNull();
  67 + DLL_EXPORT
51 static QPDFObjectHandle newBool(bool value); 68 static QPDFObjectHandle newBool(bool value);
  69 + DLL_EXPORT
52 static QPDFObjectHandle newInteger(int value); 70 static QPDFObjectHandle newInteger(int value);
  71 + DLL_EXPORT
53 static QPDFObjectHandle newReal(std::string const& value); 72 static QPDFObjectHandle newReal(std::string const& value);
  73 + DLL_EXPORT
54 static QPDFObjectHandle newName(std::string const& name); 74 static QPDFObjectHandle newName(std::string const& name);
  75 + DLL_EXPORT
55 static QPDFObjectHandle newString(std::string const& str); 76 static QPDFObjectHandle newString(std::string const& str);
  77 + DLL_EXPORT
56 static QPDFObjectHandle newArray( 78 static QPDFObjectHandle newArray(
57 std::vector<QPDFObjectHandle> const& items); 79 std::vector<QPDFObjectHandle> const& items);
  80 + DLL_EXPORT
58 static QPDFObjectHandle newDictionary( 81 static QPDFObjectHandle newDictionary(
59 std::map<std::string, QPDFObjectHandle> const& items); 82 std::map<std::string, QPDFObjectHandle> const& items);
60 83
@@ -63,55 +86,74 @@ class QPDFObjectHandle @@ -63,55 +86,74 @@ class QPDFObjectHandle
63 // type, an exception is thrown. 86 // type, an exception is thrown.
64 87
65 // Methods for bool objects 88 // Methods for bool objects
  89 + DLL_EXPORT
66 bool getBoolValue(); 90 bool getBoolValue();
67 91
68 // Methods for integer objects 92 // Methods for integer objects
  93 + DLL_EXPORT
69 int getIntValue(); 94 int getIntValue();
70 95
71 // Methods for real objects 96 // Methods for real objects
  97 + DLL_EXPORT
72 std::string getRealValue(); 98 std::string getRealValue();
73 99
74 // Methods that work for both integer and real objects 100 // Methods that work for both integer and real objects
  101 + DLL_EXPORT
75 bool isNumber(); 102 bool isNumber();
  103 + DLL_EXPORT
76 double getNumericValue(); 104 double getNumericValue();
77 105
78 // Methods for name objects 106 // Methods for name objects
  107 + DLL_EXPORT
79 std::string getName(); 108 std::string getName();
80 109
81 // Methods for string objects 110 // Methods for string objects
  111 + DLL_EXPORT
82 std::string getStringValue(); 112 std::string getStringValue();
  113 + DLL_EXPORT
83 std::string getUTF8Value(); 114 std::string getUTF8Value();
84 115
85 // Methods for array objects 116 // Methods for array objects
  117 + DLL_EXPORT
86 int getArrayNItems(); 118 int getArrayNItems();
  119 + DLL_EXPORT
87 QPDFObjectHandle getArrayItem(int n); 120 QPDFObjectHandle getArrayItem(int n);
88 121
89 // Methods for dictionary objects 122 // Methods for dictionary objects
  123 + DLL_EXPORT
90 bool hasKey(std::string const&); 124 bool hasKey(std::string const&);
  125 + DLL_EXPORT
91 QPDFObjectHandle getKey(std::string const&); 126 QPDFObjectHandle getKey(std::string const&);
  127 + DLL_EXPORT
92 std::set<std::string> getKeys(); 128 std::set<std::string> getKeys();
93 129
94 // Mutator methods. Use with caution. 130 // Mutator methods. Use with caution.
95 131
96 // Recursively copy this object, making it direct. Throws an 132 // Recursively copy this object, making it direct. Throws an
97 // exception if a loop is detected or any sub-object is a stream. 133 // exception if a loop is detected or any sub-object is a stream.
  134 + DLL_EXPORT
98 void makeDirect(); 135 void makeDirect();
99 136
100 // Mutator methods for array objects 137 // Mutator methods for array objects
  138 + DLL_EXPORT
101 void setArrayItem(int, QPDFObjectHandle const&); 139 void setArrayItem(int, QPDFObjectHandle const&);
102 140
103 // Mutator methods for dictionary objects 141 // Mutator methods for dictionary objects
104 142
105 // Replace value of key, adding it if it does not exist 143 // Replace value of key, adding it if it does not exist
  144 + DLL_EXPORT
106 void replaceKey(std::string const& key, QPDFObjectHandle const&); 145 void replaceKey(std::string const& key, QPDFObjectHandle const&);
107 // Remove key, doing nothing if key does not exist 146 // Remove key, doing nothing if key does not exist
  147 + DLL_EXPORT
108 void removeKey(std::string const& key); 148 void removeKey(std::string const& key);
109 149
110 // Methods for stream objects 150 // Methods for stream objects
  151 + DLL_EXPORT
111 QPDFObjectHandle getDict(); 152 QPDFObjectHandle getDict();
112 153
113 // Returns filtered (uncompressed) stream data. Throws an 154 // Returns filtered (uncompressed) stream data. Throws an
114 // exception if the stream is filtered and we can't decode it. 155 // exception if the stream is filtered and we can't decode it.
  156 + DLL_EXPORT
115 PointerHolder<Buffer> getStreamData(); 157 PointerHolder<Buffer> getStreamData();
116 158
117 // Write stream data through the given pipeline. A null pipeline 159 // Write stream data through the given pipeline. A null pipeline
@@ -131,14 +173,19 @@ class QPDFObjectHandle @@ -131,14 +173,19 @@ class QPDFObjectHandle
131 // value of this function to determine whether or not the /Filter 173 // value of this function to determine whether or not the /Filter
132 // and /DecodeParms keys in the stream dictionary should be 174 // and /DecodeParms keys in the stream dictionary should be
133 // replaced if writing a new stream object. 175 // replaced if writing a new stream object.
  176 + DLL_EXPORT
134 bool pipeStreamData(Pipeline*, bool filter, 177 bool pipeStreamData(Pipeline*, bool filter,
135 bool normalize, bool compress); 178 bool normalize, bool compress);
136 179
137 // return 0 for direct objects 180 // return 0 for direct objects
  181 + DLL_EXPORT
138 int getObjectID() const; 182 int getObjectID() const;
  183 + DLL_EXPORT
139 int getGeneration() const; 184 int getGeneration() const;
140 185
  186 + DLL_EXPORT
141 std::string unparse(); 187 std::string unparse();
  188 + DLL_EXPORT
142 std::string unparseResolved(); 189 std::string unparseResolved();
143 190
144 // Convenience routines for commonly performed functions 191 // Convenience routines for commonly performed functions
@@ -148,6 +195,7 @@ class QPDFObjectHandle @@ -148,6 +195,7 @@ class QPDFObjectHandle
148 // function does not presently support inherited resources. See 195 // function does not presently support inherited resources. See
149 // comment in the source for details. Return value is a map from 196 // comment in the source for details. Return value is a map from
150 // XObject name to the image object, which is always a stream. 197 // XObject name to the image object, which is always a stream.
  198 + DLL_EXPORT
151 std::map<std::string, QPDFObjectHandle> getPageImages(); 199 std::map<std::string, QPDFObjectHandle> getPageImages();
152 200
153 // Throws an exception if this is not a Page object. Returns a 201 // Throws an exception if this is not a Page object. Returns a
@@ -155,6 +203,7 @@ class QPDFObjectHandle @@ -155,6 +203,7 @@ class QPDFObjectHandle
155 // the given page. This routine allows the caller to not care 203 // the given page. This routine allows the caller to not care
156 // whether there are one or more than one content streams for a 204 // whether there are one or more than one content streams for a
157 // page. 205 // page.
  206 + DLL_EXPORT
158 std::vector<QPDFObjectHandle> getPageContents(); 207 std::vector<QPDFObjectHandle> getPageContents();
159 208
160 // Initializers for objects. This Factory class gives the QPDF 209 // Initializers for objects. This Factory class gives the QPDF
include/qpdf/QPDFTokenizer.hh
@@ -8,6 +8,8 @@ @@ -8,6 +8,8 @@
8 #ifndef __QPDFTOKENIZER_HH__ 8 #ifndef __QPDFTOKENIZER_HH__
9 #define __QPDFTOKENIZER_HH__ 9 #define __QPDFTOKENIZER_HH__
10 10
  11 +#include <qpdf/DLL.hh>
  12 +
11 #include <string> 13 #include <string>
12 #include <stdio.h> 14 #include <stdio.h>
13 15
@@ -35,14 +37,17 @@ class QPDFTokenizer @@ -35,14 +37,17 @@ class QPDFTokenizer
35 class Token 37 class Token
36 { 38 {
37 public: 39 public:
  40 + DLL_EXPORT
38 Token() : type(tt_bad) {} 41 Token() : type(tt_bad) {}
39 42
  43 + DLL_EXPORT
40 Token(token_type_e type, std::string const& value) : 44 Token(token_type_e type, std::string const& value) :
41 type(type), 45 type(type),
42 value(value) 46 value(value)
43 { 47 {
44 } 48 }
45 49
  50 + DLL_EXPORT
46 Token(token_type_e type, std::string const& value, 51 Token(token_type_e type, std::string const& value,
47 std::string raw_value, std::string error_message) : 52 std::string raw_value, std::string error_message) :
48 type(type), 53 type(type),
@@ -51,22 +56,27 @@ class QPDFTokenizer @@ -51,22 +56,27 @@ class QPDFTokenizer
51 error_message(error_message) 56 error_message(error_message)
52 { 57 {
53 } 58 }
  59 + DLL_EXPORT
54 token_type_e getType() const 60 token_type_e getType() const
55 { 61 {
56 return this->type; 62 return this->type;
57 } 63 }
  64 + DLL_EXPORT
58 std::string const& getValue() const 65 std::string const& getValue() const
59 { 66 {
60 return this->value; 67 return this->value;
61 } 68 }
  69 + DLL_EXPORT
62 std::string const& getRawValue() const 70 std::string const& getRawValue() const
63 { 71 {
64 return this->raw_value; 72 return this->raw_value;
65 } 73 }
  74 + DLL_EXPORT
66 std::string const& getErrorMessage() const 75 std::string const& getErrorMessage() const
67 { 76 {
68 return this->error_message; 77 return this->error_message;
69 } 78 }
  79 + DLL_EXPORT
70 bool operator==(Token const& rhs) 80 bool operator==(Token const& rhs)
71 { 81 {
72 // Ignore fields other than type and value 82 // Ignore fields other than type and value
@@ -82,6 +92,7 @@ class QPDFTokenizer @@ -82,6 +92,7 @@ class QPDFTokenizer
82 std::string error_message; 92 std::string error_message;
83 }; 93 };
84 94
  95 + DLL_EXPORT
85 QPDFTokenizer(); 96 QPDFTokenizer();
86 97
87 // PDF files with version < 1.2 allowed the pound character 98 // PDF files with version < 1.2 allowed the pound character
@@ -89,6 +100,7 @@ class QPDFTokenizer @@ -89,6 +100,7 @@ class QPDFTokenizer
89 // character was allowed only when followed by two hexadecimal 100 // character was allowed only when followed by two hexadecimal
90 // digits. This method should be called when parsing a PDF file 101 // digits. This method should be called when parsing a PDF file
91 // whose version is older than 1.2. 102 // whose version is older than 1.2.
  103 + DLL_EXPORT
92 void allowPoundAnywhereInName(); 104 void allowPoundAnywhereInName();
93 105
94 // Mode of operation: 106 // Mode of operation:
@@ -99,19 +111,23 @@ class QPDFTokenizer @@ -99,19 +111,23 @@ class QPDFTokenizer
99 111
100 // It these are called when a token is available, an exception 112 // It these are called when a token is available, an exception
101 // will be thrown. 113 // will be thrown.
  114 + DLL_EXPORT
102 void presentCharacter(char ch); 115 void presentCharacter(char ch);
  116 + DLL_EXPORT
103 void presentEOF(); 117 void presentEOF();
104 118
105 // If a token is available, return true and initialize token with 119 // If a token is available, return true and initialize token with
106 // the token, unread_char with whether or not we have to unread 120 // the token, unread_char with whether or not we have to unread
107 // the last character, and if unread_char, ch with the character 121 // the last character, and if unread_char, ch with the character
108 // to unread. 122 // to unread.
  123 + DLL_EXPORT
109 bool getToken(Token& token, bool& unread_char, char& ch); 124 bool getToken(Token& token, bool& unread_char, char& ch);
110 125
111 // This function returns true of the current character is between 126 // This function returns true of the current character is between
112 // tokens (i.e., white space that is not part of a string) or is 127 // tokens (i.e., white space that is not part of a string) or is
113 // part of a comment. A tokenizing filter can call this to 128 // part of a comment. A tokenizing filter can call this to
114 // determine whether to output the character. 129 // determine whether to output the character.
  130 + DLL_EXPORT
115 bool betweenTokens(); 131 bool betweenTokens();
116 132
117 private: 133 private:
include/qpdf/QPDFWriter.hh
@@ -19,6 +19,8 @@ @@ -19,6 +19,8 @@
19 #include <set> 19 #include <set>
20 #include <map> 20 #include <map>
21 21
  22 +#include <qpdf/DLL.hh>
  23 +
22 #include <qpdf/QPDFXRefEntry.hh> 24 #include <qpdf/QPDFXRefEntry.hh>
23 25
24 #include <qpdf/PointerHolder.hh> 26 #include <qpdf/PointerHolder.hh>
@@ -33,7 +35,9 @@ class QPDFWriter @@ -33,7 +35,9 @@ class QPDFWriter
33 { 35 {
34 public: 36 public:
35 // Passing null as filename means write to stdout 37 // Passing null as filename means write to stdout
  38 + DLL_EXPORT
36 QPDFWriter(QPDF& pdf, char const* filename); 39 QPDFWriter(QPDF& pdf, char const* filename);
  40 + DLL_EXPORT
37 ~QPDFWriter(); 41 ~QPDFWriter();
38 42
39 // Set the value of object stream mode. In disable mode, we never 43 // Set the value of object stream mode. In disable mode, we never
@@ -44,6 +48,7 @@ class QPDFWriter @@ -44,6 +48,7 @@ class QPDFWriter
44 // object streams and a cross-reference stream if there are object 48 // object streams and a cross-reference stream if there are object
45 // streams. The default is o_preserve. 49 // streams. The default is o_preserve.
46 enum object_stream_e { o_disable, o_preserve, o_generate }; 50 enum object_stream_e { o_disable, o_preserve, o_generate };
  51 + DLL_EXPORT
47 void setObjectStreamMode(object_stream_e); 52 void setObjectStreamMode(object_stream_e);
48 53
49 // Set value of stream data mode. In uncompress mode, we attempt 54 // Set value of stream data mode. In uncompress mode, we attempt
@@ -52,6 +57,7 @@ class QPDFWriter @@ -52,6 +57,7 @@ class QPDFWriter
52 // if we can apply all filters and the stream is not already 57 // if we can apply all filters and the stream is not already
53 // optimally compressed, recompress the stream. 58 // optimally compressed, recompress the stream.
54 enum stream_data_e { s_uncompress, s_preserve, s_compress }; 59 enum stream_data_e { s_uncompress, s_preserve, s_compress };
  60 + DLL_EXPORT
55 void setStreamDataMode(stream_data_e); 61 void setStreamDataMode(stream_data_e);
56 62
57 // Set value of content stream normalization. The default is 63 // Set value of content stream normalization. The default is
@@ -61,6 +67,7 @@ class QPDFWriter @@ -61,6 +67,7 @@ class QPDFWriter
61 // damage the content stream. This flag should be used only for 67 // damage the content stream. This flag should be used only for
62 // debugging and experimenting with PDF content streams. Never 68 // debugging and experimenting with PDF content streams. Never
63 // use it for production files. 69 // use it for production files.
  70 + DLL_EXPORT
64 void setContentNormalization(bool); 71 void setContentNormalization(bool);
65 72
66 // Set QDF mode. QDF mode causes special "pretty printing" of 73 // Set QDF mode. QDF mode causes special "pretty printing" of
@@ -68,22 +75,26 @@ class QPDFWriter @@ -68,22 +75,26 @@ class QPDFWriter
68 // Resulting PDF files can be edited in a text editor and then run 75 // Resulting PDF files can be edited in a text editor and then run
69 // through fix-qdf to update cross reference tables and stream 76 // through fix-qdf to update cross reference tables and stream
70 // lengths. 77 // lengths.
  78 + DLL_EXPORT
71 void setQDFMode(bool); 79 void setQDFMode(bool);
72 80
73 // Cause a static /ID value to be generated. Use only in test 81 // Cause a static /ID value to be generated. Use only in test
74 // suites. 82 // suites.
  83 + DLL_EXPORT
75 void setStaticID(bool); 84 void setStaticID(bool);
76 85
77 // Suppress inclusion of comments indicating original object IDs 86 // Suppress inclusion of comments indicating original object IDs
78 // when writing QDF files. This can also be useful for testing, 87 // when writing QDF files. This can also be useful for testing,
79 // particularly when using comparison of two qdf files to 88 // particularly when using comparison of two qdf files to
80 // determine whether two PDF files have identical content. 89 // determine whether two PDF files have identical content.
  90 + DLL_EXPORT
81 void setSuppressOriginalObjectIDs(bool); 91 void setSuppressOriginalObjectIDs(bool);
82 92
83 // Preserve encryption. The default is true unless prefilering, 93 // Preserve encryption. The default is true unless prefilering,
84 // content normalization, or qdf mode has been selected in which 94 // content normalization, or qdf mode has been selected in which
85 // case encryption is never preserved. Encryption is also not 95 // case encryption is never preserved. Encryption is also not
86 // preserved if we explicitly set encryption parameters. 96 // preserved if we explicitly set encryption parameters.
  97 + DLL_EXPORT
87 void setPreserveEncryption(bool); 98 void setPreserveEncryption(bool);
88 99
89 // Set up for encrypted output. Disables stream prefiltering and 100 // Set up for encrypted output. Disables stream prefiltering and
@@ -91,6 +102,7 @@ class QPDFWriter @@ -91,6 +102,7 @@ class QPDFWriter
91 // parameters sets the PDF version to at least 1.3, and setting R3 102 // parameters sets the PDF version to at least 1.3, and setting R3
92 // encryption parameters pushes the PDF version number to at least 103 // encryption parameters pushes the PDF version number to at least
93 // 1.4. 104 // 1.4.
  105 + DLL_EXPORT
94 void setR2EncryptionParameters( 106 void setR2EncryptionParameters(
95 char const* user_password, char const* owner_password, 107 char const* user_password, char const* owner_password,
96 bool allow_print, bool allow_modify, 108 bool allow_print, bool allow_modify,
@@ -109,6 +121,7 @@ class QPDFWriter @@ -109,6 +121,7 @@ class QPDFWriter
109 r3m_assembly, // allow only document assembly 121 r3m_assembly, // allow only document assembly
110 r3m_none // allow no modification 122 r3m_none // allow no modification
111 }; 123 };
  124 + DLL_EXPORT
112 void setR3EncryptionParameters( 125 void setR3EncryptionParameters(
113 char const* user_password, char const* owner_password, 126 char const* user_password, char const* owner_password,
114 bool allow_accessibility, bool allow_extract, 127 bool allow_accessibility, bool allow_extract,
@@ -116,8 +129,10 @@ class QPDFWriter @@ -116,8 +129,10 @@ class QPDFWriter
116 129
117 // Create linearized output. Disables qdf mode, content 130 // Create linearized output. Disables qdf mode, content
118 // normalization, and stream prefiltering. 131 // normalization, and stream prefiltering.
  132 + DLL_EXPORT
119 void setLinearization(bool); 133 void setLinearization(bool);
120 134
  135 + DLL_EXPORT
121 void write(); 136 void write();
122 137
123 private: 138 private:
include/qpdf/QPDFXRefEntry.hh
@@ -8,6 +8,8 @@ @@ -8,6 +8,8 @@
8 #ifndef __QPDFXREFENTRY_HH__ 8 #ifndef __QPDFXREFENTRY_HH__
9 #define __QPDFXREFENTRY_HH__ 9 #define __QPDFXREFENTRY_HH__
10 10
  11 +#include <qpdf/DLL.hh>
  12 +
11 class QPDFXRefEntry 13 class QPDFXRefEntry
12 { 14 {
13 public: 15 public:
@@ -17,12 +19,18 @@ class QPDFXRefEntry @@ -17,12 +19,18 @@ class QPDFXRefEntry
17 // 1 = "uncompressed"; field 1 = offset 19 // 1 = "uncompressed"; field 1 = offset
18 // 2 = "compressed"; field 1 = object stream number, field 2 = index 20 // 2 = "compressed"; field 1 = object stream number, field 2 = index
19 21
  22 + DLL_EXPORT
20 QPDFXRefEntry(); 23 QPDFXRefEntry();
  24 + DLL_EXPORT
21 QPDFXRefEntry(int type, int field1, int field2); 25 QPDFXRefEntry(int type, int field1, int field2);
22 26
  27 + DLL_EXPORT
23 int getType() const; 28 int getType() const;
  29 + DLL_EXPORT
24 int getOffset() const; // only for type 1 30 int getOffset() const; // only for type 1
  31 + DLL_EXPORT
25 int getObjStreamNumber() const; // only for type 2 32 int getObjStreamNumber() const; // only for type 2
  33 + DLL_EXPORT
26 int getObjStreamIndex() const; // only for type 2 34 int getObjStreamIndex() const; // only for type 2
27 35
28 private: 36 private:
include/qpdf/QTC.hh
@@ -8,8 +8,11 @@ @@ -8,8 +8,11 @@
8 #ifndef __QTC_HH__ 8 #ifndef __QTC_HH__
9 #define __QTC_HH__ 9 #define __QTC_HH__
10 10
  11 +#include <qpdf/DLL.hh>
  12 +
11 namespace QTC 13 namespace QTC
12 { 14 {
  15 + DLL_EXPORT
13 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);
14 }; 17 };
15 18
include/qpdf/QUtil.hh
@@ -19,35 +19,46 @@ namespace QUtil @@ -19,35 +19,46 @@ 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 std::string int_to_string(int, int length = 0); 23 std::string int_to_string(int, int length = 0);
  24 + DLL_EXPORT
23 std::string double_to_string(double, int decimal_places = 0); 25 std::string double_to_string(double, int decimal_places = 0);
24 26
25 // If status is -1, convert the current value of errno to a 27 // If status is -1, convert the current value of errno to a
26 // QEXC::System exception. Otherwise, return status. 28 // QEXC::System exception. Otherwise, return status.
  29 + DLL_EXPORT
27 int os_wrapper(std::string const& description, int status) 30 int os_wrapper(std::string const& description, int status)
28 throw (QEXC::System); 31 throw (QEXC::System);
29 32
  33 + DLL_EXPORT
30 FILE* fopen_wrapper(std::string const&, FILE*) 34 FILE* fopen_wrapper(std::string const&, FILE*)
31 throw (QEXC::System); 35 throw (QEXC::System);
32 36
  37 + DLL_EXPORT
33 char* copy_string(std::string const&); 38 char* copy_string(std::string const&);
34 39
35 // Set stdin, stdout to binary mode 40 // Set stdin, stdout to binary mode
  41 + DLL_EXPORT
36 void binary_stdout(); 42 void binary_stdout();
  43 + DLL_EXPORT
37 void binary_stdin(); 44 void binary_stdin();
38 45
39 // May modify argv0 46 // May modify argv0
  47 + DLL_EXPORT
40 char* getWhoami(char* argv0); 48 char* getWhoami(char* argv0);
41 49
42 // Get the value of an environment variable in a portable fashion. 50 // Get the value of an environment variable in a portable fashion.
43 // Returns true iff the variable is defined. If `value' is 51 // Returns true iff the variable is defined. If `value' is
44 // non-null, initializes it with the value of the variable. 52 // non-null, initializes it with the value of the variable.
  53 + DLL_EXPORT
45 bool get_env(std::string const& var, std::string* value = 0); 54 bool get_env(std::string const& var, std::string* value = 0);
46 55
  56 + DLL_EXPORT
47 time_t get_current_time(); 57 time_t get_current_time();
48 58
49 // Return a string containing the byte representation of the UTF-8 59 // Return a string containing the byte representation of the UTF-8
50 // encoding for the unicode value passed in. 60 // encoding for the unicode value passed in.
  61 + DLL_EXPORT
51 std::string toUTF8(unsigned long uval); 62 std::string toUTF8(unsigned long uval);
52 }; 63 };
53 64
libqpdf/Buffer.cc
@@ -3,22 +3,26 @@ @@ -3,22 +3,26 @@
3 3
4 #include <string.h> 4 #include <string.h>
5 5
  6 +DLL_EXPORT
6 Buffer::Buffer() 7 Buffer::Buffer()
7 { 8 {
8 init(0); 9 init(0);
9 } 10 }
10 11
  12 +DLL_EXPORT
11 Buffer::Buffer(unsigned long size) 13 Buffer::Buffer(unsigned long size)
12 { 14 {
13 init(size); 15 init(size);
14 } 16 }
15 17
  18 +DLL_EXPORT
16 Buffer::Buffer(Buffer const& rhs) 19 Buffer::Buffer(Buffer const& rhs)
17 { 20 {
18 init(0); 21 init(0);
19 copy(rhs); 22 copy(rhs);
20 } 23 }
21 24
  25 +DLL_EXPORT
22 Buffer& 26 Buffer&
23 Buffer::operator=(Buffer const& rhs) 27 Buffer::operator=(Buffer const& rhs)
24 { 28 {
@@ -26,6 +30,7 @@ Buffer::operator=(Buffer const&amp; rhs) @@ -26,6 +30,7 @@ Buffer::operator=(Buffer const&amp; rhs)
26 return *this; 30 return *this;
27 } 31 }
28 32
  33 +DLL_EXPORT
29 Buffer::~Buffer() 34 Buffer::~Buffer()
30 { 35 {
31 destroy(); 36 destroy();
@@ -60,18 +65,21 @@ Buffer::destroy() @@ -60,18 +65,21 @@ Buffer::destroy()
60 this->buf = 0; 65 this->buf = 0;
61 } 66 }
62 67
  68 +DLL_EXPORT
63 unsigned long 69 unsigned long
64 Buffer::getSize() const 70 Buffer::getSize() const
65 { 71 {
66 return this->size; 72 return this->size;
67 } 73 }
68 74
  75 +DLL_EXPORT
69 unsigned char const* 76 unsigned char const*
70 Buffer::getBuffer() const 77 Buffer::getBuffer() const
71 { 78 {
72 return this->buf; 79 return this->buf;
73 } 80 }
74 81
  82 +DLL_EXPORT
75 unsigned char* 83 unsigned char*
76 Buffer::getBuffer() 84 Buffer::getBuffer()
77 { 85 {
libqpdf/Pipeline.cc
@@ -2,12 +2,14 @@ @@ -2,12 +2,14 @@
2 2
3 #include <qpdf/Pipeline.hh> 3 #include <qpdf/Pipeline.hh>
4 4
  5 +DLL_EXPORT
5 Pipeline::Pipeline(char const* identifier, Pipeline* next) : 6 Pipeline::Pipeline(char const* identifier, Pipeline* next) :
6 identifier(identifier), 7 identifier(identifier),
7 next(next) 8 next(next)
8 { 9 {
9 } 10 }
10 11
  12 +DLL_EXPORT
11 Pipeline::~Pipeline() 13 Pipeline::~Pipeline()
12 { 14 {
13 } 15 }
libqpdf/Pl_Count.cc
1 1
2 #include <qpdf/Pl_Count.hh> 2 #include <qpdf/Pl_Count.hh>
3 3
  4 +DLL_EXPORT
4 Pl_Count::Pl_Count(char const* identifier, Pipeline* next) : 5 Pl_Count::Pl_Count(char const* identifier, Pipeline* next) :
5 Pipeline(identifier, next), 6 Pipeline(identifier, next),
6 count(0), 7 count(0),
@@ -8,10 +9,12 @@ Pl_Count::Pl_Count(char const* identifier, Pipeline* next) : @@ -8,10 +9,12 @@ Pl_Count::Pl_Count(char const* identifier, Pipeline* next) :
8 { 9 {
9 } 10 }
10 11
  12 +DLL_EXPORT
11 Pl_Count::~Pl_Count() 13 Pl_Count::~Pl_Count()
12 { 14 {
13 } 15 }
14 16
  17 +DLL_EXPORT
15 void 18 void
16 Pl_Count::write(unsigned char* buf, int len) 19 Pl_Count::write(unsigned char* buf, int len)
17 { 20 {
@@ -23,18 +26,21 @@ Pl_Count::write(unsigned char* buf, int len) @@ -23,18 +26,21 @@ Pl_Count::write(unsigned char* buf, int len)
23 } 26 }
24 } 27 }
25 28
  29 +DLL_EXPORT
26 void 30 void
27 Pl_Count::finish() 31 Pl_Count::finish()
28 { 32 {
29 getNext()->finish(); 33 getNext()->finish();
30 } 34 }
31 35
  36 +DLL_EXPORT
32 int 37 int
33 Pl_Count::getCount() const 38 Pl_Count::getCount() const
34 { 39 {
35 return this->count; 40 return this->count;
36 } 41 }
37 42
  43 +DLL_EXPORT
38 unsigned char 44 unsigned char
39 Pl_Count::getLastChar() const 45 Pl_Count::getLastChar() const
40 { 46 {
libqpdf/Pl_Discard.cc
@@ -3,20 +3,24 @@ @@ -3,20 +3,24 @@
3 3
4 // Exercised in md5 test suite 4 // Exercised in md5 test suite
5 5
  6 +DLL_EXPORT
6 Pl_Discard::Pl_Discard() : 7 Pl_Discard::Pl_Discard() :
7 Pipeline("discard", 0) 8 Pipeline("discard", 0)
8 { 9 {
9 } 10 }
10 11
  12 +DLL_EXPORT
11 Pl_Discard::~Pl_Discard() 13 Pl_Discard::~Pl_Discard()
12 { 14 {
13 } 15 }
14 16
  17 +DLL_EXPORT
15 void 18 void
16 Pl_Discard::write(unsigned char* buf, int len) 19 Pl_Discard::write(unsigned char* buf, int len)
17 { 20 {
18 } 21 }
19 22
  23 +DLL_EXPORT
20 void 24 void
21 Pl_Discard::finish() 25 Pl_Discard::finish()
22 { 26 {
libqpdf/Pl_Flate.cc
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 3
4 #include <qpdf/QUtil.hh> 4 #include <qpdf/QUtil.hh>
5 5
  6 +DLL_EXPORT
6 Pl_Flate::Pl_Flate(char const* identifier, Pipeline* next, 7 Pl_Flate::Pl_Flate(char const* identifier, Pipeline* next,
7 action_e action, int out_bufsize) : 8 action_e action, int out_bufsize) :
8 Pipeline(identifier, next), 9 Pipeline(identifier, next),
@@ -21,6 +22,7 @@ Pl_Flate::Pl_Flate(char const* identifier, Pipeline* next, @@ -21,6 +22,7 @@ Pl_Flate::Pl_Flate(char const* identifier, Pipeline* next,
21 zstream.avail_out = out_bufsize; 22 zstream.avail_out = out_bufsize;
22 } 23 }
23 24
  25 +DLL_EXPORT
24 Pl_Flate::~Pl_Flate() 26 Pl_Flate::~Pl_Flate()
25 { 27 {
26 if (this->outbuf) 28 if (this->outbuf)
@@ -30,6 +32,7 @@ Pl_Flate::~Pl_Flate() @@ -30,6 +32,7 @@ Pl_Flate::~Pl_Flate()
30 } 32 }
31 } 33 }
32 34
  35 +DLL_EXPORT
33 void 36 void
34 Pl_Flate::write(unsigned char* data, int len) 37 Pl_Flate::write(unsigned char* data, int len)
35 { 38 {
@@ -117,6 +120,7 @@ Pl_Flate::handleData(unsigned char* data, int len, int flush) @@ -117,6 +120,7 @@ Pl_Flate::handleData(unsigned char* data, int len, int flush)
117 } 120 }
118 } 121 }
119 122
  123 +DLL_EXPORT
120 void 124 void
121 Pl_Flate::finish() 125 Pl_Flate::finish()
122 { 126 {
libqpdf/Pl_StdioFile.cc
@@ -3,16 +3,19 @@ @@ -3,16 +3,19 @@
3 3
4 #include <errno.h> 4 #include <errno.h>
5 5
  6 +DLL_EXPORT
6 Pl_StdioFile::Pl_StdioFile(char const* identifier, FILE* f) : 7 Pl_StdioFile::Pl_StdioFile(char const* identifier, FILE* f) :
7 Pipeline(identifier, 0), 8 Pipeline(identifier, 0),
8 file(f) 9 file(f)
9 { 10 {
10 } 11 }
11 12
  13 +DLL_EXPORT
12 Pl_StdioFile::~Pl_StdioFile() 14 Pl_StdioFile::~Pl_StdioFile()
13 { 15 {
14 } 16 }
15 17
  18 +DLL_EXPORT
16 void 19 void
17 Pl_StdioFile::write(unsigned char* buf, int len) 20 Pl_StdioFile::write(unsigned char* buf, int len)
18 { 21 {
@@ -33,6 +36,7 @@ Pl_StdioFile::write(unsigned char* buf, int len) @@ -33,6 +36,7 @@ Pl_StdioFile::write(unsigned char* buf, int len)
33 } 36 }
34 } 37 }
35 38
  39 +DLL_EXPORT
36 void 40 void
37 Pl_StdioFile::finish() 41 Pl_StdioFile::finish()
38 { 42 {
libqpdf/QEXC.cc
@@ -3,29 +3,34 @@ @@ -3,29 +3,34 @@
3 #include <string.h> 3 #include <string.h>
4 #include <errno.h> 4 #include <errno.h>
5 5
  6 +DLL_EXPORT
6 QEXC::Base::Base() 7 QEXC::Base::Base()
7 { 8 {
8 // nothing needed 9 // nothing needed
9 } 10 }
10 11
  12 +DLL_EXPORT
11 QEXC::Base::Base(std::string const& message) : 13 QEXC::Base::Base(std::string const& message) :
12 message(message) 14 message(message)
13 { 15 {
14 // nothing needed 16 // nothing needed
15 } 17 }
16 18
  19 +DLL_EXPORT
17 std::string const& 20 std::string const&
18 QEXC::Base::unparse() const 21 QEXC::Base::unparse() const
19 { 22 {
20 return this->message; 23 return this->message;
21 } 24 }
22 25
  26 +DLL_EXPORT
23 void 27 void
24 QEXC::Base::setMessage(std::string const& message) 28 QEXC::Base::setMessage(std::string const& message)
25 { 29 {
26 this->message = message; 30 this->message = message;
27 } 31 }
28 32
  33 +DLL_EXPORT
29 const char* 34 const char*
30 QEXC::Base::what() const throw() 35 QEXC::Base::what() const throw()
31 { 36 {
@@ -36,17 +41,20 @@ QEXC::Base::what() const throw() @@ -36,17 +41,20 @@ QEXC::Base::what() const throw()
36 return this->unparse().c_str(); 41 return this->unparse().c_str();
37 } 42 }
38 43
  44 +DLL_EXPORT
39 QEXC::General::General() 45 QEXC::General::General()
40 { 46 {
41 // nothing needed 47 // nothing needed
42 } 48 }
43 49
  50 +DLL_EXPORT
44 QEXC::General::General(std::string const& message) : 51 QEXC::General::General(std::string const& message) :
45 Base(message) 52 Base(message)
46 { 53 {
47 // nothing needed 54 // nothing needed
48 } 55 }
49 56
  57 +DLL_EXPORT
50 QEXC::System::System(std::string const& prefix, int sys_errno) 58 QEXC::System::System(std::string const& prefix, int sys_errno)
51 { 59 {
52 // Note: using sys_errno in case errno is a macro. 60 // Note: using sys_errno in case errno is a macro.
@@ -54,12 +62,14 @@ QEXC::System::System(std::string const&amp; prefix, int sys_errno) @@ -54,12 +62,14 @@ QEXC::System::System(std::string const&amp; prefix, int sys_errno)
54 this->setMessage(prefix + ": " + strerror(sys_errno)); 62 this->setMessage(prefix + ": " + strerror(sys_errno));
55 } 63 }
56 64
  65 +DLL_EXPORT
57 int 66 int
58 QEXC::System::getErrno() const 67 QEXC::System::getErrno() const
59 { 68 {
60 return this->sys_errno; 69 return this->sys_errno;
61 } 70 }
62 71
  72 +DLL_EXPORT
63 QEXC::Internal::Internal(std::string const& message) : 73 QEXC::Internal::Internal(std::string const& message) :
64 Base("INTERNAL ERROR: " + message) 74 Base("INTERNAL ERROR: " + message)
65 { 75 {
libqpdf/QPDF.cc
@@ -247,6 +247,7 @@ QPDF::ObjGen::operator&lt;(ObjGen const&amp; rhs) const @@ -247,6 +247,7 @@ QPDF::ObjGen::operator&lt;(ObjGen const&amp; rhs) const
247 ((this->obj == rhs.obj) && (this->gen < rhs.gen))); 247 ((this->obj == rhs.obj) && (this->gen < rhs.gen)));
248 } 248 }
249 249
  250 +DLL_EXPORT
250 QPDF::QPDF() : 251 QPDF::QPDF() :
251 encrypted(false), 252 encrypted(false),
252 encryption_initialized(false), 253 encryption_initialized(false),
@@ -260,10 +261,12 @@ QPDF::QPDF() : @@ -260,10 +261,12 @@ QPDF::QPDF() :
260 { 261 {
261 } 262 }
262 263
  264 +DLL_EXPORT
263 QPDF::~QPDF() 265 QPDF::~QPDF()
264 { 266 {
265 } 267 }
266 268
  269 +DLL_EXPORT
267 void 270 void
268 QPDF::processFile(char const* filename, char const* password) 271 QPDF::processFile(char const* filename, char const* password)
269 { 272 {
@@ -272,24 +275,28 @@ QPDF::processFile(char const* filename, char const* password) @@ -272,24 +275,28 @@ QPDF::processFile(char const* filename, char const* password)
272 parse(); 275 parse();
273 } 276 }
274 277
  278 +DLL_EXPORT
275 void 279 void
276 QPDF::setIgnoreXRefStreams(bool val) 280 QPDF::setIgnoreXRefStreams(bool val)
277 { 281 {
278 this->ignore_xref_streams = val; 282 this->ignore_xref_streams = val;
279 } 283 }
280 284
  285 +DLL_EXPORT
281 void 286 void
282 QPDF::setSuppressWarnings(bool val) 287 QPDF::setSuppressWarnings(bool val)
283 { 288 {
284 this->suppress_warnings = val; 289 this->suppress_warnings = val;
285 } 290 }
286 291
  292 +DLL_EXPORT
287 void 293 void
288 QPDF::setAttemptRecovery(bool val) 294 QPDF::setAttemptRecovery(bool val)
289 { 295 {
290 this->attempt_recovery = val; 296 this->attempt_recovery = val;
291 } 297 }
292 298
  299 +DLL_EXPORT
293 std::vector<std::string> 300 std::vector<std::string>
294 QPDF::getWarnings() 301 QPDF::getWarnings()
295 { 302 {
@@ -926,6 +933,7 @@ QPDF::insertXrefEntry(int obj, int f0, int f1, int f2, bool overwrite) @@ -926,6 +933,7 @@ QPDF::insertXrefEntry(int obj, int f0, int f1, int f2, bool overwrite)
926 } 933 }
927 } 934 }
928 935
  936 +DLL_EXPORT
929 void 937 void
930 QPDF::showXRefTable() 938 QPDF::showXRefTable()
931 { 939 {
@@ -1610,6 +1618,7 @@ QPDF::resolveObjectsInStream(int obj_stream_number) @@ -1610,6 +1618,7 @@ QPDF::resolveObjectsInStream(int obj_stream_number)
1610 } 1618 }
1611 } 1619 }
1612 1620
  1621 +DLL_EXPORT
1613 QPDFObjectHandle 1622 QPDFObjectHandle
1614 QPDF::makeIndirectObject(QPDFObjectHandle oh) 1623 QPDF::makeIndirectObject(QPDFObjectHandle oh)
1615 { 1624 {
@@ -1624,12 +1633,14 @@ QPDF::makeIndirectObject(QPDFObjectHandle oh) @@ -1624,12 +1633,14 @@ QPDF::makeIndirectObject(QPDFObjectHandle oh)
1624 return QPDFObjectHandle::Factory::newIndirect(this, next.obj, next.gen); 1633 return QPDFObjectHandle::Factory::newIndirect(this, next.obj, next.gen);
1625 } 1634 }
1626 1635
  1636 +DLL_EXPORT
1627 QPDFObjectHandle 1637 QPDFObjectHandle
1628 QPDF::getObjectByID(int objid, int generation) 1638 QPDF::getObjectByID(int objid, int generation)
1629 { 1639 {
1630 return QPDFObjectHandle::Factory::newIndirect(this, objid, generation); 1640 return QPDFObjectHandle::Factory::newIndirect(this, objid, generation);
1631 } 1641 }
1632 1642
  1643 +DLL_EXPORT
1633 void 1644 void
1634 QPDF::trimTrailerForWrite() 1645 QPDF::trimTrailerForWrite()
1635 { 1646 {
@@ -1652,30 +1663,35 @@ QPDF::trimTrailerForWrite() @@ -1652,30 +1663,35 @@ QPDF::trimTrailerForWrite()
1652 this->trailer.removeKey("/XRefStm"); 1663 this->trailer.removeKey("/XRefStm");
1653 } 1664 }
1654 1665
  1666 +DLL_EXPORT
1655 std::string 1667 std::string
1656 QPDF::getFilename() const 1668 QPDF::getFilename() const
1657 { 1669 {
1658 return this->file.getName(); 1670 return this->file.getName();
1659 } 1671 }
1660 1672
  1673 +DLL_EXPORT
1661 std::string 1674 std::string
1662 QPDF::getPDFVersion() const 1675 QPDF::getPDFVersion() const
1663 { 1676 {
1664 return this->pdf_version; 1677 return this->pdf_version;
1665 } 1678 }
1666 1679
  1680 +DLL_EXPORT
1667 QPDFObjectHandle 1681 QPDFObjectHandle
1668 QPDF::getTrailer() 1682 QPDF::getTrailer()
1669 { 1683 {
1670 return this->trailer; 1684 return this->trailer;
1671 } 1685 }
1672 1686
  1687 +DLL_EXPORT
1673 QPDFObjectHandle 1688 QPDFObjectHandle
1674 QPDF::getRoot() 1689 QPDF::getRoot()
1675 { 1690 {
1676 return this->trailer.getKey("/Root"); 1691 return this->trailer.getKey("/Root");
1677 } 1692 }
1678 1693
  1694 +DLL_EXPORT
1679 void 1695 void
1680 QPDF::getObjectStreamData(std::map<int, int>& omap) 1696 QPDF::getObjectStreamData(std::map<int, int>& omap)
1681 { 1697 {
@@ -1692,6 +1708,7 @@ QPDF::getObjectStreamData(std::map&lt;int, int&gt;&amp; omap) @@ -1692,6 +1708,7 @@ QPDF::getObjectStreamData(std::map&lt;int, int&gt;&amp; omap)
1692 } 1708 }
1693 } 1709 }
1694 1710
  1711 +DLL_EXPORT
1695 std::vector<int> 1712 std::vector<int>
1696 QPDF::getCompressibleObjects() 1713 QPDF::getCompressibleObjects()
1697 { 1714 {
@@ -1840,6 +1857,7 @@ QPDF::pipeStreamData(int objid, int generation, @@ -1840,6 +1857,7 @@ QPDF::pipeStreamData(int objid, int generation,
1840 pipeline->finish(); 1857 pipeline->finish();
1841 } 1858 }
1842 1859
  1860 +DLL_EXPORT
1843 void 1861 void
1844 QPDF::decodeStreams() 1862 QPDF::decodeStreams()
1845 { 1863 {
@@ -1857,6 +1875,7 @@ QPDF::decodeStreams() @@ -1857,6 +1875,7 @@ QPDF::decodeStreams()
1857 } 1875 }
1858 } 1876 }
1859 1877
  1878 +DLL_EXPORT
1860 std::vector<QPDFObjectHandle> const& 1879 std::vector<QPDFObjectHandle> const&
1861 QPDF::getAllPages() 1880 QPDF::getAllPages()
1862 { 1881 {
libqpdf/QPDFExc.cc
@@ -3,11 +3,13 @@ @@ -3,11 +3,13 @@
3 3
4 #include <qpdf/QUtil.hh> 4 #include <qpdf/QUtil.hh>
5 5
  6 +DLL_EXPORT
6 QPDFExc::QPDFExc(std::string const& message) : 7 QPDFExc::QPDFExc(std::string const& message) :
7 QEXC::General(message) 8 QEXC::General(message)
8 { 9 {
9 } 10 }
10 11
  12 +DLL_EXPORT
11 QPDFExc::QPDFExc(std::string const& filename, int offset, 13 QPDFExc::QPDFExc(std::string const& filename, int offset,
12 std::string const& message) : 14 std::string const& message) :
13 QEXC::General(filename + ": offset " + QUtil::int_to_string(offset) + 15 QEXC::General(filename + ": offset " + QUtil::int_to_string(offset) +
@@ -15,6 +17,7 @@ QPDFExc::QPDFExc(std::string const&amp; filename, int offset, @@ -15,6 +17,7 @@ QPDFExc::QPDFExc(std::string const&amp; filename, int offset,
15 { 17 {
16 } 18 }
17 19
  20 +DLL_EXPORT
18 QPDFExc::~QPDFExc() throw () 21 QPDFExc::~QPDFExc() throw ()
19 { 22 {
20 } 23 }
libqpdf/QPDFObjectHandle.cc
@@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
18 18
19 #include <stdlib.h> 19 #include <stdlib.h>
20 20
  21 +DLL_EXPORT
21 QPDFObjectHandle::QPDFObjectHandle() : 22 QPDFObjectHandle::QPDFObjectHandle() :
22 initialized(false), 23 initialized(false),
23 objid(0), 24 objid(0),
@@ -42,6 +43,7 @@ QPDFObjectHandle::QPDFObjectHandle(QPDFObject* data) : @@ -42,6 +43,7 @@ QPDFObjectHandle::QPDFObjectHandle(QPDFObject* data) :
42 { 43 {
43 } 44 }
44 45
  46 +DLL_EXPORT
45 bool 47 bool
46 QPDFObjectHandle::isInitialized() const 48 QPDFObjectHandle::isInitialized() const
47 { 49 {
@@ -58,6 +60,7 @@ class QPDFObjectTypeAccessor @@ -58,6 +60,7 @@ class QPDFObjectTypeAccessor
58 } 60 }
59 }; 61 };
60 62
  63 +DLL_EXPORT
61 bool 64 bool
62 QPDFObjectHandle::isBool() 65 QPDFObjectHandle::isBool()
63 { 66 {
@@ -65,6 +68,7 @@ QPDFObjectHandle::isBool() @@ -65,6 +68,7 @@ QPDFObjectHandle::isBool()
65 return QPDFObjectTypeAccessor<QPDF_Bool>::check(obj.getPointer()); 68 return QPDFObjectTypeAccessor<QPDF_Bool>::check(obj.getPointer());
66 } 69 }
67 70
  71 +DLL_EXPORT
68 bool 72 bool
69 QPDFObjectHandle::isNull() 73 QPDFObjectHandle::isNull()
70 { 74 {
@@ -72,6 +76,7 @@ QPDFObjectHandle::isNull() @@ -72,6 +76,7 @@ QPDFObjectHandle::isNull()
72 return QPDFObjectTypeAccessor<QPDF_Null>::check(obj.getPointer()); 76 return QPDFObjectTypeAccessor<QPDF_Null>::check(obj.getPointer());
73 } 77 }
74 78
  79 +DLL_EXPORT
75 bool 80 bool
76 QPDFObjectHandle::isInteger() 81 QPDFObjectHandle::isInteger()
77 { 82 {
@@ -79,6 +84,7 @@ QPDFObjectHandle::isInteger() @@ -79,6 +84,7 @@ QPDFObjectHandle::isInteger()
79 return QPDFObjectTypeAccessor<QPDF_Integer>::check(obj.getPointer()); 84 return QPDFObjectTypeAccessor<QPDF_Integer>::check(obj.getPointer());
80 } 85 }
81 86
  87 +DLL_EXPORT
82 bool 88 bool
83 QPDFObjectHandle::isReal() 89 QPDFObjectHandle::isReal()
84 { 90 {
@@ -86,12 +92,14 @@ QPDFObjectHandle::isReal() @@ -86,12 +92,14 @@ QPDFObjectHandle::isReal()
86 return QPDFObjectTypeAccessor<QPDF_Real>::check(obj.getPointer()); 92 return QPDFObjectTypeAccessor<QPDF_Real>::check(obj.getPointer());
87 } 93 }
88 94
  95 +DLL_EXPORT
89 bool 96 bool
90 QPDFObjectHandle::isNumber() 97 QPDFObjectHandle::isNumber()
91 { 98 {
92 return (isInteger() || isReal()); 99 return (isInteger() || isReal());
93 } 100 }
94 101
  102 +DLL_EXPORT
95 double 103 double
96 QPDFObjectHandle::getNumericValue() 104 QPDFObjectHandle::getNumericValue()
97 { 105 {
@@ -111,6 +119,7 @@ QPDFObjectHandle::getNumericValue() @@ -111,6 +119,7 @@ QPDFObjectHandle::getNumericValue()
111 return result; 119 return result;
112 } 120 }
113 121
  122 +DLL_EXPORT
114 bool 123 bool
115 QPDFObjectHandle::isName() 124 QPDFObjectHandle::isName()
116 { 125 {
@@ -118,6 +127,7 @@ QPDFObjectHandle::isName() @@ -118,6 +127,7 @@ QPDFObjectHandle::isName()
118 return QPDFObjectTypeAccessor<QPDF_Name>::check(obj.getPointer()); 127 return QPDFObjectTypeAccessor<QPDF_Name>::check(obj.getPointer());
119 } 128 }
120 129
  130 +DLL_EXPORT
121 bool 131 bool
122 QPDFObjectHandle::isString() 132 QPDFObjectHandle::isString()
123 { 133 {
@@ -125,6 +135,7 @@ QPDFObjectHandle::isString() @@ -125,6 +135,7 @@ QPDFObjectHandle::isString()
125 return QPDFObjectTypeAccessor<QPDF_String>::check(obj.getPointer()); 135 return QPDFObjectTypeAccessor<QPDF_String>::check(obj.getPointer());
126 } 136 }
127 137
  138 +DLL_EXPORT
128 bool 139 bool
129 QPDFObjectHandle::isArray() 140 QPDFObjectHandle::isArray()
130 { 141 {
@@ -132,6 +143,7 @@ QPDFObjectHandle::isArray() @@ -132,6 +143,7 @@ QPDFObjectHandle::isArray()
132 return QPDFObjectTypeAccessor<QPDF_Array>::check(obj.getPointer()); 143 return QPDFObjectTypeAccessor<QPDF_Array>::check(obj.getPointer());
133 } 144 }
134 145
  146 +DLL_EXPORT
135 bool 147 bool
136 QPDFObjectHandle::isDictionary() 148 QPDFObjectHandle::isDictionary()
137 { 149 {
@@ -139,6 +151,7 @@ QPDFObjectHandle::isDictionary() @@ -139,6 +151,7 @@ QPDFObjectHandle::isDictionary()
139 return QPDFObjectTypeAccessor<QPDF_Dictionary>::check(obj.getPointer()); 151 return QPDFObjectTypeAccessor<QPDF_Dictionary>::check(obj.getPointer());
140 } 152 }
141 153
  154 +DLL_EXPORT
142 bool 155 bool
143 QPDFObjectHandle::isStream() 156 QPDFObjectHandle::isStream()
144 { 157 {
@@ -146,6 +159,7 @@ QPDFObjectHandle::isStream() @@ -146,6 +159,7 @@ QPDFObjectHandle::isStream()
146 return QPDFObjectTypeAccessor<QPDF_Stream>::check(obj.getPointer()); 159 return QPDFObjectTypeAccessor<QPDF_Stream>::check(obj.getPointer());
147 } 160 }
148 161
  162 +DLL_EXPORT
149 bool 163 bool
150 QPDFObjectHandle::isIndirect() 164 QPDFObjectHandle::isIndirect()
151 { 165 {
@@ -153,6 +167,7 @@ QPDFObjectHandle::isIndirect() @@ -153,6 +167,7 @@ QPDFObjectHandle::isIndirect()
153 return (this->objid != 0); 167 return (this->objid != 0);
154 } 168 }
155 169
  170 +DLL_EXPORT
156 bool 171 bool
157 QPDFObjectHandle::isScalar() 172 QPDFObjectHandle::isScalar()
158 { 173 {
@@ -161,6 +176,7 @@ QPDFObjectHandle::isScalar() @@ -161,6 +176,7 @@ QPDFObjectHandle::isScalar()
161 176
162 // Bool accessors 177 // Bool accessors
163 178
  179 +DLL_EXPORT
164 bool 180 bool
165 QPDFObjectHandle::getBoolValue() 181 QPDFObjectHandle::getBoolValue()
166 { 182 {
@@ -170,6 +186,7 @@ QPDFObjectHandle::getBoolValue() @@ -170,6 +186,7 @@ QPDFObjectHandle::getBoolValue()
170 186
171 // Integer accessors 187 // Integer accessors
172 188
  189 +DLL_EXPORT
173 int 190 int
174 QPDFObjectHandle::getIntValue() 191 QPDFObjectHandle::getIntValue()
175 { 192 {
@@ -179,6 +196,7 @@ QPDFObjectHandle::getIntValue() @@ -179,6 +196,7 @@ QPDFObjectHandle::getIntValue()
179 196
180 // Real accessors 197 // Real accessors
181 198
  199 +DLL_EXPORT
182 std::string 200 std::string
183 QPDFObjectHandle::getRealValue() 201 QPDFObjectHandle::getRealValue()
184 { 202 {
@@ -188,6 +206,7 @@ QPDFObjectHandle::getRealValue() @@ -188,6 +206,7 @@ QPDFObjectHandle::getRealValue()
188 206
189 // Name accessors 207 // Name accessors
190 208
  209 +DLL_EXPORT
191 std::string 210 std::string
192 QPDFObjectHandle::getName() 211 QPDFObjectHandle::getName()
193 { 212 {
@@ -197,6 +216,7 @@ QPDFObjectHandle::getName() @@ -197,6 +216,7 @@ QPDFObjectHandle::getName()
197 216
198 // String accessors 217 // String accessors
199 218
  219 +DLL_EXPORT
200 std::string 220 std::string
201 QPDFObjectHandle::getStringValue() 221 QPDFObjectHandle::getStringValue()
202 { 222 {
@@ -204,6 +224,7 @@ QPDFObjectHandle::getStringValue() @@ -204,6 +224,7 @@ QPDFObjectHandle::getStringValue()
204 return dynamic_cast<QPDF_String*>(obj.getPointer())->getVal(); 224 return dynamic_cast<QPDF_String*>(obj.getPointer())->getVal();
205 } 225 }
206 226
  227 +DLL_EXPORT
207 std::string 228 std::string
208 QPDFObjectHandle::getUTF8Value() 229 QPDFObjectHandle::getUTF8Value()
209 { 230 {
@@ -213,6 +234,7 @@ QPDFObjectHandle::getUTF8Value() @@ -213,6 +234,7 @@ QPDFObjectHandle::getUTF8Value()
213 234
214 // Array accessors 235 // Array accessors
215 236
  237 +DLL_EXPORT
216 int 238 int
217 QPDFObjectHandle::getArrayNItems() 239 QPDFObjectHandle::getArrayNItems()
218 { 240 {
@@ -220,6 +242,7 @@ QPDFObjectHandle::getArrayNItems() @@ -220,6 +242,7 @@ QPDFObjectHandle::getArrayNItems()
220 return dynamic_cast<QPDF_Array*>(obj.getPointer())->getNItems(); 242 return dynamic_cast<QPDF_Array*>(obj.getPointer())->getNItems();
221 } 243 }
222 244
  245 +DLL_EXPORT
223 QPDFObjectHandle 246 QPDFObjectHandle
224 QPDFObjectHandle::getArrayItem(int n) 247 QPDFObjectHandle::getArrayItem(int n)
225 { 248 {
@@ -229,6 +252,7 @@ QPDFObjectHandle::getArrayItem(int n) @@ -229,6 +252,7 @@ QPDFObjectHandle::getArrayItem(int n)
229 252
230 // Array mutators 253 // Array mutators
231 254
  255 +DLL_EXPORT
232 void 256 void
233 QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const& item) 257 QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const& item)
234 { 258 {
@@ -238,6 +262,7 @@ QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const&amp; item) @@ -238,6 +262,7 @@ QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const&amp; item)
238 262
239 // Dictionary accessors 263 // Dictionary accessors
240 264
  265 +DLL_EXPORT
241 bool 266 bool
242 QPDFObjectHandle::hasKey(std::string const& key) 267 QPDFObjectHandle::hasKey(std::string const& key)
243 { 268 {
@@ -245,6 +270,7 @@ QPDFObjectHandle::hasKey(std::string const&amp; key) @@ -245,6 +270,7 @@ QPDFObjectHandle::hasKey(std::string const&amp; key)
245 return dynamic_cast<QPDF_Dictionary*>(obj.getPointer())->hasKey(key); 270 return dynamic_cast<QPDF_Dictionary*>(obj.getPointer())->hasKey(key);
246 } 271 }
247 272
  273 +DLL_EXPORT
248 QPDFObjectHandle 274 QPDFObjectHandle
249 QPDFObjectHandle::getKey(std::string const& key) 275 QPDFObjectHandle::getKey(std::string const& key)
250 { 276 {
@@ -252,6 +278,7 @@ QPDFObjectHandle::getKey(std::string const&amp; key) @@ -252,6 +278,7 @@ QPDFObjectHandle::getKey(std::string const&amp; key)
252 return dynamic_cast<QPDF_Dictionary*>(obj.getPointer())->getKey(key); 278 return dynamic_cast<QPDF_Dictionary*>(obj.getPointer())->getKey(key);
253 } 279 }
254 280
  281 +DLL_EXPORT
255 std::set<std::string> 282 std::set<std::string>
256 QPDFObjectHandle::getKeys() 283 QPDFObjectHandle::getKeys()
257 { 284 {
@@ -261,6 +288,7 @@ QPDFObjectHandle::getKeys() @@ -261,6 +288,7 @@ QPDFObjectHandle::getKeys()
261 288
262 // Dictionary mutators 289 // Dictionary mutators
263 290
  291 +DLL_EXPORT
264 void 292 void
265 QPDFObjectHandle::replaceKey(std::string const& key, 293 QPDFObjectHandle::replaceKey(std::string const& key,
266 QPDFObjectHandle const& value) 294 QPDFObjectHandle const& value)
@@ -270,6 +298,7 @@ QPDFObjectHandle::replaceKey(std::string const&amp; key, @@ -270,6 +298,7 @@ QPDFObjectHandle::replaceKey(std::string const&amp; key,
270 obj.getPointer())->replaceKey(key, value); 298 obj.getPointer())->replaceKey(key, value);
271 } 299 }
272 300
  301 +DLL_EXPORT
273 void 302 void
274 QPDFObjectHandle::removeKey(std::string const& key) 303 QPDFObjectHandle::removeKey(std::string const& key)
275 { 304 {
@@ -278,6 +307,7 @@ QPDFObjectHandle::removeKey(std::string const&amp; key) @@ -278,6 +307,7 @@ QPDFObjectHandle::removeKey(std::string const&amp; key)
278 } 307 }
279 308
280 // Stream accessors 309 // Stream accessors
  310 +DLL_EXPORT
281 QPDFObjectHandle 311 QPDFObjectHandle
282 QPDFObjectHandle::getDict() 312 QPDFObjectHandle::getDict()
283 { 313 {
@@ -285,6 +315,7 @@ QPDFObjectHandle::getDict() @@ -285,6 +315,7 @@ QPDFObjectHandle::getDict()
285 return dynamic_cast<QPDF_Stream*>(obj.getPointer())->getDict(); 315 return dynamic_cast<QPDF_Stream*>(obj.getPointer())->getDict();
286 } 316 }
287 317
  318 +DLL_EXPORT
288 PointerHolder<Buffer> 319 PointerHolder<Buffer>
289 QPDFObjectHandle::getStreamData() 320 QPDFObjectHandle::getStreamData()
290 { 321 {
@@ -292,6 +323,7 @@ QPDFObjectHandle::getStreamData() @@ -292,6 +323,7 @@ QPDFObjectHandle::getStreamData()
292 return dynamic_cast<QPDF_Stream*>(obj.getPointer())->getStreamData(); 323 return dynamic_cast<QPDF_Stream*>(obj.getPointer())->getStreamData();
293 } 324 }
294 325
  326 +DLL_EXPORT
295 bool 327 bool
296 QPDFObjectHandle::pipeStreamData(Pipeline* p, bool filter, 328 QPDFObjectHandle::pipeStreamData(Pipeline* p, bool filter,
297 bool normalize, bool compress) 329 bool normalize, bool compress)
@@ -301,18 +333,21 @@ QPDFObjectHandle::pipeStreamData(Pipeline* p, bool filter, @@ -301,18 +333,21 @@ QPDFObjectHandle::pipeStreamData(Pipeline* p, bool filter,
301 p, filter, normalize, compress); 333 p, filter, normalize, compress);
302 } 334 }
303 335
  336 +DLL_EXPORT
304 int 337 int
305 QPDFObjectHandle::getObjectID() const 338 QPDFObjectHandle::getObjectID() const
306 { 339 {
307 return this->objid; 340 return this->objid;
308 } 341 }
309 342
  343 +DLL_EXPORT
310 int 344 int
311 QPDFObjectHandle::getGeneration() const 345 QPDFObjectHandle::getGeneration() const
312 { 346 {
313 return this->generation; 347 return this->generation;
314 } 348 }
315 349
  350 +DLL_EXPORT
316 std::map<std::string, QPDFObjectHandle> 351 std::map<std::string, QPDFObjectHandle>
317 QPDFObjectHandle::getPageImages() 352 QPDFObjectHandle::getPageImages()
318 { 353 {
@@ -361,6 +396,7 @@ QPDFObjectHandle::getPageImages() @@ -361,6 +396,7 @@ QPDFObjectHandle::getPageImages()
361 return result; 396 return result;
362 } 397 }
363 398
  399 +DLL_EXPORT
364 std::vector<QPDFObjectHandle> 400 std::vector<QPDFObjectHandle>
365 QPDFObjectHandle::getPageContents() 401 QPDFObjectHandle::getPageContents()
366 { 402 {
@@ -399,6 +435,7 @@ QPDFObjectHandle::getPageContents() @@ -399,6 +435,7 @@ QPDFObjectHandle::getPageContents()
399 return result; 435 return result;
400 } 436 }
401 437
  438 +DLL_EXPORT
402 std::string 439 std::string
403 QPDFObjectHandle::unparse() 440 QPDFObjectHandle::unparse()
404 { 441 {
@@ -415,6 +452,7 @@ QPDFObjectHandle::unparse() @@ -415,6 +452,7 @@ QPDFObjectHandle::unparse()
415 return result; 452 return result;
416 } 453 }
417 454
  455 +DLL_EXPORT
418 std::string 456 std::string
419 QPDFObjectHandle::unparseResolved() 457 QPDFObjectHandle::unparseResolved()
420 { 458 {
@@ -428,48 +466,56 @@ QPDFObjectHandle::newIndirect(QPDF* qpdf, int objid, int generation) @@ -428,48 +466,56 @@ QPDFObjectHandle::newIndirect(QPDF* qpdf, int objid, int generation)
428 return QPDFObjectHandle(qpdf, objid, generation); 466 return QPDFObjectHandle(qpdf, objid, generation);
429 } 467 }
430 468
  469 +DLL_EXPORT
431 QPDFObjectHandle 470 QPDFObjectHandle
432 QPDFObjectHandle::newBool(bool value) 471 QPDFObjectHandle::newBool(bool value)
433 { 472 {
434 return QPDFObjectHandle(new QPDF_Bool(value)); 473 return QPDFObjectHandle(new QPDF_Bool(value));
435 } 474 }
436 475
  476 +DLL_EXPORT
437 QPDFObjectHandle 477 QPDFObjectHandle
438 QPDFObjectHandle::newNull() 478 QPDFObjectHandle::newNull()
439 { 479 {
440 return QPDFObjectHandle(new QPDF_Null()); 480 return QPDFObjectHandle(new QPDF_Null());
441 } 481 }
442 482
  483 +DLL_EXPORT
443 QPDFObjectHandle 484 QPDFObjectHandle
444 QPDFObjectHandle::newInteger(int value) 485 QPDFObjectHandle::newInteger(int value)
445 { 486 {
446 return QPDFObjectHandle(new QPDF_Integer(value)); 487 return QPDFObjectHandle(new QPDF_Integer(value));
447 } 488 }
448 489
  490 +DLL_EXPORT
449 QPDFObjectHandle 491 QPDFObjectHandle
450 QPDFObjectHandle::newReal(std::string const& value) 492 QPDFObjectHandle::newReal(std::string const& value)
451 { 493 {
452 return QPDFObjectHandle(new QPDF_Real(value)); 494 return QPDFObjectHandle(new QPDF_Real(value));
453 } 495 }
454 496
  497 +DLL_EXPORT
455 QPDFObjectHandle 498 QPDFObjectHandle
456 QPDFObjectHandle::newName(std::string const& name) 499 QPDFObjectHandle::newName(std::string const& name)
457 { 500 {
458 return QPDFObjectHandle(new QPDF_Name(name)); 501 return QPDFObjectHandle(new QPDF_Name(name));
459 } 502 }
460 503
  504 +DLL_EXPORT
461 QPDFObjectHandle 505 QPDFObjectHandle
462 QPDFObjectHandle::newString(std::string const& str) 506 QPDFObjectHandle::newString(std::string const& str)
463 { 507 {
464 return QPDFObjectHandle(new QPDF_String(str)); 508 return QPDFObjectHandle(new QPDF_String(str));
465 } 509 }
466 510
  511 +DLL_EXPORT
467 QPDFObjectHandle 512 QPDFObjectHandle
468 QPDFObjectHandle::newArray(std::vector<QPDFObjectHandle> const& items) 513 QPDFObjectHandle::newArray(std::vector<QPDFObjectHandle> const& items)
469 { 514 {
470 return QPDFObjectHandle(new QPDF_Array(items)); 515 return QPDFObjectHandle(new QPDF_Array(items));
471 } 516 }
472 517
  518 +DLL_EXPORT
473 QPDFObjectHandle 519 QPDFObjectHandle
474 QPDFObjectHandle::newDictionary( 520 QPDFObjectHandle::newDictionary(
475 std::map<std::string, QPDFObjectHandle> const& items) 521 std::map<std::string, QPDFObjectHandle> const& items)
libqpdf/QPDFTokenizer.cc
@@ -17,12 +17,14 @@ static bool is_hex_digit(char ch) @@ -17,12 +17,14 @@ static bool is_hex_digit(char ch)
17 return (strchr("0123456789abcdefABCDEF", ch) != 0); 17 return (strchr("0123456789abcdefABCDEF", ch) != 0);
18 } 18 }
19 19
  20 +DLL_EXPORT
20 QPDFTokenizer::QPDFTokenizer() : 21 QPDFTokenizer::QPDFTokenizer() :
21 pound_special_in_name(true) 22 pound_special_in_name(true)
22 { 23 {
23 reset(); 24 reset();
24 } 25 }
25 26
  27 +DLL_EXPORT
26 void 28 void
27 QPDFTokenizer::allowPoundAnywhereInName() 29 QPDFTokenizer::allowPoundAnywhereInName()
28 { 30 {
@@ -45,6 +47,7 @@ QPDFTokenizer::reset() @@ -45,6 +47,7 @@ QPDFTokenizer::reset()
45 last_char_was_bs = false; 47 last_char_was_bs = false;
46 } 48 }
47 49
  50 +DLL_EXPORT
48 void 51 void
49 QPDFTokenizer::presentCharacter(char ch) 52 QPDFTokenizer::presentCharacter(char ch)
50 { 53 {
@@ -418,6 +421,7 @@ QPDFTokenizer::presentCharacter(char ch) @@ -418,6 +421,7 @@ QPDFTokenizer::presentCharacter(char ch)
418 } 421 }
419 } 422 }
420 423
  424 +DLL_EXPORT
421 void 425 void
422 QPDFTokenizer::presentEOF() 426 QPDFTokenizer::presentEOF()
423 { 427 {
@@ -439,6 +443,7 @@ QPDFTokenizer::presentEOF() @@ -439,6 +443,7 @@ QPDFTokenizer::presentEOF()
439 } 443 }
440 } 444 }
441 445
  446 +DLL_EXPORT
442 bool 447 bool
443 QPDFTokenizer::getToken(Token& token, bool& unread_char, char& ch) 448 QPDFTokenizer::getToken(Token& token, bool& unread_char, char& ch)
444 { 449 {
@@ -453,6 +458,7 @@ QPDFTokenizer::getToken(Token&amp; token, bool&amp; unread_char, char&amp; ch) @@ -453,6 +458,7 @@ QPDFTokenizer::getToken(Token&amp; token, bool&amp; unread_char, char&amp; ch)
453 return ready; 458 return ready;
454 } 459 }
455 460
  461 +DLL_EXPORT
456 bool 462 bool
457 QPDFTokenizer::betweenTokens() 463 QPDFTokenizer::betweenTokens()
458 { 464 {
libqpdf/QPDFXRefEntry.cc
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 #include <qpdf/QPDFExc.hh> 3 #include <qpdf/QPDFExc.hh>
4 #include <qpdf/QUtil.hh> 4 #include <qpdf/QUtil.hh>
5 5
  6 +DLL_EXPORT
6 QPDFXRefEntry::QPDFXRefEntry() : 7 QPDFXRefEntry::QPDFXRefEntry() :
7 type(0), 8 type(0),
8 field1(0), 9 field1(0),
@@ -10,6 +11,7 @@ QPDFXRefEntry::QPDFXRefEntry() : @@ -10,6 +11,7 @@ QPDFXRefEntry::QPDFXRefEntry() :
10 { 11 {
11 } 12 }
12 13
  14 +DLL_EXPORT
13 QPDFXRefEntry::QPDFXRefEntry(int type, int field1, int field2) : 15 QPDFXRefEntry::QPDFXRefEntry(int type, int field1, int field2) :
14 type(type), 16 type(type),
15 field1(field1), 17 field1(field1),
@@ -21,12 +23,14 @@ QPDFXRefEntry::QPDFXRefEntry(int type, int field1, int field2) : @@ -21,12 +23,14 @@ QPDFXRefEntry::QPDFXRefEntry(int type, int field1, int field2) :
21 } 23 }
22 } 24 }
23 25
  26 +DLL_EXPORT
24 int 27 int
25 QPDFXRefEntry::getType() const 28 QPDFXRefEntry::getType() const
26 { 29 {
27 return this->type; 30 return this->type;
28 } 31 }
29 32
  33 +DLL_EXPORT
30 int 34 int
31 QPDFXRefEntry::getOffset() const 35 QPDFXRefEntry::getOffset() const
32 { 36 {
@@ -38,6 +42,7 @@ QPDFXRefEntry::getOffset() const @@ -38,6 +42,7 @@ QPDFXRefEntry::getOffset() const
38 return this->field1; 42 return this->field1;
39 } 43 }
40 44
  45 +DLL_EXPORT
41 int 46 int
42 QPDFXRefEntry::getObjStreamNumber() const 47 QPDFXRefEntry::getObjStreamNumber() const
43 { 48 {
@@ -49,6 +54,7 @@ QPDFXRefEntry::getObjStreamNumber() const @@ -49,6 +54,7 @@ QPDFXRefEntry::getObjStreamNumber() const
49 return this->field1; 54 return this->field1;
50 } 55 }
51 56
  57 +DLL_EXPORT
52 int 58 int
53 QPDFXRefEntry::getObjStreamIndex() const 59 QPDFXRefEntry::getObjStreamIndex() const
54 { 60 {
libqpdf/QPDF_encryption.cc
@@ -32,6 +32,7 @@ pad_or_truncate_password(std::string const&amp; password, char k1[key_bytes]) @@ -32,6 +32,7 @@ pad_or_truncate_password(std::string const&amp; password, char k1[key_bytes])
32 memcpy(k1 + password_bytes, padding_string, pad_bytes); 32 memcpy(k1 + password_bytes, padding_string, pad_bytes);
33 } 33 }
34 34
  35 +DLL_EXPORT
35 void 36 void
36 QPDF::trim_user_password(std::string& user_password) 37 QPDF::trim_user_password(std::string& user_password)
37 { 38 {
@@ -97,6 +98,7 @@ iterate_rc4(unsigned char* data, int data_len, @@ -97,6 +98,7 @@ iterate_rc4(unsigned char* data, int data_len,
97 delete [] key; 98 delete [] key;
98 } 99 }
99 100
  101 +DLL_EXPORT
100 std::string 102 std::string
101 QPDF::compute_data_key(std::string const& encryption_key, 103 QPDF::compute_data_key(std::string const& encryption_key,
102 int objid, int generation) 104 int objid, int generation)
@@ -120,6 +122,7 @@ QPDF::compute_data_key(std::string const&amp; encryption_key, @@ -120,6 +122,7 @@ QPDF::compute_data_key(std::string const&amp; encryption_key,
120 std::min(result.length(), (size_t) 16)); 122 std::min(result.length(), (size_t) 16));
121 } 123 }
122 124
  125 +DLL_EXPORT
123 std::string 126 std::string
124 QPDF::compute_encryption_key( 127 QPDF::compute_encryption_key(
125 std::string const& password, EncryptionData const& data) 128 std::string const& password, EncryptionData const& data)
@@ -424,6 +427,7 @@ QPDF::decryptStream(Pipeline*&amp; pipeline, int objid, int generation, @@ -424,6 +427,7 @@ QPDF::decryptStream(Pipeline*&amp; pipeline, int objid, int generation,
424 heap.push_back(pipeline); 427 heap.push_back(pipeline);
425 } 428 }
426 429
  430 +DLL_EXPORT
427 void 431 void
428 QPDF::compute_encryption_O_U( 432 QPDF::compute_encryption_O_U(
429 char const* user_password, char const* owner_password, 433 char const* user_password, char const* owner_password,
@@ -436,6 +440,7 @@ QPDF::compute_encryption_O_U( @@ -436,6 +440,7 @@ QPDF::compute_encryption_O_U(
436 U = compute_U_value(user_password, data); 440 U = compute_U_value(user_password, data);
437 } 441 }
438 442
  443 +DLL_EXPORT
439 std::string const& 444 std::string const&
440 QPDF::getUserPassword() const 445 QPDF::getUserPassword() const
441 { 446 {
libqpdf/QPDF_linearization.cc
@@ -53,6 +53,7 @@ load_vector_vector(BitStream&amp; bit_stream, @@ -53,6 +53,7 @@ load_vector_vector(BitStream&amp; bit_stream,
53 bit_stream.skipToNextByte(); 53 bit_stream.skipToNextByte();
54 } 54 }
55 55
  56 +DLL_EXPORT
56 bool 57 bool
57 QPDF::checkLinearization() 58 QPDF::checkLinearization()
58 { 59 {
@@ -69,6 +70,7 @@ QPDF::checkLinearization() @@ -69,6 +70,7 @@ QPDF::checkLinearization()
69 return result; 70 return result;
70 } 71 }
71 72
  73 +DLL_EXPORT
72 bool 74 bool
73 QPDF::isLinearized() 75 QPDF::isLinearized()
74 { 76 {
@@ -982,6 +984,7 @@ QPDF::checkHOutlines(std::list&lt;std::string&gt;&amp; warnings) @@ -982,6 +984,7 @@ QPDF::checkHOutlines(std::list&lt;std::string&gt;&amp; warnings)
982 } 984 }
983 } 985 }
984 986
  987 +DLL_EXPORT
985 void 988 void
986 QPDF::showLinearizationData() 989 QPDF::showLinearizationData()
987 { 990 {
@@ -1739,6 +1742,7 @@ QPDF::pushOutlinesToPart( @@ -1739,6 +1742,7 @@ QPDF::pushOutlinesToPart(
1739 } 1742 }
1740 } 1743 }
1741 1744
  1745 +DLL_EXPORT
1742 void 1746 void
1743 QPDF::getLinearizedParts( 1747 QPDF::getLinearizedParts(
1744 std::map<int, int> const& object_stream_data, 1748 std::map<int, int> const& object_stream_data,
@@ -2070,6 +2074,7 @@ QPDF::writeHGeneric(BitWriter&amp; w, HGeneric&amp; t) @@ -2070,6 +2074,7 @@ QPDF::writeHGeneric(BitWriter&amp; w, HGeneric&amp; t)
2070 w.writeBits(t.group_length, 32); // 4 2074 w.writeBits(t.group_length, 32); // 4
2071 } 2075 }
2072 2076
  2077 +DLL_EXPORT
2073 void 2078 void
2074 QPDF::generateHintStream(std::map<int, QPDFXRefEntry> const& xref, 2079 QPDF::generateHintStream(std::map<int, QPDFXRefEntry> const& xref,
2075 std::map<int, size_t> const& lengths, 2080 std::map<int, size_t> const& lengths,
libqpdf/QPDF_optimization.cc
@@ -58,6 +58,7 @@ QPDF::ObjUser::operator&lt;(ObjUser const&amp; rhs) const @@ -58,6 +58,7 @@ QPDF::ObjUser::operator&lt;(ObjUser const&amp; rhs) const
58 return false; 58 return false;
59 } 59 }
60 60
  61 +DLL_EXPORT
61 void 62 void
62 QPDF::flattenScalarReferences() 63 QPDF::flattenScalarReferences()
63 { 64 {
@@ -140,6 +141,7 @@ QPDF::flattenScalarReferences() @@ -140,6 +141,7 @@ QPDF::flattenScalarReferences()
140 } 141 }
141 } 142 }
142 143
  144 +DLL_EXPORT
143 void 145 void
144 QPDF::optimize(std::map<int, int> const& object_stream_data, 146 QPDF::optimize(std::map<int, int> const& object_stream_data,
145 bool allow_changes) 147 bool allow_changes)
libqpdf/QTC.cc
@@ -11,6 +11,7 @@ static bool tc_active(char const* const scope) @@ -11,6 +11,7 @@ static bool tc_active(char const* const scope)
11 return (QUtil::get_env("TC_SCOPE", &value) && (value == scope)); 11 return (QUtil::get_env("TC_SCOPE", &value) && (value == scope));
12 } 12 }
13 13
  14 +DLL_EXPORT
14 void QTC::TC(char const* const scope, char const* const ccase, int n) 15 void QTC::TC(char const* const scope, char const* const ccase, int n)
15 { 16 {
16 static std::set<std::pair<std::string, int> > cache; 17 static std::set<std::pair<std::string, int> > cache;
libqpdf/QUtil.cc
@@ -14,6 +14,7 @@ @@ -14,6 +14,7 @@
14 #include <unistd.h> 14 #include <unistd.h>
15 #endif 15 #endif
16 16
  17 +DLL_EXPORT
17 std::string 18 std::string
18 QUtil::int_to_string(int num, int fullpad) 19 QUtil::int_to_string(int num, int fullpad)
19 { 20 {
@@ -41,6 +42,7 @@ QUtil::int_to_string(int num, int fullpad) @@ -41,6 +42,7 @@ QUtil::int_to_string(int num, int fullpad)
41 return std::string(t); 42 return std::string(t);
42 } 43 }
43 44
  45 +DLL_EXPORT
44 std::string 46 std::string
45 QUtil::double_to_string(double num, int decimal_places) 47 QUtil::double_to_string(double num, int decimal_places)
46 { 48 {
@@ -76,6 +78,7 @@ QUtil::double_to_string(double num, int decimal_places) @@ -76,6 +78,7 @@ QUtil::double_to_string(double num, int decimal_places)
76 return std::string(t); 78 return std::string(t);
77 } 79 }
78 80
  81 +DLL_EXPORT
79 int 82 int
80 QUtil::os_wrapper(std::string const& description, int status) throw (QEXC::System) 83 QUtil::os_wrapper(std::string const& description, int status) throw (QEXC::System)
81 { 84 {
@@ -86,6 +89,7 @@ QUtil::os_wrapper(std::string const&amp; description, int status) throw (QEXC::Syste @@ -86,6 +89,7 @@ QUtil::os_wrapper(std::string const&amp; description, int status) throw (QEXC::Syste
86 return status; 89 return status;
87 } 90 }
88 91
  92 +DLL_EXPORT
89 FILE* 93 FILE*
90 QUtil::fopen_wrapper(std::string const& description, FILE* f) throw (QEXC::System) 94 QUtil::fopen_wrapper(std::string const& description, FILE* f) throw (QEXC::System)
91 { 95 {
@@ -96,6 +100,7 @@ QUtil::fopen_wrapper(std::string const&amp; description, FILE* f) throw (QEXC::Syste @@ -96,6 +100,7 @@ QUtil::fopen_wrapper(std::string const&amp; description, FILE* f) throw (QEXC::Syste
96 return f; 100 return f;
97 } 101 }
98 102
  103 +DLL_EXPORT
99 char* 104 char*
100 QUtil::copy_string(std::string const& str) 105 QUtil::copy_string(std::string const& str)
101 { 106 {
@@ -106,6 +111,7 @@ QUtil::copy_string(std::string const&amp; str) @@ -106,6 +111,7 @@ QUtil::copy_string(std::string const&amp; str)
106 return result; 111 return result;
107 } 112 }
108 113
  114 +DLL_EXPORT
109 void 115 void
110 QUtil::binary_stdout() 116 QUtil::binary_stdout()
111 { 117 {
@@ -114,6 +120,7 @@ QUtil::binary_stdout() @@ -114,6 +120,7 @@ QUtil::binary_stdout()
114 #endif 120 #endif
115 } 121 }
116 122
  123 +DLL_EXPORT
117 void 124 void
118 QUtil::binary_stdin() 125 QUtil::binary_stdin()
119 { 126 {
@@ -122,6 +129,7 @@ QUtil::binary_stdin() @@ -122,6 +129,7 @@ QUtil::binary_stdin()
122 #endif 129 #endif
123 } 130 }
124 131
  132 +DLL_EXPORT
125 char* 133 char*
126 QUtil::getWhoami(char* argv0) 134 QUtil::getWhoami(char* argv0)
127 { 135 {
@@ -149,6 +157,7 @@ QUtil::getWhoami(char* argv0) @@ -149,6 +157,7 @@ QUtil::getWhoami(char* argv0)
149 return whoami; 157 return whoami;
150 } 158 }
151 159
  160 +DLL_EXPORT
152 bool 161 bool
153 QUtil::get_env(std::string const& var, std::string* value) 162 QUtil::get_env(std::string const& var, std::string* value)
154 { 163 {
@@ -186,6 +195,7 @@ QUtil::get_env(std::string const&amp; var, std::string* value) @@ -186,6 +195,7 @@ QUtil::get_env(std::string const&amp; var, std::string* value)
186 #endif 195 #endif
187 } 196 }
188 197
  198 +DLL_EXPORT
189 time_t 199 time_t
190 QUtil::get_current_time() 200 QUtil::get_current_time()
191 { 201 {
@@ -212,6 +222,7 @@ QUtil::get_current_time() @@ -212,6 +222,7 @@ QUtil::get_current_time()
212 #endif 222 #endif
213 } 223 }
214 224
  225 +DLL_EXPORT
215 std::string 226 std::string
216 QUtil::toUTF8(unsigned long uval) 227 QUtil::toUTF8(unsigned long uval)
217 { 228 {