File: 0006-Bring-back-libbarcode.patch

package info (click to toggle)
barcode 0.99-9
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 4,724 kB
  • sloc: ansic: 21,582; sh: 11,815; makefile: 26; sed: 16
file content (157 lines) | stat: -rw-r--r-- 5,149 bytes parent folder | download | duplicates (3)
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
From: Boyuan Yang <byang@debian.org>
Date: Thu, 23 Jul 2020 22:40:32 -0400
Subject: Bring back libbarcode

Bug-Debian: https://bugs.debian.org/941997
---
 Makefile.am           |   5 +-
 header-dist/barcode.h | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 128 insertions(+), 1 deletion(-)
 create mode 100644 header-dist/barcode.h

diff --git a/Makefile.am b/Makefile.am
index c3bf085..2867bf5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,7 +25,10 @@ EXTRA_DIST = barcode.h cmdline.h
 
 bin_PROGRAMS = barcode sample
 
-noinst_LTLIBRARIES = libbarcode.la
+lib_LTLIBRARIES = libbarcode.la
+
+include_barcodedir = $(includedir)/
+include_barcode_HEADERS = header-dist/barcode.h
 
 ACLOCAL_AMFLAGS = -I m4
 
diff --git a/header-dist/barcode.h b/header-dist/barcode.h
new file mode 100644
index 0000000..4f87c0d
--- /dev/null
+++ b/header-dist/barcode.h
@@ -0,0 +1,124 @@
+/*
+ * barcode.h -- definitions for libbarcode
+ *
+ * (Tweaked by the Debian Project to provide system library header)
+ *
+ * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org)
+ * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it)
+ * Copyright (c) 2010 Giuseppe Scrivano <gscrivano@gnu.org>
+ * Copyright (c) 2010, 2011 Giuseppe Scrivano (gscrivano@gnu.org)
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _BARCODE_H_
+#define _BARCODE_H_
+
+#include <stdio.h>
+
+/*
+ * The object
+ */
+struct Barcode_Item {
+    int flags;         /* type of encoding and decoding */
+    char *ascii;       /* malloced */
+    char *partial;     /* malloced too */
+    char *textinfo;    /* information about text positioning */
+    char *encoding;    /* code name, filled by encoding engine */
+    int width, height; /* output units */
+    int xoff, yoff;    /* output units */
+    int margin;        /* output units */
+    double scalef;     /* requested scaling for barcode */
+    int error;         /* an errno-like value, in case of failure */
+};
+
+/*
+ * The flags field
+ */
+#define BARCODE_DEFAULT_FLAGS 0x00000000
+
+#define BARCODE_ENCODING_MASK 0x000000ff   /* 256 possibilites... */
+#define BARCODE_NO_ASCII      0x00000100   /* avoid text in output */
+#define BARCODE_NO_CHECKSUM   0x00000200   /* avoid checksum in output */
+
+#define BARCODE_OUTPUT_MASK   0x000ff000   /* 256 output types */
+#define BARCODE_OUT_EPS       0x00001000
+#define BARCODE_OUT_PS        0x00002000
+#define BARCODE_OUT_PCL       0x00004000   /* by Andrea Scopece */
+/*                  PCL_III   0x00008000   */
+#define BARCODE_OUT_PCL_III   0x0000C000
+#define BARCODE_OUT_SVG       0x00010000
+#define BARCODE_OUT_NOHEADERS 0x00100000   /* no header nor footer */
+
+enum {
+    BARCODE_ANY = 0,     /* choose best-fit */
+    BARCODE_EAN,
+    BARCODE_UPC,        /* upc == 12-digit ean */
+    BARCODE_ISBN,       /* isbn numbers (still EAN13) */
+    BARCODE_39,         /* code 39 */
+    BARCODE_128,        /* code 128 (a,b,c: autoselection) */
+    BARCODE_128C,       /* code 128 (compact form for digits) */
+    BARCODE_128B,       /* code 128, full printable ascii */
+    BARCODE_I25,        /* interleaved 2 of 5 (only digits) */
+    BARCODE_128RAW,     /* Raw code 128 (by Leonid A. Broukhis) */
+    BARCODE_CBR,        /* Codabar (by Leonid A. Broukhis) */
+    BARCODE_MSI,        /* MSI (by Leonid A. Broukhis) */
+    BARCODE_PLS,        /* Plessey (by Leonid A. Broukhis) */
+    BARCODE_93,         /* code 93 (by Nathan D. Holmes) */
+    BARCODE_11,         /* code 11 (USD-8) */
+    BARCODE_39EXT       /* code 39 extended (by Ian Ward) */
+};
+
+#define BARCODE_DEFAULT_MARGIN 10
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+/*
+ * Create and destroy barcode structures
+ */
+extern struct Barcode_Item *Barcode_Create(char *text);
+extern int                  Barcode_Delete(struct Barcode_Item *bc);
+
+/*
+ * Encode and print
+ */
+extern int Barcode_Encode(struct Barcode_Item *bc, int flags);
+extern int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags);
+
+/*
+ * Choose the position
+ */
+extern int Barcode_Position(struct Barcode_Item *bc, int wid, int hei,
+			    int xoff, int yoff, double scalef);
+
+/*
+ * Do it all in one step
+ */
+extern int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei,
+				    int xoff, int yoff, int flags);
+
+
+/*
+ * Return current version (integer and string)
+ */
+extern int Barcode_Version(char *versionname);
+
+#ifdef  __cplusplus
+}
+#endif
+
+extern int streaming;
+
+#endif /* _BARCODE_H_ */