Commit 07edf9644004bd788eacec56aa21a5c89b3c92cc

Authored by Jay Berkenbilt
1 parent b6d1dffa

Remove methods of private classes from ABI

Prior to the cmake conversion, several private classes had methods
that were exported into the shared library so they could be tested
with libtests. With cmake, we build libtests using an object library,
so this is no longer necessary. The methods that are disappearing from
the ABI were never exposed through public headers, so no code should
be using them. Removal had to wait until the window for ABI-breaking
changes was open.
@@ -37,7 +37,6 @@ cmake @@ -37,7 +37,6 @@ cmake
37 ===== 37 =====
38 38
39 * DLL.h 39 * DLL.h
40 - * Remove DLL.h and QPDF_DLL* from all private library classes.  
41 * Change DLL_EXPORT to QPDF_EXPORT. Be sure to call attention to 40 * Change DLL_EXPORT to QPDF_EXPORT. Be sure to call attention to
42 this in the release notes. There should be a "migrating to cmake" 41 this in the release notes. There should be a "migrating to cmake"
43 in the manual, and ./configure should draw attention to it. 42 in the manual, and ./configure should draw attention to it.
libqpdf/qpdf/BitStream.hh
@@ -3,25 +3,18 @@ @@ -3,25 +3,18 @@
3 #ifndef BITSTREAM_HH 3 #ifndef BITSTREAM_HH
4 #define BITSTREAM_HH 4 #define BITSTREAM_HH
5 5
6 -#include <qpdf/DLL.h>  
7 #include <stddef.h> 6 #include <stddef.h>
8 7
9 class BitStream 8 class BitStream
10 { 9 {
11 public: 10 public:
12 - QPDF_DLL  
13 BitStream(unsigned char const* p, size_t nbytes); 11 BitStream(unsigned char const* p, size_t nbytes);
14 - QPDF_DLL  
15 void reset(); 12 void reset();
16 - QPDF_DLL  
17 unsigned long long getBits(size_t nbits); 13 unsigned long long getBits(size_t nbits);
18 - QPDF_DLL  
19 long long getBitsSigned(size_t nbits); 14 long long getBitsSigned(size_t nbits);
20 // Only call getBitsInt when requesting a number of bits that will 15 // Only call getBitsInt when requesting a number of bits that will
21 // definitely fit in an int. 16 // definitely fit in an int.
22 - QPDF_DLL  
23 int getBitsInt(size_t nbits); 17 int getBitsInt(size_t nbits);
24 - QPDF_DLL  
25 void skipToNextByte(); 18 void skipToNextByte();
26 19
27 private: 20 private:
libqpdf/qpdf/BitWriter.hh
@@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
3 #ifndef BITWRITER_HH 3 #ifndef BITWRITER_HH
4 #define BITWRITER_HH 4 #define BITWRITER_HH
5 5
6 -#include <qpdf/DLL.h>  
7 #include <stddef.h> 6 #include <stddef.h>
8 7
9 class Pipeline; 8 class Pipeline;
@@ -13,16 +12,11 @@ class BitWriter @@ -13,16 +12,11 @@ class BitWriter
13 public: 12 public:
14 // Write bits to the pipeline. It is the caller's responsibility 13 // Write bits to the pipeline. It is the caller's responsibility
15 // to eventually call finish on the pipeline. 14 // to eventually call finish on the pipeline.
16 - QPDF_DLL  
17 BitWriter(Pipeline* pl); 15 BitWriter(Pipeline* pl);
18 - QPDF_DLL  
19 void writeBits(unsigned long long val, size_t bits); 16 void writeBits(unsigned long long val, size_t bits);
20 - QPDF_DLL  
21 void writeBitsSigned(long long val, size_t bits); 17 void writeBitsSigned(long long val, size_t bits);
22 - QPDF_DLL  
23 void writeBitsInt(int val, size_t bits); 18 void writeBitsInt(int val, size_t bits);
24 // Force any partial byte to be written to the pipeline. 19 // Force any partial byte to be written to the pipeline.
25 - QPDF_DLL  
26 void flush(); 20 void flush();
27 21
28 private: 22 private:
libqpdf/qpdf/CryptoRandomDataProvider.hh
1 #ifndef CRYPTORANDOMDATAPROVIDER_HH 1 #ifndef CRYPTORANDOMDATAPROVIDER_HH
2 #define CRYPTORANDOMDATAPROVIDER_HH 2 #define CRYPTORANDOMDATAPROVIDER_HH
3 3
4 -#include <qpdf/DLL.h>  
5 #include <qpdf/RandomDataProvider.hh> 4 #include <qpdf/RandomDataProvider.hh>
6 5
7 class CryptoRandomDataProvider: public RandomDataProvider 6 class CryptoRandomDataProvider: public RandomDataProvider
8 { 7 {
9 public: 8 public:
10 - QPDF_DLL  
11 CryptoRandomDataProvider(); 9 CryptoRandomDataProvider();
12 - QPDF_DLL  
13 virtual ~CryptoRandomDataProvider(); 10 virtual ~CryptoRandomDataProvider();
14 -  
15 - QPDF_DLL  
16 virtual void provideRandomData(unsigned char* data, size_t len); 11 virtual void provideRandomData(unsigned char* data, size_t len);
17 -  
18 - QPDF_DLL  
19 static RandomDataProvider* getInstance(); 12 static RandomDataProvider* getInstance();
20 }; 13 };
21 14
libqpdf/qpdf/InsecureRandomDataProvider.hh
1 #ifndef INSECURERANDOMDATAPROVIDER_HH 1 #ifndef INSECURERANDOMDATAPROVIDER_HH
2 #define INSECURERANDOMDATAPROVIDER_HH 2 #define INSECURERANDOMDATAPROVIDER_HH
3 3
4 -#include <qpdf/DLL.h>  
5 #include <qpdf/RandomDataProvider.hh> 4 #include <qpdf/RandomDataProvider.hh>
6 5
7 class InsecureRandomDataProvider: public RandomDataProvider 6 class InsecureRandomDataProvider: public RandomDataProvider
8 { 7 {
9 public: 8 public:
10 - QPDF_DLL  
11 InsecureRandomDataProvider(); 9 InsecureRandomDataProvider();
12 - QPDF_DLL  
13 virtual ~InsecureRandomDataProvider(); 10 virtual ~InsecureRandomDataProvider();
14 -  
15 - QPDF_DLL  
16 virtual void provideRandomData(unsigned char* data, size_t len); 11 virtual void provideRandomData(unsigned char* data, size_t len);
17 -  
18 - QPDF_DLL  
19 static RandomDataProvider* getInstance(); 12 static RandomDataProvider* getInstance();
20 13
21 private: 14 private:
libqpdf/qpdf/JSONHandler.hh
1 #ifndef JSONHANDLER_HH 1 #ifndef JSONHANDLER_HH
2 #define JSONHANDLER_HH 2 #define JSONHANDLER_HH
3 3
4 -#include <qpdf/DLL.h>  
5 #include <qpdf/JSON.hh> 4 #include <qpdf/JSON.hh>
6 #include <functional> 5 #include <functional>
7 #include <map> 6 #include <map>
@@ -18,10 +17,7 @@ class JSONHandler @@ -18,10 +17,7 @@ class JSONHandler
18 public: 17 public:
19 // A QPDFUsage exception is thrown if there are any errors 18 // A QPDFUsage exception is thrown if there are any errors
20 // validating the JSON object. 19 // validating the JSON object.
21 - QPDF_DLL  
22 JSONHandler(); 20 JSONHandler();
23 -  
24 - QPDF_DLL  
25 ~JSONHandler() = default; 21 ~JSONHandler() = default;
26 22
27 // Based on the type of handler, expect the object to be of a 23 // Based on the type of handler, expect the object to be of a
@@ -42,36 +38,26 @@ class JSONHandler @@ -42,36 +38,26 @@ class JSONHandler
42 38
43 // If an any handler is added, it will be called for any value 39 // If an any handler is added, it will be called for any value
44 // including null, and no other handler will be called. 40 // including null, and no other handler will be called.
45 - QPDF_DLL  
46 void addAnyHandler(json_handler_t fn); 41 void addAnyHandler(json_handler_t fn);
47 42
48 // If any of the remaining handlers are registered, each 43 // If any of the remaining handlers are registered, each
49 // registered handle will be called. 44 // registered handle will be called.
50 - QPDF_DLL  
51 void addNullHandler(void_handler_t fn); 45 void addNullHandler(void_handler_t fn);
52 - QPDF_DLL  
53 void addStringHandler(string_handler_t fn); 46 void addStringHandler(string_handler_t fn);
54 - QPDF_DLL  
55 void addNumberHandler(string_handler_t fn); 47 void addNumberHandler(string_handler_t fn);
56 - QPDF_DLL  
57 void addBoolHandler(bool_handler_t fn); 48 void addBoolHandler(bool_handler_t fn);
58 49
59 - QPDF_DLL  
60 void addDictHandlers(json_handler_t start_fn, void_handler_t end_fn); 50 void addDictHandlers(json_handler_t start_fn, void_handler_t end_fn);
61 - QPDF_DLL  
62 void 51 void
63 addDictKeyHandler(std::string const& key, std::shared_ptr<JSONHandler>); 52 addDictKeyHandler(std::string const& key, std::shared_ptr<JSONHandler>);
64 - QPDF_DLL  
65 void addFallbackDictHandler(std::shared_ptr<JSONHandler>); 53 void addFallbackDictHandler(std::shared_ptr<JSONHandler>);
66 54
67 - QPDF_DLL  
68 void addArrayHandlers( 55 void addArrayHandlers(
69 json_handler_t start_fn, 56 json_handler_t start_fn,
70 void_handler_t end_fn, 57 void_handler_t end_fn,
71 std::shared_ptr<JSONHandler> item_handlers); 58 std::shared_ptr<JSONHandler> item_handlers);
72 59
73 // Apply handlers recursively to a JSON object. 60 // Apply handlers recursively to a JSON object.
74 - QPDF_DLL  
75 void handle(std::string const& path, JSON j); 61 void handle(std::string const& path, JSON j);
76 62
77 private: 63 private:
@@ -115,7 +101,6 @@ class JSONHandler @@ -115,7 +101,6 @@ class JSONHandler
115 friend class JSONHandler; 101 friend class JSONHandler;
116 102
117 public: 103 public:
118 - QPDF_DLL  
119 ~Members() = default; 104 ~Members() = default;
120 105
121 private: 106 private:
libqpdf/qpdf/MD5.hh
1 #ifndef MD5_HH 1 #ifndef MD5_HH
2 #define MD5_HH 2 #define MD5_HH
3 3
4 -#include <qpdf/DLL.h>  
5 #include <qpdf/QPDFCryptoImpl.hh> 4 #include <qpdf/QPDFCryptoImpl.hh>
6 #include <qpdf/Types.h> 5 #include <qpdf/Types.h>
7 #include <memory> 6 #include <memory>
@@ -12,50 +11,37 @@ class MD5 @@ -12,50 +11,37 @@ class MD5
12 public: 11 public:
13 typedef unsigned char Digest[16]; 12 typedef unsigned char Digest[16];
14 13
15 - QPDF_DLL  
16 MD5(); 14 MD5();
17 - QPDF_DLL  
18 void reset(); 15 void reset();
19 16
20 // encodes string and finalizes 17 // encodes string and finalizes
21 - QPDF_DLL  
22 void encodeString(char const* input_string); 18 void encodeString(char const* input_string);
23 19
24 // encodes file and finalizes; offset < 0 reads whole file 20 // encodes file and finalizes; offset < 0 reads whole file
25 - QPDF_DLL  
26 void encodeFile(char const* filename, qpdf_offset_t up_to_offset = -1); 21 void encodeFile(char const* filename, qpdf_offset_t up_to_offset = -1);
27 22
28 // appends string to current md5 object 23 // appends string to current md5 object
29 - QPDF_DLL  
30 void appendString(char const* input_string); 24 void appendString(char const* input_string);
31 25
32 // appends arbitrary data to current md5 object 26 // appends arbitrary data to current md5 object
33 - QPDF_DLL  
34 void encodeDataIncrementally(char const* input_data, size_t len); 27 void encodeDataIncrementally(char const* input_data, size_t len);
35 28
36 // computes a raw digest 29 // computes a raw digest
37 - QPDF_DLL  
38 void digest(Digest); 30 void digest(Digest);
39 31
40 // prints the digest to stdout terminated with \r\n (primarily for 32 // prints the digest to stdout terminated with \r\n (primarily for
41 // testing) 33 // testing)
42 - QPDF_DLL  
43 void print(); 34 void print();
44 35
45 // returns the digest as a hexadecimal string 36 // returns the digest as a hexadecimal string
46 - QPDF_DLL  
47 std::string unparse(); 37 std::string unparse();
48 38
49 // Convenience functions 39 // Convenience functions
50 - QPDF_DLL  
51 static std::string getDataChecksum(char const* buf, size_t len); 40 static std::string getDataChecksum(char const* buf, size_t len);
52 - QPDF_DLL  
53 static std::string 41 static std::string
54 getFileChecksum(char const* filename, qpdf_offset_t up_to_offset = -1); 42 getFileChecksum(char const* filename, qpdf_offset_t up_to_offset = -1);
55 - QPDF_DLL  
56 static bool 43 static bool
57 checkDataChecksum(char const* const checksum, char const* buf, size_t len); 44 checkDataChecksum(char const* const checksum, char const* buf, size_t len);
58 - QPDF_DLL  
59 static bool checkFileChecksum( 45 static bool checkFileChecksum(
60 char const* const checksum, 46 char const* const checksum,
61 char const* filename, 47 char const* filename,
libqpdf/qpdf/Pl_AES_PDF.hh
@@ -11,7 +11,6 @@ @@ -11,7 +11,6 @@
11 class Pl_AES_PDF: public Pipeline 11 class Pl_AES_PDF: public Pipeline
12 { 12 {
13 public: 13 public:
14 - QPDF_DLL  
15 // key should be a pointer to key_bytes bytes of data 14 // key should be a pointer to key_bytes bytes of data
16 Pl_AES_PDF( 15 Pl_AES_PDF(
17 char const* identifier, 16 char const* identifier,
@@ -19,30 +18,22 @@ class Pl_AES_PDF: public Pipeline @@ -19,30 +18,22 @@ class Pl_AES_PDF: public Pipeline
19 bool encrypt, 18 bool encrypt,
20 unsigned char const* key, 19 unsigned char const* key,
21 size_t key_bytes); 20 size_t key_bytes);
22 - QPDF_DLL  
23 virtual ~Pl_AES_PDF(); 21 virtual ~Pl_AES_PDF();
24 22
25 - QPDF_DLL  
26 virtual void write(unsigned char* data, size_t len); 23 virtual void write(unsigned char* data, size_t len);
27 - QPDF_DLL  
28 virtual void finish(); 24 virtual void finish();
29 25
30 // Use zero initialization vector; needed for AESV3 26 // Use zero initialization vector; needed for AESV3
31 - QPDF_DLL  
32 void useZeroIV(); 27 void useZeroIV();
33 // Disable padding; needed for AESV3 28 // Disable padding; needed for AESV3
34 - QPDF_DLL  
35 void disablePadding(); 29 void disablePadding();
36 // Specify an initialization vector, which will not be included in 30 // Specify an initialization vector, which will not be included in
37 // the output. 31 // the output.
38 - QPDF_DLL  
39 void setIV(unsigned char const* iv, size_t bytes); 32 void setIV(unsigned char const* iv, size_t bytes);
40 33
41 // For testing only; PDF always uses CBC 34 // For testing only; PDF always uses CBC
42 - QPDF_DLL  
43 void disableCBC(); 35 void disableCBC();
44 // For testing only: use a fixed initialization vector for CBC 36 // For testing only: use a fixed initialization vector for CBC
45 - QPDF_DLL  
46 static void useStaticIV(); 37 static void useStaticIV();
47 38
48 private: 39 private:
libqpdf/qpdf/Pl_ASCII85Decoder.hh
@@ -6,13 +6,9 @@ @@ -6,13 +6,9 @@
6 class Pl_ASCII85Decoder: public Pipeline 6 class Pl_ASCII85Decoder: public Pipeline
7 { 7 {
8 public: 8 public:
9 - QPDF_DLL  
10 Pl_ASCII85Decoder(char const* identifier, Pipeline* next); 9 Pl_ASCII85Decoder(char const* identifier, Pipeline* next);
11 - QPDF_DLL  
12 virtual ~Pl_ASCII85Decoder(); 10 virtual ~Pl_ASCII85Decoder();
13 - QPDF_DLL  
14 virtual void write(unsigned char* buf, size_t len); 11 virtual void write(unsigned char* buf, size_t len);
15 - QPDF_DLL  
16 virtual void finish(); 12 virtual void finish();
17 13
18 private: 14 private:
libqpdf/qpdf/Pl_ASCIIHexDecoder.hh
@@ -6,13 +6,9 @@ @@ -6,13 +6,9 @@
6 class Pl_ASCIIHexDecoder: public Pipeline 6 class Pl_ASCIIHexDecoder: public Pipeline
7 { 7 {
8 public: 8 public:
9 - QPDF_DLL  
10 Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next); 9 Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next);
11 - QPDF_DLL  
12 virtual ~Pl_ASCIIHexDecoder(); 10 virtual ~Pl_ASCIIHexDecoder();
13 - QPDF_DLL  
14 virtual void write(unsigned char* buf, size_t len); 11 virtual void write(unsigned char* buf, size_t len);
15 - QPDF_DLL  
16 virtual void finish(); 12 virtual void finish();
17 13
18 private: 14 private:
libqpdf/qpdf/Pl_LZWDecoder.hh
@@ -9,14 +9,10 @@ @@ -9,14 +9,10 @@
9 class Pl_LZWDecoder: public Pipeline 9 class Pl_LZWDecoder: public Pipeline
10 { 10 {
11 public: 11 public:
12 - QPDF_DLL  
13 Pl_LZWDecoder( 12 Pl_LZWDecoder(
14 char const* identifier, Pipeline* next, bool early_code_change); 13 char const* identifier, Pipeline* next, bool early_code_change);
15 - QPDF_DLL  
16 virtual ~Pl_LZWDecoder(); 14 virtual ~Pl_LZWDecoder();
17 - QPDF_DLL  
18 virtual void write(unsigned char* buf, size_t len); 15 virtual void write(unsigned char* buf, size_t len);
19 - QPDF_DLL  
20 virtual void finish(); 16 virtual void finish();
21 17
22 private: 18 private:
libqpdf/qpdf/Pl_MD5.hh
@@ -15,27 +15,20 @@ @@ -15,27 +15,20 @@
15 class Pl_MD5: public Pipeline 15 class Pl_MD5: public Pipeline
16 { 16 {
17 public: 17 public:
18 - QPDF_DLL  
19 Pl_MD5(char const* identifier, Pipeline* next); 18 Pl_MD5(char const* identifier, Pipeline* next);
20 - QPDF_DLL  
21 virtual ~Pl_MD5(); 19 virtual ~Pl_MD5();
22 - QPDF_DLL  
23 virtual void write(unsigned char*, size_t); 20 virtual void write(unsigned char*, size_t);
24 - QPDF_DLL  
25 virtual void finish(); 21 virtual void finish();
26 - QPDF_DLL  
27 std::string getHexDigest(); 22 std::string getHexDigest();
28 // Enable/disable. Disabling the pipeline causes it to become a 23 // Enable/disable. Disabling the pipeline causes it to become a
29 // pass-through. This makes it possible to stick an MD5 pipeline 24 // pass-through. This makes it possible to stick an MD5 pipeline
30 // in a pipeline when it may or may not be required. Disabling it 25 // in a pipeline when it may or may not be required. Disabling it
31 // avoids incurring the runtime overhead of doing needless 26 // avoids incurring the runtime overhead of doing needless
32 // digest computation. 27 // digest computation.
33 - QPDF_DLL  
34 void enable(bool enabled); 28 void enable(bool enabled);
35 // If persistAcrossFinish is called, calls to finish do not 29 // If persistAcrossFinish is called, calls to finish do not
36 // finalize the underlying md5 object. In this case, the object is 30 // finalize the underlying md5 object. In this case, the object is
37 // not finalized until getHexDigest() is called. 31 // not finalized until getHexDigest() is called.
38 - QPDF_DLL  
39 void persistAcrossFinish(bool); 32 void persistAcrossFinish(bool);
40 33
41 private: 34 private:
libqpdf/qpdf/Pl_PNGFilter.hh
@@ -15,7 +15,6 @@ class Pl_PNGFilter: public Pipeline @@ -15,7 +15,6 @@ class Pl_PNGFilter: public Pipeline
15 // Encoding is only partially supported 15 // Encoding is only partially supported
16 enum action_e { a_encode, a_decode }; 16 enum action_e { a_encode, a_decode };
17 17
18 - QPDF_DLL  
19 Pl_PNGFilter( 18 Pl_PNGFilter(
20 char const* identifier, 19 char const* identifier,
21 Pipeline* next, 20 Pipeline* next,
@@ -23,12 +22,9 @@ class Pl_PNGFilter: public Pipeline @@ -23,12 +22,9 @@ class Pl_PNGFilter: public Pipeline
23 unsigned int columns, 22 unsigned int columns,
24 unsigned int samples_per_pixel = 1, 23 unsigned int samples_per_pixel = 1,
25 unsigned int bits_per_sample = 8); 24 unsigned int bits_per_sample = 8);
26 - QPDF_DLL  
27 virtual ~Pl_PNGFilter(); 25 virtual ~Pl_PNGFilter();
28 26
29 - QPDF_DLL  
30 virtual void write(unsigned char* data, size_t len); 27 virtual void write(unsigned char* data, size_t len);
31 - QPDF_DLL  
32 virtual void finish(); 28 virtual void finish();
33 29
34 private: 30 private:
libqpdf/qpdf/Pl_RC4.hh
@@ -11,19 +11,15 @@ class Pl_RC4: public Pipeline @@ -11,19 +11,15 @@ class Pl_RC4: public Pipeline
11 static size_t const def_bufsize = 65536; 11 static size_t const def_bufsize = 65536;
12 12
13 // key_len of -1 means treat key_data as a null-terminated string 13 // key_len of -1 means treat key_data as a null-terminated string
14 - QPDF_DLL  
15 Pl_RC4( 14 Pl_RC4(
16 char const* identifier, 15 char const* identifier,
17 Pipeline* next, 16 Pipeline* next,
18 unsigned char const* key_data, 17 unsigned char const* key_data,
19 int key_len = -1, 18 int key_len = -1,
20 size_t out_bufsize = def_bufsize); 19 size_t out_bufsize = def_bufsize);
21 - QPDF_DLL  
22 virtual ~Pl_RC4(); 20 virtual ~Pl_RC4();
23 21
24 - QPDF_DLL  
25 virtual void write(unsigned char* data, size_t len); 22 virtual void write(unsigned char* data, size_t len);
26 - QPDF_DLL  
27 virtual void finish(); 23 virtual void finish();
28 24
29 private: 25 private:
libqpdf/qpdf/Pl_SHA2.hh
@@ -20,19 +20,12 @@ @@ -20,19 +20,12 @@
20 class Pl_SHA2: public Pipeline 20 class Pl_SHA2: public Pipeline
21 { 21 {
22 public: 22 public:
23 - QPDF_DLL  
24 Pl_SHA2(int bits = 0, Pipeline* next = 0); 23 Pl_SHA2(int bits = 0, Pipeline* next = 0);
25 - QPDF_DLL  
26 virtual ~Pl_SHA2(); 24 virtual ~Pl_SHA2();
27 - QPDF_DLL  
28 virtual void write(unsigned char*, size_t); 25 virtual void write(unsigned char*, size_t);
29 - QPDF_DLL  
30 virtual void finish(); 26 virtual void finish();
31 - QPDF_DLL  
32 void resetBits(int bits); 27 void resetBits(int bits);
33 - QPDF_DLL  
34 std::string getHexDigest(); 28 std::string getHexDigest();
35 - QPDF_DLL  
36 std::string getRawDigest(); 29 std::string getRawDigest();
37 30
38 private: 31 private:
libqpdf/qpdf/Pl_TIFFPredictor.hh
@@ -11,7 +11,6 @@ class Pl_TIFFPredictor: public Pipeline @@ -11,7 +11,6 @@ class Pl_TIFFPredictor: public Pipeline
11 public: 11 public:
12 enum action_e { a_encode, a_decode }; 12 enum action_e { a_encode, a_decode };
13 13
14 - QPDF_DLL  
15 Pl_TIFFPredictor( 14 Pl_TIFFPredictor(
16 char const* identifier, 15 char const* identifier,
17 Pipeline* next, 16 Pipeline* next,
@@ -19,12 +18,9 @@ class Pl_TIFFPredictor: public Pipeline @@ -19,12 +18,9 @@ class Pl_TIFFPredictor: public Pipeline
19 unsigned int columns, 18 unsigned int columns,
20 unsigned int samples_per_pixel = 1, 19 unsigned int samples_per_pixel = 1,
21 unsigned int bits_per_sample = 8); 20 unsigned int bits_per_sample = 8);
22 - QPDF_DLL  
23 virtual ~Pl_TIFFPredictor(); 21 virtual ~Pl_TIFFPredictor();
24 22
25 - QPDF_DLL  
26 virtual void write(unsigned char* data, size_t len); 23 virtual void write(unsigned char* data, size_t len);
27 - QPDF_DLL  
28 virtual void finish(); 24 virtual void finish();
29 25
30 private: 26 private:
libqpdf/qpdf/QPDFArgParser.hh
1 #ifndef QPDFARGPARSER_HH 1 #ifndef QPDFARGPARSER_HH
2 #define QPDFARGPARSER_HH 2 #define QPDFARGPARSER_HH
3 3
4 -#include <qpdf/DLL.h>  
5 #include <functional> 4 #include <functional>
6 #include <map> 5 #include <map>
7 #include <memory> 6 #include <memory>
@@ -27,18 +26,15 @@ class QPDFArgParser @@ -27,18 +26,15 @@ class QPDFArgParser
27 // progname_env is used to override argv[0] when figuring out the 26 // progname_env is used to override argv[0] when figuring out the
28 // name of the executable for setting up completion. This may be 27 // name of the executable for setting up completion. This may be
29 // needed if the program is invoked by a wrapper. 28 // needed if the program is invoked by a wrapper.
30 - QPDF_DLL  
31 QPDFArgParser(int argc, char const* const argv[], char const* progname_env); 29 QPDFArgParser(int argc, char const* const argv[], char const* progname_env);
32 30
33 // Calls exit(0) if a help option is given or if in completion 31 // Calls exit(0) if a help option is given or if in completion
34 // mode. If there are argument parsing errors, QPDFUsage is 32 // mode. If there are argument parsing errors, QPDFUsage is
35 // thrown. 33 // thrown.
36 - QPDF_DLL  
37 void parseArgs(); 34 void parseArgs();
38 35
39 // Return the program name as the last path element of the program 36 // Return the program name as the last path element of the program
40 // executable. 37 // executable.
41 - QPDF_DLL  
42 std::string getProgname(); 38 std::string getProgname();
43 39
44 // Methods for registering arguments. QPDFArgParser starts off 40 // Methods for registering arguments. QPDFArgParser starts off
@@ -52,32 +48,23 @@ class QPDFArgParser @@ -52,32 +48,23 @@ class QPDFArgParser
52 typedef std::function<void()> bare_arg_handler_t; 48 typedef std::function<void()> bare_arg_handler_t;
53 typedef std::function<void(std::string const&)> param_arg_handler_t; 49 typedef std::function<void(std::string const&)> param_arg_handler_t;
54 50
55 - QPDF_DLL  
56 void selectMainOptionTable(); 51 void selectMainOptionTable();
57 - QPDF_DLL  
58 void selectHelpOptionTable(); 52 void selectHelpOptionTable();
59 - QPDF_DLL  
60 void selectOptionTable(std::string const& name); 53 void selectOptionTable(std::string const& name);
61 54
62 // Register a new options table. This also selects the option table. 55 // Register a new options table. This also selects the option table.
63 - QPDF_DLL  
64 void registerOptionTable( 56 void registerOptionTable(
65 std::string const& name, bare_arg_handler_t end_handler); 57 std::string const& name, bare_arg_handler_t end_handler);
66 58
67 // Add handlers for options in the current table 59 // Add handlers for options in the current table
68 60
69 - QPDF_DLL  
70 void addPositional(param_arg_handler_t); 61 void addPositional(param_arg_handler_t);
71 - QPDF_DLL  
72 void addBare(std::string const& arg, bare_arg_handler_t); 62 void addBare(std::string const& arg, bare_arg_handler_t);
73 - QPDF_DLL  
74 void addRequiredParameter( 63 void addRequiredParameter(
75 std::string const& arg, 64 std::string const& arg,
76 param_arg_handler_t, 65 param_arg_handler_t,
77 char const* parameter_name); 66 char const* parameter_name);
78 - QPDF_DLL  
79 void addOptionalParameter(std::string const& arg, param_arg_handler_t); 67 void addOptionalParameter(std::string const& arg, param_arg_handler_t);
80 - QPDF_DLL  
81 void addChoices( 68 void addChoices(
82 std::string const& arg, 69 std::string const& arg,
83 param_arg_handler_t, 70 param_arg_handler_t,
@@ -88,12 +75,10 @@ class QPDFArgParser @@ -88,12 +75,10 @@ class QPDFArgParser
88 // an option that takes choices is to list all the choices. This 75 // an option that takes choices is to list all the choices. This
89 // may not be good if there are too many choices, so you can 76 // may not be good if there are too many choices, so you can
90 // provide your own handler in this case. 77 // provide your own handler in this case.
91 - QPDF_DLL  
92 void addInvalidChoiceHandler(std::string const& arg, param_arg_handler_t); 78 void addInvalidChoiceHandler(std::string const& arg, param_arg_handler_t);
93 79
94 // The final check handler is called at the very end of argument 80 // The final check handler is called at the very end of argument
95 // parsing. 81 // parsing.
96 - QPDF_DLL  
97 void addFinalCheck(bare_arg_handler_t); 82 void addFinalCheck(bare_arg_handler_t);
98 83
99 // Help generation methods 84 // Help generation methods
@@ -134,18 +119,15 @@ class QPDFArgParser @@ -134,18 +119,15 @@ class QPDFArgParser
134 119
135 // If provided, this footer is appended to all help, separated by 120 // If provided, this footer is appended to all help, separated by
136 // a blank line. 121 // a blank line.
137 - QPDF_DLL  
138 void addHelpFooter(std::string const&); 122 void addHelpFooter(std::string const&);
139 123
140 // Add a help topic along with the text for that topic 124 // Add a help topic along with the text for that topic
141 - QPDF_DLL  
142 void addHelpTopic( 125 void addHelpTopic(
143 std::string const& topic, 126 std::string const& topic,
144 std::string const& short_text, 127 std::string const& short_text,
145 std::string const& long_text); 128 std::string const& long_text);
146 129
147 // Add help for an option, and associate it with a topic. 130 // Add help for an option, and associate it with a topic.
148 - QPDF_DLL  
149 void addOptionHelp( 131 void addOptionHelp(
150 std::string const& option_name, 132 std::string const& option_name,
151 std::string const& topic, 133 std::string const& topic,
@@ -156,7 +138,6 @@ class QPDFArgParser @@ -156,7 +138,6 @@ class QPDFArgParser
156 // pointer returns the top-level help information. Passing an 138 // pointer returns the top-level help information. Passing an
157 // unknown value returns a string directing the user to run the 139 // unknown value returns a string directing the user to run the
158 // top-level --help option. 140 // top-level --help option.
159 - QPDF_DLL  
160 std::string getHelp(std::string const& topic_or_option); 141 std::string getHelp(std::string const& topic_or_option);
161 142
162 // Convenience methods for adding member functions of a class as 143 // Convenience methods for adding member functions of a class as
@@ -176,23 +157,19 @@ class QPDFArgParser @@ -176,23 +157,19 @@ class QPDFArgParser
176 157
177 // When processing arguments, indicate how many arguments remain 158 // When processing arguments, indicate how many arguments remain
178 // after the one whose handler is being called. 159 // after the one whose handler is being called.
179 - QPDF_DLL  
180 int argsLeft() const; 160 int argsLeft() const;
181 161
182 // Indicate whether we are in completion mode. 162 // Indicate whether we are in completion mode.
183 - QPDF_DLL  
184 bool isCompleting() const; 163 bool isCompleting() const;
185 164
186 // Insert a completion during argument parsing; useful for 165 // Insert a completion during argument parsing; useful for
187 // customizing completion in the position argument handler. Should 166 // customizing completion in the position argument handler. Should
188 // only be used in completion mode. 167 // only be used in completion mode.
189 - QPDF_DLL  
190 void insertCompletion(std::string const&); 168 void insertCompletion(std::string const&);
191 169
192 // Throw a Usage exception with the given message. In completion 170 // Throw a Usage exception with the given message. In completion
193 // mode, this just exits to prevent errors from partial commands 171 // mode, this just exits to prevent errors from partial commands
194 // or other error messages from messing up completion. 172 // or other error messages from messing up completion.
195 - QPDF_DLL  
196 void usage(std::string const& message); 173 void usage(std::string const& message);
197 174
198 private: 175 private:
@@ -259,7 +236,6 @@ class QPDFArgParser @@ -259,7 +236,6 @@ class QPDFArgParser
259 friend class QPDFArgParser; 236 friend class QPDFArgParser;
260 237
261 public: 238 public:
262 - QPDF_DLL  
263 ~Members() = default; 239 ~Members() = default;
264 240
265 private: 241 private:
libqpdf/qpdf/QPDFCrypto_gnutls.hh
1 #ifndef QPDFCRYPTO_GNUTLS_HH 1 #ifndef QPDFCRYPTO_GNUTLS_HH
2 #define QPDFCRYPTO_GNUTLS_HH 2 #define QPDFCRYPTO_GNUTLS_HH
3 3
4 -#include <qpdf/DLL.h>  
5 #include <qpdf/QPDFCryptoImpl.hh> 4 #include <qpdf/QPDFCryptoImpl.hh>
6 #include <memory> 5 #include <memory>
7 6
@@ -16,7 +15,6 @@ class QPDFCrypto_gnutls: public QPDFCryptoImpl @@ -16,7 +15,6 @@ class QPDFCrypto_gnutls: public QPDFCryptoImpl
16 public: 15 public:
17 QPDFCrypto_gnutls(); 16 QPDFCrypto_gnutls();
18 17
19 - QPDF_DLL  
20 virtual ~QPDFCrypto_gnutls(); 18 virtual ~QPDFCrypto_gnutls();
21 19
22 virtual void provideRandomData(unsigned char* data, size_t len); 20 virtual void provideRandomData(unsigned char* data, size_t len);
libqpdf/qpdf/QPDFCrypto_native.hh
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 #define QPDFCRYPTO_NATIVE_HH 2 #define QPDFCRYPTO_NATIVE_HH
3 3
4 #include <qpdf/AES_PDF_native.hh> 4 #include <qpdf/AES_PDF_native.hh>
5 -#include <qpdf/DLL.h>  
6 #include <qpdf/MD5_native.hh> 5 #include <qpdf/MD5_native.hh>
7 #include <qpdf/QPDFCryptoImpl.hh> 6 #include <qpdf/QPDFCryptoImpl.hh>
8 #include <qpdf/RC4_native.hh> 7 #include <qpdf/RC4_native.hh>
@@ -14,7 +13,6 @@ class QPDFCrypto_native: public QPDFCryptoImpl @@ -14,7 +13,6 @@ class QPDFCrypto_native: public QPDFCryptoImpl
14 public: 13 public:
15 QPDFCrypto_native() = default; 14 QPDFCrypto_native() = default;
16 15
17 - QPDF_DLL  
18 virtual ~QPDFCrypto_native() = default; 16 virtual ~QPDFCrypto_native() = default;
19 17
20 virtual void provideRandomData(unsigned char* data, size_t len); 18 virtual void provideRandomData(unsigned char* data, size_t len);
libqpdf/qpdf/QPDFCrypto_openssl.hh
@@ -26,8 +26,6 @@ class QPDFCrypto_openssl: public QPDFCryptoImpl @@ -26,8 +26,6 @@ class QPDFCrypto_openssl: public QPDFCryptoImpl
26 { 26 {
27 public: 27 public:
28 QPDFCrypto_openssl(); 28 QPDFCrypto_openssl();
29 -  
30 - QPDF_DLL  
31 ~QPDFCrypto_openssl() override; 29 ~QPDFCrypto_openssl() override;
32 30
33 void provideRandomData(unsigned char* data, size_t len) override; 31 void provideRandomData(unsigned char* data, size_t len) override;
libqpdf/qpdf/RC4.hh
@@ -9,11 +9,9 @@ class RC4 @@ -9,11 +9,9 @@ class RC4
9 { 9 {
10 public: 10 public:
11 // key_len of -1 means treat key_data as a null-terminated string 11 // key_len of -1 means treat key_data as a null-terminated string
12 - QPDF_DLL  
13 RC4(unsigned char const* key_data, int key_len = -1); 12 RC4(unsigned char const* key_data, int key_len = -1);
14 13
15 // out_data = 0 means to encrypt/decrypt in place 14 // out_data = 0 means to encrypt/decrypt in place
16 - QPDF_DLL  
17 void 15 void
18 process(unsigned char* in_data, size_t len, unsigned char* out_data = 0); 16 process(unsigned char* in_data, size_t len, unsigned char* out_data = 0);
19 17
libqpdf/qpdf/SecureRandomDataProvider.hh
1 #ifndef SECURERANDOMDATAPROVIDER_HH 1 #ifndef SECURERANDOMDATAPROVIDER_HH
2 #define SECURERANDOMDATAPROVIDER_HH 2 #define SECURERANDOMDATAPROVIDER_HH
3 3
4 -#include <qpdf/DLL.h>  
5 #include <qpdf/RandomDataProvider.hh> 4 #include <qpdf/RandomDataProvider.hh>
6 5
7 class SecureRandomDataProvider: public RandomDataProvider 6 class SecureRandomDataProvider: public RandomDataProvider
8 { 7 {
9 public: 8 public:
10 - QPDF_DLL  
11 SecureRandomDataProvider(); 9 SecureRandomDataProvider();
12 - QPDF_DLL  
13 virtual ~SecureRandomDataProvider(); 10 virtual ~SecureRandomDataProvider();
14 -  
15 - QPDF_DLL  
16 virtual void provideRandomData(unsigned char* data, size_t len); 11 virtual void provideRandomData(unsigned char* data, size_t len);
17 -  
18 - QPDF_DLL  
19 static RandomDataProvider* getInstance(); 12 static RandomDataProvider* getInstance();
20 }; 13 };
21 14
libqpdf/qpdf/SparseOHArray.hh
@@ -7,30 +7,19 @@ @@ -7,30 +7,19 @@
7 class SparseOHArray 7 class SparseOHArray
8 { 8 {
9 public: 9 public:
10 - QPDF_DLL  
11 SparseOHArray(); 10 SparseOHArray();
12 - QPDF_DLL  
13 size_t size() const; 11 size_t size() const;
14 - QPDF_DLL  
15 void append(QPDFObjectHandle oh); 12 void append(QPDFObjectHandle oh);
16 - QPDF_DLL  
17 QPDFObjectHandle at(size_t idx) const; 13 QPDFObjectHandle at(size_t idx) const;
18 - QPDF_DLL  
19 void remove_last(); 14 void remove_last();
20 - QPDF_DLL  
21 void releaseResolved(); 15 void releaseResolved();
22 - QPDF_DLL  
23 void setAt(size_t idx, QPDFObjectHandle oh); 16 void setAt(size_t idx, QPDFObjectHandle oh);
24 - QPDF_DLL  
25 void erase(size_t idx); 17 void erase(size_t idx);
26 - QPDF_DLL  
27 void insert(size_t idx, QPDFObjectHandle oh); 18 void insert(size_t idx, QPDFObjectHandle oh);
28 19
29 typedef std::unordered_map<size_t, QPDFObjectHandle>::const_iterator 20 typedef std::unordered_map<size_t, QPDFObjectHandle>::const_iterator
30 const_iterator; 21 const_iterator;
31 - QPDF_DLL  
32 const_iterator begin() const; 22 const_iterator begin() const;
33 - QPDF_DLL  
34 const_iterator end() const; 23 const_iterator end() const;
35 24
36 private: 25 private:
qpdf/sizes.cc
@@ -50,28 +50,6 @@ @@ -50,28 +50,6 @@
50 #define ignore_class(cls) 50 #define ignore_class(cls)
51 #define print_size(cls) std::cout << #cls << " " << sizeof(cls) << std::endl 51 #define print_size(cls) std::cout << #cls << " " << sizeof(cls) << std::endl
52 52
53 -// These classes are not really public.  
54 -// ------  
55 -ignore_class(BitStream);  
56 -ignore_class(BitWriter);  
57 -ignore_class(CryptoRandomDataProvider);  
58 -ignore_class(InsecureRandomDataProvider);  
59 -ignore_class(JSONHandler);  
60 -ignore_class(MD5);  
61 -ignore_class(Pl_AES_PDF);  
62 -ignore_class(Pl_ASCII85Decoder);  
63 -ignore_class(Pl_ASCIIHexDecoder);  
64 -ignore_class(Pl_LZWDecoder);  
65 -ignore_class(Pl_MD5);  
66 -ignore_class(Pl_PNGFilter);  
67 -ignore_class(Pl_RC4);  
68 -ignore_class(Pl_SHA2);  
69 -ignore_class(Pl_TIFFPredictor);  
70 -ignore_class(QPDFArgParser);  
71 -ignore_class(RC4);  
72 -ignore_class(SecureRandomDataProvider);  
73 -ignore_class(SparseOHArray);  
74 -  
75 // This is public because of QPDF_DLL_CLASS on InputSource 53 // This is public because of QPDF_DLL_CLASS on InputSource
76 // ------- 54 // -------
77 ignore_class(InputSource::Members); 55 ignore_class(InputSource::Members);