File: extend-c-api.h

package info (click to toggle)
qpdf 12.3.2-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 72,660 kB
  • sloc: cpp: 59,054; perl: 12,189; ansic: 6,809; sh: 1,231; python: 1,041; xml: 43; makefile: 42
file content (25 lines) | stat: -rw-r--r-- 736 bytes parent folder | download | duplicates (2)
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
#ifndef EXAMPLE_C_EXTEND_H
#define EXAMPLE_C_EXTEND_H

/*
 * This is an example of how to write C++ functions and make them usable with the qpdf C API. It
 * consists of three files:
 * - extend-c-api.h -- a plain C header file
 * - extend-c-api.c -- a C program that calls the function
 * - extend-c-api.cc -- a C++ file that implements the function
 */
#include <qpdf/qpdf-c.h>

/* Declare your custom function to return QPDF_ERROR_CODE and take qpdf_data and anything else you
 * need. Any errors are retrievable through the qpdf C APIs normal error-handling mechanism.
 */

#ifdef __cplusplus
extern "C" {
#endif
    QPDF_ERROR_CODE num_pages(qpdf_data qc, int* npages);
#ifdef __cplusplus
}
#endif

#endif /* EXAMPLE_C_EXTEND_H */