summaryrefslogtreecommitdiff
path: root/support/dktools/hbindex.h
blob: 311319eb12eec34748194ae7210883c2683042c0 (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
/*
	WARNING: This file was generated by dkct.
	Changes you make here will be lost if dkct is run again!
	You should modify the original source and run dkct on it.
	Original source: hbindex.ctr
*/

/**	@file hbindex.h Header file for the hbindex module.
*/

#ifndef HBINDEX_H_INCLUDED
/** Avoid multiple inclusions. */
#define HBINDEX_H_INCLUDED 1


#line 4 "hbindex.ctr"

#ifdef __cplusplus
extern "C" {
#endif

/**	Create index entry, allocate memory.
	@param	tx	Index text.
	@param	fn	File name.
	@param	an	Anchor name (optional).
	@param	ul	Anchor number, used if no anchor name specified.
	@param	app	Application structure for diagnostics, may be NULL.
	@param	nptr	Current node.
	@return	Pointer to new entry on success, NULL on error.
*/
hb_index_entry_t *
hbindex_new(
  dkChar const		*tx,
  dkChar const		*fn,
  dkChar const		*an,
  unsigned long	const	 ul,
  dk3_app_t		*app,
  hb_node_t		*nptr
);

/**	Destroy index entry, release memory.
	@param	pi	Index entry to destroy.
*/
void
hbindex_delete(hb_index_entry_t *pi);

/**	Compare two index entries.
	@param	l	Left entry.
	@param	r	Right entry or name.
	@param	cr	Comparison criteria (0=object/object, 1=object/name).
	@return	Comparison result.
*/
int
hbindex_compare(void const *l, void const *r, int cr);

/**	Write anchor name for index entry (either given name or number-based).
	@param	job	Job structure.
	@param	in	Index entry.
	@return	1 on success, 0 on error.
*/
int
hb_index_write_anchor(hb_job_t *job, hb_index_entry_t *in);

#ifdef __cplusplus
}
#endif


#endif