mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2025-02-13 23:42:51 +01:00
Fill out basic API functions.
This commit is contained in:
parent
4a33f3f6f1
commit
c2610f2dd0
9
Makefile
9
Makefile
@ -37,9 +37,14 @@ prefix = /usr/local
|
||||
|
||||
# Files
|
||||
LIBOBJS = \
|
||||
pdfio-array.o \
|
||||
pdfio-common.o \
|
||||
pdfio-read.o \
|
||||
pdfio-write.o
|
||||
pdfio-dict.o \
|
||||
pdfio-file.o \
|
||||
pdfio-object.o \
|
||||
pdfio-page.o \
|
||||
pdfio-stream.o \
|
||||
pdfio-value.o
|
||||
OBJS = \
|
||||
$(LIBOBJS) \
|
||||
testpdfio.o
|
||||
|
169
pdfio-array.c
Normal file
169
pdfio-array.c
Normal file
@ -0,0 +1,169 @@
|
||||
//
|
||||
// PDF array functions for pdfio.
|
||||
//
|
||||
// Copyright © 2021 by Michael R Sweet.
|
||||
//
|
||||
// Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
// information.
|
||||
//
|
||||
|
||||
//
|
||||
// Include necessary headers...
|
||||
//
|
||||
|
||||
#include "pdfio-private.h"
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioArrayAppendArray(pdfio_array_t *a, pdfio_array_t *value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioArrayAppendBoolean(pdfio_array_t *a, boolean value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioArrayAppendDict(pdfio_array_t *a, pdfio_dict_t *value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioArrayAppendName(pdfio_array_t *a, const char *value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioArrayAppendNumber(pdfio_array_t *a, float value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioArrayAppendObject(pdfio_array_t *a, pdfio_obj_t *value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioArrayAppendString(pdfio_array_t *a, const char *value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_array_t *pdfioArrayCreate(pdfio_file_t *file)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_array_t *pdfioArrayGetArray(pdfio_array_t *a, int n)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioArrayGetBoolean(pdfio_array_t *a, int n)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_dict_t *pdfioArrayGetDict(pdfio_array_t *a, int n)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
const char *pdfioArrayGetName(pdfio_array_t *a, int n)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
float pdfioArrayGetNumber(pdfio_array_t *a, int n)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_obj_t *pdfioArrayGetObject(pdfio_array_t *a, int n)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
int pdfioArrayGetSize(pdfio_array_t *a)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
const char *pdfioArrayGetString(pdfio_array_t *a, int n)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_valtype_t pdfioArrayGetType(pdfio_array_t *a, int n)
|
||||
{
|
||||
}
|
||||
|
||||
|
194
pdfio-dict.c
Normal file
194
pdfio-dict.c
Normal file
@ -0,0 +1,194 @@
|
||||
//
|
||||
// PDF dictionary functions for pdfio.
|
||||
//
|
||||
// Copyright © 2021 by Michael R Sweet.
|
||||
//
|
||||
// Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
// information.
|
||||
//
|
||||
|
||||
//
|
||||
// Include necessary headers...
|
||||
//
|
||||
|
||||
#include "pdfio-private.h"
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_dict_t *pdfioDictCreate(pdfio_file_t *file)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_array_t *pdfioDictGetArray(pdfio_dict_t *dict, const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioDictGetBoolean(pdfio_dict_t *dict, const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_dict_t *pdfioDictGetDict(pdfio_dict_t *dict, const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
const char *pdfioDictGetName(pdfio_dict_t *dict, const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
float pdfioDictGetNumber(pdfio_dict_t *dict, const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_obj_t *pdfioDictGetObject(pdfio_dict_t *dict, const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_rect_t *pdfioDictGetRect(pdfio_dict_t *dict, const char *name, pdfio_rect_t *rect)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
const char *pdfioDictGetString(pdfio_dict_t *dict, const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_valtype_t pdfioDictGetType(pdfio_dict_t *dict, const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioDictSetArray(pdfio_dict_t *dict, const char *name, pdfio_array_t *value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioDictSetBoolean(pdfio_dict_t *dict, const char *name, bool value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioDictSetDict(pdfio_dict_t *dict, const char *name, pdfio_dict_t *value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioDictSetName(pdfio_dict_t *dict, const char *name, const char *value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioDictSetNull(pdfio_dict_t *dict, const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioDictSetNumber(pdfio_dict_t *dict, const char *name, float value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioDictSetObject(pdfio_dict_t *dict, const char *name, pdfio_obj_t *value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioDictSetRect(pdfio_dict_t *dict, const char *name, pdfio_rect_t *value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioDictSetString(pdfio_dict_t *dict, const char *name, const char *value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioDictSetStringf(pdfio_dict_t *dict, const char *name, const char *format, ...)
|
||||
{
|
||||
}
|
97
pdfio-file.c
Normal file
97
pdfio-file.c
Normal file
@ -0,0 +1,97 @@
|
||||
//
|
||||
// PDF file functions for pdfio.
|
||||
//
|
||||
// Copyright © 2021 by Michael R Sweet.
|
||||
//
|
||||
// Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
// information.
|
||||
//
|
||||
|
||||
//
|
||||
// Include necessary headers...
|
||||
//
|
||||
|
||||
#include "pdfio-private.h"
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioFileClose(pdfio_file_t *pdf)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_obj_t *pdfioFileCreateObject(pdfio_file_t *file, pdfio_dict_t *dict)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_obj_t *pdfioFileCreatePage(pdfio_t *pdf, pdfio_dict_t *dict)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
const char *pdfioFileGetName(pdfio_file_t *pdf)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
int pdfioFileGetNumObjects(pdfio_file_t *pdf)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
int pdfioFileGetNumPages(pdfio_file_t *pdf)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_obj_t *pdfioFileGetObject(pdfio_file_t *pdf, int number)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_obj_t *pdfioFileGetPage(pdfio_file_t *pdf, int number)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_file_t *pdfioFileOpen(const char *filename, const char *mode, pdfio_error_cb_t error_cb, void *error_data)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// PDF writing functions for pdfio.
|
||||
// PDF object functions for pdfio.
|
||||
//
|
||||
// Copyright © 2021 by Michael R Sweet.
|
||||
//
|
||||
@ -12,3 +12,5 @@
|
||||
//
|
||||
|
||||
#include "pdfio-private.h"
|
||||
|
||||
|
23
pdfio-page.c
Normal file
23
pdfio-page.c
Normal file
@ -0,0 +1,23 @@
|
||||
//
|
||||
// PDF page functions for pdfio.
|
||||
//
|
||||
// Copyright © 2021 by Michael R Sweet.
|
||||
//
|
||||
// Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
// information.
|
||||
//
|
||||
|
||||
//
|
||||
// Include necessary headers...
|
||||
//
|
||||
|
||||
#include "pdfio-private.h"
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
pdfio_obj_t *pdfioPageCopy(pdfio_t *pdf, pdfio_obj_t *src)
|
||||
{
|
||||
}
|
61
pdfio-stream.c
Normal file
61
pdfio-stream.c
Normal file
@ -0,0 +1,61 @@
|
||||
//
|
||||
// PDF stream functions for pdfio.
|
||||
//
|
||||
// Copyright © 2021 by Michael R Sweet.
|
||||
//
|
||||
// Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
// information.
|
||||
//
|
||||
|
||||
//
|
||||
// Include necessary headers...
|
||||
//
|
||||
|
||||
#include "pdfio-private.h"
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioStreamClose(pdfio_stream_t *st)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioStreamPrintf(pdfio_stream_t *st, const char *format, ...)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioStreamPuts(pdfio_stream_t *st, const char *s)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
ssize_t pdfioStreamRead(pdfio_stream_t *st, void *buffer, size_t bytes)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// '()' - .
|
||||
//
|
||||
|
||||
bool pdfioStreamWrite(pdfio_stream_t *st, const void *buffer, size_t bytes)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// PDF reading functions for pdfio.
|
||||
// PDF value functions for pdfio.
|
||||
//
|
||||
// Copyright © 2021 by Michael R Sweet.
|
||||
//
|
18
pdfio.h
18
pdfio.h
@ -88,6 +88,24 @@ typedef struct _pdfio_value_s pdf_value_t;
|
||||
// Functions...
|
||||
//
|
||||
|
||||
extern bool pdfioArrayAppendArray(pdfio_array_t *a, pdfio_array_t *value) PDFIO_PUBLIC;
|
||||
extern bool pdfioArrayAppendBoolean(pdfio_array_t *a, boolean value) PDFIO_PUBLIC;
|
||||
extern bool pdfioArrayAppendDict(pdfio_array_t *a, pdfio_dict_t *value) PDFIO_PUBLIC;
|
||||
extern bool pdfioArrayAppendName(pdfio_array_t *a, const char *value) PDFIO_PUBLIC;
|
||||
extern bool pdfioArrayAppendNumber(pdfio_array_t *a, float value) PDFIO_PUBLIC;
|
||||
extern bool pdfioArrayAppendObject(pdfio_array_t *a, pdfio_obj_t *value) PDFIO_PUBLIC;
|
||||
extern bool pdfioArrayAppendString(pdfio_array_t *a, const char *value) PDFIO_PUBLIC;
|
||||
extern pdfio_array_t *pdfioArrayCreate(pdfio_file_t *file) PDFIO_PUBLIC;
|
||||
extern pdfio_array_t *pdfioArrayGetArray(pdfio_array_t *a, int n) PDFIO_PUBLIC;
|
||||
extern bool pdfioArrayGetBoolean(pdfio_array_t *a, int n) PDFIO_PUBLIC;
|
||||
extern pdfio_dict_t *pdfioArrayGetDict(pdfio_array_t *a, int n) PDFIO_PUBLIC;
|
||||
extern const char *pdfioArrayGetName(pdfio_array_t *a, int n) PDFIO_PUBLIC;
|
||||
extern float pdfioArrayGetNumber(pdfio_array_t *a, int n) PDFIO_PUBLIC;
|
||||
extern pdfio_obj_t *pdfioArrayGetObject(pdfio_array_t *a, int n) PDFIO_PUBLIC;
|
||||
extern int pdfioArrayGetSize(pdfio_array_t *a) PDFIO_PUBLIC;
|
||||
extern const char *pdfioArrayGetString(pdfio_array_t *a, int n) PDFIO_PUBLIC;
|
||||
extern pdfio_valtype_t pdfioArrayGetType(pdfio_array_t *a, int n) PDFIO_PUBLIC;
|
||||
|
||||
extern pdfio_dict_t *pdfioDictCreate(pdfio_file_t *file) PDFIO_PUBLIC;
|
||||
extern pdfio_array_t *pdfioDictGetArray(pdfio_dict_t *dict, const char *name) PDFIO_PUBLIC;
|
||||
extern bool pdfioDictGetBoolean(pdfio_dict_t *dict, const char *name) PDFIO_PUBLIC;
|
||||
|
Loading…
x
Reference in New Issue
Block a user