-
Notifications
You must be signed in to change notification settings - Fork 7
/
ifiction.h
54 lines (45 loc) · 1.86 KB
/
ifiction.h
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
/* ifiction.h declarations for the babel ifiction API
* (c) 2006 By L. Ross Raszewski
*
* This code is freely usable for all purposes.
*
* This work is licensed under the Creative Commons Attribution 4.0 License.
* To view a copy of this license, visit
* https://creativecommons.org/licenses/by/4.0/ or send a letter to
* Creative Commons,
* PO Box 1866,
* Mountain View, CA 94042, USA.
*
*/
#ifndef IFICTION_H
#define IFICTION_H
#include "treaty.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Babel's notion of an XML tag */
struct XMLTag
{
int32 beginl; /* Beginning line number */
char tag[256]; /* name of the tag */
char fulltag[256]; /* Full text of the opening tag */
char *begin; /* Points to the beginning of the tag's content */
char *end; /* Points to the end of the tag's content.
setting *end=0 will turn begin into a string
containing the tag's content (But if you do this, you
should restore the original value of *end before
allowing control to return to the ifiction parser) */
char occurences[256]; /* Tables used internally to find missing required tags */
char rocurrences[256];
struct XMLTag *next; /* The tag's parent */
};
typedef void (*IFCloseTag)(struct XMLTag *, void *);
typedef void (*IFErrorHandler)(char *, void *);
void ifiction_parse(char *md, IFCloseTag close_tag, void *close_ctx, IFErrorHandler error_handler, void *error_ctx);
int32 ifiction_get_IFID(char *metadata, char *output, int32 output_extent);
char *ifiction_get_tag(char *md, char *p, char *t, char *from);
int32 find_uuid_ifid_marker(void *sf, int32 extent, char *output, int32 output_extent);
#ifdef __cplusplus
}
#endif
#endif