summaryrefslogtreecommitdiff
path: root/src/pdflib/pdcore/pc_resource.h
blob: f83498c726625995cf2839e3b5aae83f6573f04f (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
/*---------------------------------------------------------------------------*
 |              PDFlib - A library for generating PDF on the fly             |
 +---------------------------------------------------------------------------+
 | Copyright (c) 1997-2006 Thomas Merz and PDFlib GmbH. All rights reserved. |
 +---------------------------------------------------------------------------+
 |                                                                           |
 |    This software is subject to the PDFlib license. It is NOT in the       |
 |    public domain. Extended versions and commercial licenses are           |
 |    available, please check http://www.pdflib.com.                         |
 |                                                                           |
 *---------------------------------------------------------------------------*/

/* $Id: pc_resource.h,v 1.1 2008/10/17 06:10:43 scuri Exp $
 *
 * Resource routines
 *
 */

#ifndef PC_RESOURCE_H
#define PC_RESOURCE_H

/* pdcore logg classes (maximal PDC_CLASSLIST_SIZE) */
typedef enum
{
    trc_other = 0,      /* other classes */
    trc_api,            /* API function call logging */
    trc_encoding,       /* encoding, cmap end textformat logging */
    trc_digsig,         /* digital signatures */
    trc_filesearch,     /* file search logging */
    trc_font,           /* font logging */
    trc_image,          /* image and template logging */
    trc_memory,         /* memory logging */
    trc_optlist,        /* optlist logging */
    trc_pcos,           /* pcos logging */
    trc_pdi,            /* pdi logging */
    trc_resource,       /* resource logging */
    trc_shadow,         /* shadow logging */
    trc_text,           /* text logging */
    trc_textflow,       /* textflow logging */
    trc_table,          /* table logging */
    trc_user,           /* user logging */
    trc_warning,        /* logging of disabled warnings */
    trc_wordfinder,     /* word finder logging */
    trc_xmp,            /* xmp logging */
    trc_zones           /* zones logging */
}
pdc_logg_class;

/* string code kinds */
typedef enum
{
    strform_readable,
    strform_readable0,
    strform_octal,
    strform_hexa,
    strform_java
}
pdc_strform_kind;


typedef struct pdc_res_s pdc_res;
typedef struct pdc_category_s pdc_category;
typedef struct pdc_reslist_s pdc_reslist;
typedef struct pdc_virtfile_s pdc_virtfile;
typedef struct pdc_loggdef_s pdc_loggdef;


/* -------------------------- resource handling ----------------------------- */

pdc_reslist *pdc_new_reslist(pdc_core *pdc);
void pdc_delete_reslist(pdc_core *pdc);
void pdc_set_resourcefile(pdc_core *pdc, const char *filename);
void pdc_add_resource_ext(pdc_core *pdc, const char *category,
        const char *resname, const char *resvalue, pdc_encoding enc,
        int codepage);
void pdc_add_resource(pdc_core *pdc, const char *category,
        const char *resname, const char *resvalue);
const char *pdc_find_resource(pdc_core *pdc, const char *category,
        const char *name);
const char *pdc_find_resource_nr(pdc_core *pdc, const char *category, int nr);
const char *pdc_get_resourcefile(pdc_core *pdc);



/* ----------------------- virtual file handling ---------------------------- */

void pdc__create_pvf(pdc_core *pdc, const char *filename,
        const void *data, size_t size, const char *optlist);
int pdc__delete_pvf(pdc_core *pdc, const char *filename);
void pdc_lock_pvf(pdc_core *pdc, const char *filename);
void pdc_unlock_pvf(pdc_core *pdc, const char *filename);
void pdc_delete_filesystem(pdc_core *pdc);


/* ----------------------- logging file handling ---------------------------- */

void pdc_delete_logg(pdc_core *pdc);
void pdc_set_logg_options(pdc_core *pdc, const char *optlist);
const char *pdc_print_loggstring(pdc_core *pdc, const char *str, int len);
pdc_bool pdc_enter_api_logg(pdc_core *pdc, const char *funame,
        pdc_bool enter_api, const char *fmt, va_list args);
void pdc_logg_exit_api(pdc_core *pdc, pdc_bool cleanup,
                           const char *fmt, ...);
void pdc_logg_enable(pdc_core *pdc, pdc_bool enable);
pdc_bool pdc_logg_is_enabled(pdc_core *pdc, int level, int pclass);
void pdc_logg(pdc_core *pdc, const char *fmt, ...);
void pdc_logg_cond(pdc_core *pdc, int level, int pclass,
                           const char *fmt, ...);
void pdc_logg_bitarr(pdc_core *pdc, const char *msg, const char *bitarr,
        int nbit);
void pdc_logg_hexdump(pdc_core *pdc, const char *msg,  const char *prefix,
        const char *text, int tlen);
void pdc_warning(pdc_core *pdc, int errnum, const char *parm1,
        const char *parm2, const char *parm3, const char *parm4);

void pdc_logg_unichar(pdc_core *pdc, int unichar, pdc_bool kfill,
        pdc_bool newline);
void pdc_logg_unitext(pdc_core *pdc, pdc_ushort *ustext, int len,
        pdc_bool newline);

int pdc_logg_getlevel(pdc_core *pdc, int pclass);

#endif  /* PC_RESOURCE_H */