add core wanpipe headers etc and tweak build flags

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@10 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2007-05-17 03:31:21 +00:00
parent fcbd79567c
commit 7e3412baf1
6 changed files with 56 additions and 8 deletions

View File

@ -35,13 +35,20 @@ MYLIB=libopenzap.a
include general.makefile $(ZAP_MODS)
all: $(MYLIB)
$(MYLIB): $(OBJS)
ar rcs $(MYLIB) $(OBJS)
ranlib $(MYLIB)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
all: $(MYLIB)
zap_wanpipe.o: zap_wanpipe.c
$(CC) $(CFLAGS) $(ZAP_CFLAGS) $(WP_CFLAGS) -c $< -o $@
zap_zt.o: zap_zt.c
$(CC) $(CFLAGS) $(ZAP_CFLAGS) $(ZT_CFLAGS) -c $< -o $@
%.o: %.c
$(CC) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
clean:
rm -f *.o $(MYLIB) *~ \#*

View File

@ -1,3 +1,3 @@
CC=gcc
CFLAGS += -Wall -Werror -Wextra -std=c99 -pedantic -ansi
CC_CFLAGS += -Wall -Werror -Wextra -std=c99 -pedantic -ansi

View File

@ -102,7 +102,6 @@ struct zap_software_interface;
*/
#define zap_copy_flags(dest, src, flags) (dest)->flags &= ~(flags); (dest)->flags |= ((src)->flags & (flags))
/*!
\brief Free a pointer and set it to NULL unless it already is NULL
\param it the pointer
@ -201,7 +200,6 @@ typedef zap_status_t (*zint_write_t) ZINT_WRITE_ARGS ;
#define ZINT_READ_MUZZLE assert(zchan != NULL); assert(data != NULL); assert(datalen != NULL)
#define ZINT_WRITE_MUZZLE assert(zchan != NULL); assert(data != NULL); assert(datalen != NULL)
struct zap_software_interface {
const char *name;
zint_configure_t configure;

View File

@ -229,7 +229,7 @@ zap_status_t zap_global_init(void)
char *var, *val;
unsigned configured = 0;
zap_software_interface_t *zint;
globals.interface_hash = create_hashtable(16, hashfromstring, equalkeys);
zint = NULL;
@ -265,6 +265,8 @@ zap_status_t zap_global_init(void)
}
}
zap_config_close_file(&cfg);
return configured ? ZAP_SUCCESS : ZAP_FAIL;
}

View File

@ -1,2 +1,11 @@
CFLAGS +=-DZAP_WANPIPE_SUPPORT
OBJS += zap_wanpipe.o
WANPIPE_INCLUDE=/usr/include/wanpipe
#WANPIPE_INCLUDE=../../wanpipe-3.1.0.p18/patches/kdrivers/include
WP_CFLAGS =-I$(WANPIPE_INCLUDE) -I/usr/local/include -I/usr/src/linux/include -I. -I/usr/include
WP_CFLAGS +=-D__LINUX__ -D_REENTRANT -D_GNU_SOURCE -DAFT_A104 -DWANPIPE_TDM_API -D_GNUC_ -DWANPIPE_TDM_API

View File

@ -31,13 +31,45 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "openzap.h"
#include "zap_wanpipe.h"
#include <wanpipe_defines.h>
#include <wanpipe_cfg.h>
#include <wanpipe_tdm_api.h>
#include <sdla_te1_pmc.h>
#include <sdla_te1.h>
#include <sdla_56k.h>
#include <sdla_remora.h>
#include <sdla_te3.h>
#include <sdla_front_end.h>
#include <sdla_aft_te1.h>
struct wanpipe_channel {
struct zap_channel zchan;
int x;
};
static ZINT_CONFIGURE_FUNCTION(wanpipe_configure)
{
zap_config_t cfg;
char *var, *val;
int catno = -1;
ZINT_CONFIGURE_MUZZLE;
if (!zap_config_open_file(&cfg, "wanpipe.conf")) {
return ZAP_FAIL;
}
while (zap_config_next_pair(&cfg, &var, &val)) {
if (!strcasecmp(cfg.category, "span")) {
if (cfg.catno != catno) {
}
}
}
zap_config_close_file(&cfg);
return ZAP_FAIL;
}