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