summaryrefslogtreecommitdiff
blob: 489ff25fa006e6af2b56e688a0f930c18c0264d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
From 19462cf1b5628d7251cde91031a0635e636d890a Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Date: Sat, 12 Jan 2019 21:59:07 +0100
Subject: [PATCH] Fix build with poppler-0.72

---
 texk/web2c/luatexdir/image/pdftoepdf.w |  2 +-
 texk/web2c/luatexdir/lua/lepdflib.cc   | 16 ++++++++--------
 texk/web2c/pdftexdir/pdftoepdf.cc      |  4 ++--
 texk/web2c/pdftexdir/pdftosrc.cc       |  6 +++---
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/texk/web2c/luatexdir/image/pdftoepdf.w b/texk/web2c/luatexdir/image/pdftoepdf.w
index aa1d7f25..2f143068 100644
--- a/texk/web2c/luatexdir/image/pdftoepdf.w
+++ b/texk/web2c/luatexdir/image/pdftoepdf.w
@@ -366,7 +366,7 @@ static void copyString(PDF pdf, GooString * string)
     const char *p;
     unsigned char c;
     size_t i, l;
-    p = string->getCString();
+    p = string->c_str();
     l = (size_t) string->getLength();
     if (pdf->cave)
         pdf_out(pdf, ' ');
diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lepdflib.cc
index 01f9415c..6b24a39b 100644
--- a/texk/web2c/luatexdir/lua/lepdflib.cc
+++ b/texk/web2c/luatexdir/lua/lepdflib.cc
@@ -523,7 +523,7 @@ static int m_##in##_##function(lua_State * L)                  \
         pdfdoc_changed_error(L);                               \
     gs = (GooString *)((in *) uin->d)->function();             \
     if (gs != NULL)                                            \
-        lua_pushlstring(L, gs->getCString(), gs->getLength()); \
+        lua_pushlstring(L, gs->c_str(), gs->getLength()); \
     else                                                       \
         lua_pushnil(L);                                        \
     return 1;                                                  \
@@ -758,7 +758,7 @@ static int m_Array_getString(lua_State * L)
     if (i > 0 && i <= len) {
         gs = new GooString();
         if (((Array *) uin->d)->getString(i - 1, gs))
-            lua_pushlstring(L, gs->getCString(), gs->getLength());
+            lua_pushlstring(L, gs->c_str(), gs->getLength());
         else
             lua_pushnil(L);
         delete gs;
@@ -910,7 +910,7 @@ static int m_Catalog_getJS(lua_State * L)
     if (i > 0 && i <= len) {
         gs = ((Catalog *) uin->d)->getJS(i - 1);
         if (gs != NULL)
-            lua_pushlstring(L, gs->getCString(), gs->getLength());
+            lua_pushlstring(L, gs->c_str(), gs->getLength());
         else
             lua_pushnil(L);
         delete gs;
@@ -1225,7 +1225,7 @@ static int m_GooString__tostring(lua_State * L)
     uin = (udstruct *) luaL_checkudata(L, 1, M_GooString);
     if (uin->pd != NULL && uin->pd->pc != uin->pc)
         pdfdoc_changed_error(L);
-    lua_pushlstring(L, ((GooString *) uin->d)->getCString(),
+    lua_pushlstring(L, ((GooString *) uin->d)->c_str(),
                     ((GooString *) uin->d)->getLength());
     return 1;
 }
@@ -1657,7 +1657,7 @@ static int m_Object_getString(lua_State * L)
         pdfdoc_changed_error(L);
     if (((Object *) uin->d)->isString()) {
         gs = (GooString *)((Object *) uin->d)->getString();
-        lua_pushlstring(L, gs->getCString(), gs->getLength());
+        lua_pushlstring(L, gs->c_str(), gs->getLength());
     } else
         lua_pushnil(L);
     return 1;
@@ -2315,7 +2315,7 @@ static int m_PDFDoc_getFileName(lua_State * L)
         pdfdoc_changed_error(L);
     gs = ((PdfDocument *) uin->d)->doc->getFileName();
     if (gs != NULL)
-        lua_pushlstring(L, gs->getCString(), gs->getLength());
+        lua_pushlstring(L, gs->c_str(), gs->getLength());
     else
         lua_pushnil(L);
     return 1;
@@ -2404,7 +2404,7 @@ static int m_PDFDoc_readMetadata(lua_State * L)
     if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
         gs = ((PdfDocument *) uin->d)->doc->readMetadata();
         if (gs != NULL)
-            lua_pushlstring(L, gs->getCString(), gs->getLength());
+            lua_pushlstring(L, gs->c_str(), gs->getLength());
         else
             lua_pushnil(L);
     } else
@@ -3078,7 +3078,7 @@ static int m_StructElement_getText(lua_State * L)
     i = (bool) lua_toboolean(L, 2);
     gs =  ((StructElement *) uin->d)->getText(i);
     if (gs != NULL)
-        lua_pushlstring(L, gs->getCString(), gs->getLength());
+        lua_pushlstring(L, gs->c_str(), gs->getLength());
     else
         lua_pushnil(L);
     return 1;
diff --git a/texk/web2c/pdftexdir/pdftoepdf.cc b/texk/web2c/pdftexdir/pdftoepdf.cc
index e353b652..84e9f7ce 100644
--- a/texk/web2c/pdftexdir/pdftoepdf.cc
+++ b/texk/web2c/pdftexdir/pdftoepdf.cc
@@ -422,7 +422,7 @@ static void copyFont(const char *tag, Object * fontRef)
         charset = fontdesc.dictLookup("CharSet");
         if (!charset.isNull() &&
             charset.isString() && is_subsetable(fontmap))
-            epdf_mark_glyphs(fd, (char *)charset.getString()->getCString());
+            epdf_mark_glyphs(fd, (char *)charset.getString()->c_str());
         else
             embed_whole_font(fd);
         addFontDesc(fontdescRef.getRef(), fd);
@@ -561,7 +561,7 @@ static void copyObject(Object * obj)
         pdf_printf("%s", convertNumToPDF(obj->getNum()));
     } else if (obj->isString()) {
         s = (GooString *)obj->getString();
-        p = s->getCString();
+        p = s->c_str();
         l = s->getLength();
         if (strlen(p) == (unsigned int) l) {
             pdf_puts("(");
diff --git a/texk/web2c/pdftexdir/pdftosrc.cc b/texk/web2c/pdftexdir/pdftosrc.cc
index 22ab6bdc..bad1b78f 100644
--- a/texk/web2c/pdftexdir/pdftosrc.cc
+++ b/texk/web2c/pdftexdir/pdftosrc.cc
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
             fprintf(stderr, "No SourceName found\n");
             exit(1);
         }
-        outname = (char *)srcName.getString()->getCString();
+        outname = (char *)srcName.getString()->c_str();
         // We cannot free srcName, as objname shares its string.
         // srcName.free();
     } else if (objnum > 0) {
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
             fprintf(stderr, "Not a Stream object\n");
             exit(1);
         }
-        sprintf(buf, "%s", fileName->getCString());
+        sprintf(buf, "%s", fileName->c_str());
         if ((p = strrchr(buf, '.')) == 0)
             p = strchr(buf, 0);
         if (objgen == 0)
@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
         outname = buf;
     } else {                    // objnum < 0 means we are extracting the XRef table
         extract_xref_table = true;
-        sprintf(buf, "%s", fileName->getCString());
+        sprintf(buf, "%s", fileName->c_str());
         if ((p = strrchr(buf, '.')) == 0)
             p = strchr(buf, 0);
         sprintf(p, ".xref");
-- 
2.20.1