1BARCODE(3) GNU barcode BARCODE(3)
2
3
4
6 barcode - a library to create and print bar codes
7
9 #include <barcode.h>
10
11 struct Barcode_Item *Barcode_Create(char *text);
12 int Barcode_Delete(struct Barcode_Item *bc);
13 int Barcode_Encode(struct Barcode_Item *bc, int flags);
14 int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags);
15 int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, int
16 xoff, int yoff , double scalef);
17 int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, int
18 xoff, int yoff, int flags);
19 int Barcode_Version(char *versionname);
20
22 The barcode family of library functions is meant to ease creation of
23 bar-code printouts. The information below is extracted from the tex‐
24 info file, which is the preferred source of information.
25
26
27 The functions included in the barcode library are declared in the
28 header file barcode.h. They perform the following tasks:
29
30 struct Barcode_Item *Barcode_Create(char *text);
31 The function creates a new barcode object to deal with a speci‐
32 fied text string. It returns NULL in case of failure and a
33 pointer to a barcode data structure in case of success.
34
35 int Barcode_Delete(struct Barcode_Item *bc);
36 Destroy a barcode object. Always returns 0 (success)
37
38 int Barcode_Encode(struct Barcode_Item *bc, int flags);
39 Encode the text included in the bc object. Valid flags are the
40 encoding type (other flags are ignored) and BARCODE_NO_CHECKSUM
41 (other flags are silently ignored); if the flag argument is
42 zero, bc->flags will apply. The function returns 0 on success
43 and -1 in case of error. After successful termination the data
44 structure will host the description of the bar code and its tex‐
45 tual representation, after a failure the error field will
46 include the reason of the failure.
47
48 int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags);
49 Print the bar code described by bc to the specified file. Valid
50 flags are the output type, BARCODE_NO_ASCII and BAR‐
51 CODE_OUT_NOHEADERS, other flags are ignored. If any of these
52 flags is zero, it will be inherited from bc->flags which there‐
53 fore takes precedence. The function returns 0 on success and -1
54 in case of error (with bc->error set accordingly). In case of
55 success, the bar code is printed to the specified file, which
56 won't be closed after use.
57
58 int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, int
59 xoff, int yoff, double scalef);
60 The function is a shortcut to assign values to the data struc‐
61 ture.
62
63 int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, int
64 xoff, int yoff, int flags);
65 The function deals with the whole life of the barcode object by
66 calling the other functions; it uses all the specified flags.
67
68 int Barcode_Version(char *versionname);
69 Returns the current version as an integer number of the form
70 major * 10000 + minor * 100 + release. Therefore, version 1.03.5
71 will be returned as 10305 and version 0.53 as 5300. If the
72 argument is non-null, it will be used to return the version num‐
73 ber as a string. Note that the same information is available
74 from two preprocessor macros: BARCODE_VERSION (the string) and
75 BARCODE_VERSION_INT (the integer number).
76
77
78
794th Berkeley Distribution October 1999 BARCODE(3)