summaryrefslogtreecommitdiff
path: root/bk_pdf.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2004-04-20 17:50:41 +0000
committerSimon Tatham <anakin@pobox.com>2004-04-20 17:50:41 +0000
commit2b6def26f41457eba8f2056432cd1af68a5b58b0 (patch)
tree6bc7c479673f48b7e488ea383c6076d4f28cf0fc /bk_pdf.c
parent8a9d3f97956db97b0813a6d24c486371ff14bd80 (diff)
downloadhalibut-2b6def26f41457eba8f2056432cd1af68a5b58b0.zip
halibut-2b6def26f41457eba8f2056432cd1af68a5b58b0.tar.gz
halibut-2b6def26f41457eba8f2056432cd1af68a5b58b0.tar.bz2
halibut-2b6def26f41457eba8f2056432cd1af68a5b58b0.tar.xz
Infrastructure changes for character set support. ustrtoa,
ustrfroma, utoa_dup and ufroma_dup now take a charset parameter, and also have a variety of subtly distinct forms. Also, when a \cfg directive is seen in the input file, the precise octet strings for each parameter are kept in their original form as well as being translated into Unicode, so that when they represent filenames they can be used verbatim. [originally from svn r4097]
Diffstat (limited to 'bk_pdf.c')
-rw-r--r--bk_pdf.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/bk_pdf.c b/bk_pdf.c
index f6babe5..e9904e7 100644
--- a/bk_pdf.c
+++ b/bk_pdf.c
@@ -10,30 +10,7 @@
paragraph *pdf_config_filename(char *filename)
{
- paragraph *p;
- wchar_t *ufilename, *up;
- int len;
-
- p = mknew(paragraph);
- memset(p, 0, sizeof(*p));
- p->type = para_Config;
- p->next = NULL;
- p->fpos.filename = "<command line>";
- p->fpos.line = p->fpos.col = -1;
-
- ufilename = ufroma_dup(filename);
- len = ustrlen(ufilename) + 2 + lenof(L"pdf-filename");
- p->keyword = mknewa(wchar_t, len);
- up = p->keyword;
- ustrcpy(up, L"pdf-filename");
- up = uadv(up);
- ustrcpy(up, ufilename);
- up = uadv(up);
- *up = L'\0';
- assert(up - p->keyword < len);
- sfree(ufilename);
-
- return p;
+ return cmdline_cfg_simple("pdf-filename", filename, NULL);
}
typedef struct object_Tag object;
@@ -88,7 +65,7 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords,
if (p->type == para_Config && p->parent) {
if (!ustricmp(p->keyword, L"pdf-filename")) {
sfree(filename);
- filename = utoa_dup(uadv(p->keyword));
+ filename = dupstr(adv(p->origkeyword));
}
}
}
@@ -742,7 +719,7 @@ static int pdf_versionid(FILE *fp, word *words)
switch (type) {
case word_Normal:
- text = utoa_dup(words->text);
+ text = utoa_dup(words->text, CS_ASCII);
break;
case word_WhiteSpace:
text = dupstr(" ");