aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2004-03-27 05:38:27 +0000
committerDimitri Sokolyuk <demon@dim13.org>2004-03-27 05:38:27 +0000
commitf69cd8c998e4e2fbf28ebb57ae84aced21e80fca (patch)
treefdf2a054ad7dc3b297a7a3d6083e6ff8059595c3
parent221883a5707615d010e34c527e413c2492727016 (diff)
move to lib
-rw-r--r--lib/Makefile (renamed from tgeb/Makefile)4
-rw-r--r--lib/anbieter.c (renamed from tgeb/anbieter.c)2
-rw-r--r--lib/ausland.c (renamed from tgeb/ausland.c)2
-rw-r--r--lib/common.c (renamed from tgeb/common.c)2
-rw-r--r--lib/shlib_version (renamed from tgeb/shlib_version)0
-rw-r--r--lib/tarife.c (renamed from tgeb/tarife.c)2
-rw-r--r--lib/unzip.c (renamed from tgeb/unzip.c)0
-rw-r--r--lib/unzip.h (renamed from tgeb/unzip.h)2
-rw-r--r--lib/update.c (renamed from tgeb/update.c)2
-rw-r--r--tgeb/tgebdat.h168
-rw-r--r--tgeb/tgebup.h18
11 files changed, 8 insertions, 194 deletions
diff --git a/tgeb/Makefile b/lib/Makefile
index c4b5a34..c614e7f 100644
--- a/tgeb/Makefile
+++ b/lib/Makefile
@@ -3,13 +3,13 @@
LIB= tgeb
SRCS= anbieter.c ausland.c tarife.c common.c update.c unzip.c
HDRS= tgebdat.h tgebup.h
-CFLAGS+= -Wall -DDEBUG
+CFLAGS+= -Wall -I${.CURDIR}/../include
NOMAN=
NOPROFILE=
NOPIC=
includes:
- @cd ${.CURDIR}; for i in $(HDRS); do \
+ @cd ${.CURDIR}/../include; for i in $(HDRS); do \
j="cmp -s $$i ${DESTDIR}/usr/include/$$i || \
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} \
-m 444 $$i ${DESTDIR}/usr/include"; \
diff --git a/tgeb/anbieter.c b/lib/anbieter.c
index 2e56a8d..3a5ce49 100644
--- a/tgeb/anbieter.c
+++ b/lib/anbieter.c
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <err.h>
#include <string.h>
-#include "tgebdat.h"
+#include <tgeb.h>
static void rhdr_an(AN *, FILE *); /* read header */
static void rent_an(AN *, FILE *); /* read entries */
diff --git a/tgeb/ausland.c b/lib/ausland.c
index 0a6deb3..ef2978a 100644
--- a/tgeb/ausland.c
+++ b/lib/ausland.c
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <err.h>
#include <string.h>
-#include "tgebdat.h"
+#include <tgeb.h>
static void rhdr_au(AU *, FILE *); /* read header */
static void rent_au(AU *, FILE *); /* read entries */
diff --git a/tgeb/common.c b/lib/common.c
index baf8a8a..56f7fd1 100644
--- a/tgeb/common.c
+++ b/lib/common.c
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <err.h>
#include <string.h>
-#include "tgebdat.h"
+#include <tgeb.h>
typedef struct tosort {
int id;
diff --git a/tgeb/shlib_version b/lib/shlib_version
index dea2b62..dea2b62 100644
--- a/tgeb/shlib_version
+++ b/lib/shlib_version
diff --git a/tgeb/tarife.c b/lib/tarife.c
index 79b9ae9..1c09efa 100644
--- a/tgeb/tarife.c
+++ b/lib/tarife.c
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <err.h>
#include <string.h>
-#include "tgebdat.h"
+#include <tgeb.h>
static void rhdr_ta(TA *, FILE *); /* read header */
static void ridx_ta(TA *, FILE *); /* read index */
diff --git a/tgeb/unzip.c b/lib/unzip.c
index ad587b1..ad587b1 100644
--- a/tgeb/unzip.c
+++ b/lib/unzip.c
diff --git a/tgeb/unzip.h b/lib/unzip.h
index fa17e7c..1c1caf5 100644
--- a/tgeb/unzip.h
+++ b/lib/unzip.h
@@ -49,7 +49,7 @@ extern "C" {
#endif
#ifndef _ZLIB_H
-#include "zlib.h"
+#include <zlib.h>
#endif
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
diff --git a/tgeb/update.c b/lib/update.c
index ea1d38b..a599180 100644
--- a/tgeb/update.c
+++ b/lib/update.c
@@ -28,7 +28,7 @@
#include <time.h>
#include <zlib.h>
#include "unzip.h"
-#include "tgebup.h"
+#include <tgebup.h>
#define DATFILE "tarife"
diff --git a/tgeb/tgebdat.h b/tgeb/tgebdat.h
deleted file mode 100644
index c0a3dfd..0000000
--- a/tgeb/tgebdat.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2004 demon <demon@vhost.dyndns.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#define TGEB_PATH "/.tgeb"
-
-/*
- * anbieter.c
- */
-
-#define T_CC 0x00 /* calling card */
-#define T_CBC 0x01 /* call by call */
-#define T_CBCR 0x02 /* call by call with registration */
-#define T_RTR 0x03 /* router */
-#define T_PRES 0x04 /* preselection */
-#define T_TDA 0x05 /* deutsche telekom analog */
-#define T_TDI 0x06 /* deutsche telekom isdn */
-#define T_0190 0x08 /* 0190 */
-
-typedef struct an_d {
- struct an_hdr *h; /* back-pointer to header */
- char *serv; /* service (e.g. string "call by call") */
- char *pref; /* prefix */
- unsigned int id; /* ID */
- char *valf; /* valid from */
- char *valt; /* valid to */
- unsigned short type; /* type of service (int value) */
- float mvol; /* mindest volume (Euro) */
- float bfee; /* base fee (0.001 Euro) */
- float afee; /* arrangement fee (0.001 Euro) */
- char *url;
- char *url2;
- char *phone;
- char *mail;
- char *x; /* XXX */
- unsigned short reg; /* registration (TRUE/FALSE) */
- char *rurl; /* registration url */
- char *rfax; /* registration fax */
-} AN_D;
-
-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;
-
-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;
-
-AN *tgeb_read_an(char *file);
-void tgeb_free_an(AN *);
-
-/*
- * ausland.c
- */
-
-typedef struct au_d {
- unsigned short *id;
- char *land;
- char *dial;
-} AU_D;
-
-typedef struct au_hdr {
- struct an_d *d;
- char *land;
- char *dial;
-} AU_HDR;
-
-typedef struct au {
- unsigned short q; /* quantity */
- unsigned short l;
- struct au_d *d;
- unsigned short *max;
-} AU;
-
-AU *tgeb_read_au(char *file);
-void tgeb_free_au(AU *);
-
-/*
- * tarife.c
- */
-
-#define NAH_W 0x00
-#define NAH_E 0x01
-#define REG_W 0x02
-#define REG_E 0x03
-#define FERN_W 0x04
-#define FERN_E 0x05
-#define ORT_W 0x06
-#define ORT_E 0x07
-#define D1_W 0x08
-#define D1_E 0x09
-#define D2_W 0x0A
-#define D2_E 0x0B
-#define EP_W 0x0C
-#define EP_E 0x0D
-#define O2_W 0x0E
-#define O2_E 0x0F
-
-#define AUS_W 0x00
-#define AUS_E 0x01
-#define Q_IN 16
-
-typedef struct ta_d {
- unsigned short time; /* valid till */
- float dfee; /* dial-in fee */
- float fee; /* fee (Brutto) */
- unsigned short t1; /* timing 1 */
- 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;
-
-typedef struct ta_idx {
- unsigned int off; /* region / day-of-week offset */
- struct ta_d *data;
-} TA_IDX;
-
-typedef struct ta_hdr {
- struct ta_idx *in;
- unsigned int off_in;
- struct ta_idx *aus;
- unsigned int off_aus;
-} TA_HDR;
-
-typedef struct ta { /* file offset 0 */
- unsigned short q; /* quantity provider */
- unsigned short *q_aus; /* entrys quantity per provider */
- struct ta_hdr *h;
-} TA;
-
-TA *tgeb_read_ta(char *file, struct au *);
-void tgeb_free_ta(TA *);
-
-/*
- *common.c
- */
-
-typedef struct sorted {
- int q;
- int *id;
- struct ta_d **data;
-} SORTED;
-
-void _tgeb_sread(char **, FILE *); /* read string */
-SORTED *tgeb_select(TA *, AN *, int reg, int flags, int time);
-void tgeb_free_mem(AN *, AU *, TA *);
-void tgeb_free_sd(SORTED *);
diff --git a/tgeb/tgebup.h b/tgeb/tgebup.h
deleted file mode 100644
index 74fbf96..0000000
--- a/tgeb/tgebup.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2004 demon <demon@vhost.dyndns.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-void tgeb_update(struct tm *);