all clixon event functions prepended with clixon_

Replaced fcgi getparam code with clixon-data parameters
This commit is contained in:
Olof hagsand 2020-06-05 16:19:03 +02:00
parent a455b15f03
commit 14b03f63a3
34 changed files with 567 additions and 877 deletions

View file

@ -86,11 +86,11 @@ APPL = clixon_restconf_$(with_restconf)
endif
# Common source - not accessible from plugin - independent of restconf package (fcgi|evhtp)
APPSRC = restconf_lib.c
#APPSRC = restconf_lib.c
# Fcgi-specific source including main
ifeq ($(with_restconf),fcgi)
APPSRC += restconf_fcgi_lib.c
APPSRC = restconf_fcgi_lib.c
APPSRC += restconf_fcgi_main.c
APPSRC += restconf_methods.c # These should be moved ^
APPSRC += restconf_methods_post.c
@ -100,19 +100,30 @@ endif
# Evhtp-specific source including main
ifeq ($(with_restconf),evhtp)
APPSRC += restconf_evhtp_main.c
APPSRC = restconf_evhtp_main.c
endif
APPOBJ = $(APPSRC:.c=.o)
all: $(APPL)
# Accessible from plugin
LIBSRC = restconf_lib.c
LIBOBJ = $(LIBSRC:.c=.o)
# This lib is very small but used for clixon restconf applications to access clixon restconf lib
# functions. Mostly for future use
MYNAME = clixon_restconf
MYLIBLINK = lib$(MYNAME)$(SH_SUFFIX)
MYLIB = $(MYLIBLINK).$(CLIXON_MAJOR).$(CLIXON_MINOR)
MYLIBSO = $(MYLIBLINK).$(CLIXON_MAJOR)
all: $(MYLIB) $(APPL)
# Dependency of clixon library
$(top_srcdir)/lib/src/$(CLIXON_LIB):
(cd $(top_srcdir)/lib/src && $(MAKE) $(MFLAGS) $(CLIXON_LIB))
clean:
rm -f *.core $(APPL) $(APPOBJ) *.o # extra .o to clean residue if with_restconf changes
rm -f $(LIBOBJ) *.core $(APPL) $(APPOBJ) *.o $(MYLIB) $(MYLIBSO) $(MYLIBLINK) # extra .o to clean residue if with_restconf changes
distclean: clean
rm -f Makefile *~ .depend
@ -122,7 +133,7 @@ distclean: clean
# Also create a libexec/ directory for writeable/temporary files.
# Put config file in etc/
# Also a rule for letting www-dir be owned by www-data, which only works for sudo
install: $(APPL)
install: install-lib $(APPL)
ifeq ($(shell whoami),root)
install -d -m 0755 -o $(wwwuser) -g $(wwwuser) $(DESTDIR)$(wwwdir)
else
@ -130,10 +141,19 @@ else
endif
install -m 0755 $(INSTALLFLAGS) $(APPL) $(DESTDIR)$(wwwdir)
install-include:
install-lib: $(MYLIB)
install -d -m 0755 $(DESTDIR)$(libdir)
install -m 0644 $(INSTALLFLAGS) $(MYLIB) $(DESTDIR)$(libdir)
ln -sf $(MYLIB) $(DESTDIR)$(libdir)/$(MYLIBSO) # -l:libclixon_restconf.so.2
ln -sf $(MYLIBSO) $(DESTDIR)$(libdir)/$(MYLIBLINK) # -l:libclixon_restconf.so
install-include: clixon_restconf.h
install -d -m 0755 $(DESTDIR)$(includedir)/clixon
install -m 0644 $^ $(DESTDIR)$(includedir)/clixon
uninstall:
rm -f $(DESTDIR)$(wwwdir)/$(APPL)
rm -f $(DESTDIR)$(libdir)/$(MYLIBLINK)*
.SUFFIXES:
.SUFFIXES: .c .o
@ -141,8 +161,18 @@ uninstall:
.c.o:
$(CC) $(INCLUDES) -D__PROGRAM__=\"clixon_restconf\" $(CPPFLAGS) $(CFLAGS) -c $<
$(APPL) : $(APPOBJ)
$(CC) $(LDFLAGS) $(APPOBJ) $(LIBS) -o $@
$(APPL) : $(APPOBJ) $(MYLIBLINK) $(LIBDEPS)
$(CC) $(LDFLAGS) $(APPOBJ) -L. $(MYLIB) $(LIBS) -o $@
$(MYLIB) : $(LIBOBJ) $(LIBDEPS)
ifeq ($(HOST_VENDOR),apple)
$(CC) $(LDFLAGS) -shared -undefined dynamic_lookup -o $@ $(LIBOBJ) $(LIBS)
else
$(CC) $(LDFLAGS) -shared -Wl,-soname,$(MYLIBSO) -o $@ $(LIBOBJ) $(LIBS) -Wl,-soname=$(MYLIBSO)
endif
# link-name is needed for application linking, eg for clixon_cli and clixon_config
$(MYLIBLINK) : $(MYLIB)
TAGS:
find . -name '*.[chyl]' -print | etags -