summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-22 21:25:44 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-22 21:25:44 -0300
commit125606db21189d9d9e3f7580889d0b7c2400f6ad (patch)
tree317e4504a35311c43d66d912577988a9eb86962c /gfx
parent2367b4801413e9b9ef5676e52cdfec9fe70455f7 (diff)
downloadeeshow-125606db21189d9d9e3f7580889d0b7c2400f6ad.tar.gz
eeshow-125606db21189d9d9e3f7580889d0b7c2400f6ad.tar.bz2
eeshow-125606db21189d9d9e3f7580889d0b7c2400f6ad.zip
eeshow/gfx/pdftoc.c: use strbegins instead of local "begins"
Diffstat (limited to 'gfx')
-rw-r--r--gfx/pdftoc.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/gfx/pdftoc.c b/gfx/pdftoc.c
index cf45859..c24d0d4 100644
--- a/gfx/pdftoc.c
+++ b/gfx/pdftoc.c
@@ -69,12 +69,6 @@ struct pdftoc {
};
-static bool begins(const char *s, const char *pfx)
-{
- return !strncmp(s, pfx, strlen(pfx));
-}
-
-
struct pdftoc *pdftoc_begin(const char *file)
{
struct pdftoc *ctx;
@@ -149,27 +143,27 @@ static void line(struct pdftoc *ctx, const char *s)
ctx->state = object;
break;
}
- if (begins(s, "xref")) {
+ if (strbegins(s, "xref")) {
ctx->state = xref;
break;
}
break;
case object:
- if (begins(s, "endobj")) {
+ if (strbegins(s, "endobj")) {
ctx->state = idle;
break;
}
- if (begins(s, "<< /Type /Page")) {
+ if (strbegins(s, "<< /Type /Page")) {
ctx->curr_obj->is_page = 1;
break;
}
- if (begins(s, "<< /Type /Catalog")) {
+ if (strbegins(s, "<< /Type /Catalog")) {
ctx->state = catalog;
break;
}
break;
case catalog:
- if (begins(s, ">>")) {
+ if (strbegins(s, ">>")) {
ctx->state = object;
ctx->pos += fprintf(ctx->file,
" /Outlines %u 0 R\n",