aboutsummaryrefslogtreecommitdiff
path: root/tgeb/tgebdat.h
diff options
context:
space:
mode:
Diffstat (limited to 'tgeb/tgebdat.h')
-rw-r--r--tgeb/tgebdat.h63
1 files changed, 35 insertions, 28 deletions
diff --git a/tgeb/tgebdat.h b/tgeb/tgebdat.h
index 20f09f8..c0a3dfd 100644
--- a/tgeb/tgebdat.h
+++ b/tgeb/tgebdat.h
@@ -15,6 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define TGEB_PATH "/.tgeb"
+
/*
* anbieter.c
*/
@@ -28,7 +30,7 @@
#define T_TDI 0x06 /* deutsche telekom isdn */
#define T_0190 0x08 /* 0190 */
-struct an_d {
+typedef struct an_d {
struct an_hdr *h; /* back-pointer to header */
char *serv; /* service (e.g. string "call by call") */
char *pref; /* prefix */
@@ -47,50 +49,52 @@ struct an_d {
unsigned short reg; /* registration (TRUE/FALSE) */
char *rurl; /* registration url */
char *rfax; /* registration fax */
-};
+} AN_D;
-struct an_hdr {
+typedef struct an_hdr {
unsigned int off; /* offset */
unsigned short q; /* entry quantity */
char *name; /* name */
char *mail; /* e-mail */
char *url; /* url */
struct an_d *d;
-};
+} AN_HDR;
-struct an {
+typedef struct an {
unsigned short q; /* provider quantity */
struct an_hdr *h; /* header */
unsigned short e_q; /* entries qantity */
struct an_d *e; /* entries (id-sorted) */
-};
+} AN;
-struct an *tgeb_read_an(char *file);
+AN *tgeb_read_an(char *file);
+void tgeb_free_an(AN *);
/*
* ausland.c
*/
-struct au_d {
+typedef struct au_d {
unsigned short *id;
char *land;
char *dial;
-};
+} AU_D;
-struct au_hdr {
+typedef struct au_hdr {
struct an_d *d;
char *land;
char *dial;
-};
+} AU_HDR;
-struct au {
+typedef struct au {
unsigned short q; /* quantity */
unsigned short l;
struct au_d *d;
unsigned short *max;
-};
+} AU;
-struct au *tgeb_read_au(char *file);
+AU *tgeb_read_au(char *file);
+void tgeb_free_au(AU *);
/*
* tarife.c
@@ -117,7 +121,7 @@ struct au *tgeb_read_au(char *file);
#define AUS_E 0x01
#define Q_IN 16
-struct ta_d {
+typedef struct ta_d {
unsigned short time; /* valid till */
float dfee; /* dial-in fee */
float fee; /* fee (Brutto) */
@@ -125,37 +129,40 @@ struct ta_d {
unsigned short t2; /* timing 2 */
struct ta_d *next; /* next data block in chain */
struct ta_d *prev; /* prevision data block in chain */
-};
+} TA_D;
-struct ta_idx {
+typedef struct ta_idx {
unsigned int off; /* region / day-of-week offset */
struct ta_d *data;
-};
+} TA_IDX;
-struct ta_hdr {
+typedef struct ta_hdr {
struct ta_idx *in;
unsigned int off_in;
struct ta_idx *aus;
unsigned int off_aus;
-};
+} TA_HDR;
-struct ta { /* file offset 0 */
+typedef struct ta { /* file offset 0 */
unsigned short q; /* quantity provider */
unsigned short *q_aus; /* entrys quantity per provider */
struct ta_hdr *h;
-};
+} TA;
-struct ta *tgeb_read_ta(char *file, struct au *);
+TA *tgeb_read_ta(char *file, struct au *);
+void tgeb_free_ta(TA *);
/*
*common.c
*/
-struct sorted {
- int q;
- int *id;
+typedef struct sorted {
+ int q;
+ int *id;
struct ta_d **data;
-};
+} SORTED;
void _tgeb_sread(char **, FILE *); /* read string */
-struct sorted tgeb_select(struct ta *, struct an *, int reg, int flags, int time);
+SORTED *tgeb_select(TA *, AN *, int reg, int flags, int time);
+void tgeb_free_mem(AN *, AU *, TA *);
+void tgeb_free_sd(SORTED *);