Browse Source

restructure as this is now a private project of mine and no longer related to bigpoint. It was anyways open source as it uses opensource code from another project

master
Georg Hopp 14 years ago
parent
commit
68d6a474bc
  1. 4
      AUTHORS
  2. 13
      Makefile.am
  3. 189
      Makefile.in
  4. 104
      bigpoint_packet.c
  5. 11
      bigpoint_token_cryptdec.c
  6. 17
      bigpoint_token_cryptdec.h
  7. 6
      build.sh
  8. 4
      configure
  9. 2
      configure.ac
  10. 80
      createToken.c
  11. 2
      include/Makefile.am
  12. 82
      include/Makefile.in
  13. 11
      include/bigpoint/bigpoint.h
  14. 49
      include/bigpoint/bigpoint_crypt.h
  15. 42
      include/bigpoint/bigpoint_dyntype.h
  16. 32
      include/bigpoint/bigpoint_hash.h
  17. 39
      include/bigpoint/bigpoint_packet.h
  18. 8
      include/cclass.h
  19. 49
      include/crypt.h
  20. 42
      include/dyntype.h
  21. 32
      include/dyntype/hash.h
  22. 39
      include/packet.h
  23. 11
      include/token.h
  24. 6
      src/Makefile.am
  25. 560
      src/Makefile.in
  26. 18
      src/cclass.c
  27. 35
      src/crypt.c
  28. 50
      src/dyntype.c
  29. 48
      src/dyntype/hash.c
  30. 104
      src/packet.c
  31. 22
      tests/Makefile.am
  32. 724
      tests/Makefile.in
  33. 12
      tests/crypt.c
  34. 12
      tests/decrypt.c
  35. 29
      tests/dyntype.c
  36. 28
      tests/hash.c
  37. 100
      tests/packet.c
  38. 100
      tests/packet_test.c

4
AUTHORS

@ -7,8 +7,8 @@ written by:
This code is also copyrighted by the GPL 3.
The original idea ass well as the first PHP implementation was founded
with my collegues at bigpoint.com.
The original idea as well as the first PHP implementation was founded
in cooperation with my collegues at Bigpoint www.bigpoint.com.
- Bjoern Ellebrecht
- Lass Puls

13
Makefile.am

@ -1,15 +1,8 @@
ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libbigpoint.la
libbigpoint_la_SOURCES = base64.c bigpoint_cclass.c bigpoint_crypt.c bigpoint_dyntype.c \
bigpoint_hash.c bigpoint_packet.c
libbigpoint_la_CFLAGS = -I include
libbigpoint_la_LDFLAGS = -version-info 0:0:0
bin_PROGRAMS = create_token
create_token_SOURCES = createToken.c
create_token_LDADD = libbigpoint.la $(LIBOBJS)
create_token_SOURCES = base64.c createToken.c
create_token_LDADD = src/libtoken.la $(LIBOBJS)
create_token_CFLAGS = -I include
SUBDIRS = include
SUBDIRS = src include tests

189
Makefile.in

@ -15,7 +15,6 @@
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@ -52,44 +51,12 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libbigpoint_la_LIBADD =
am_libbigpoint_la_OBJECTS = libbigpoint_la-base64.lo \
libbigpoint_la-bigpoint_cclass.lo \
libbigpoint_la-bigpoint_crypt.lo \
libbigpoint_la-bigpoint_dyntype.lo \
libbigpoint_la-bigpoint_hash.lo \
libbigpoint_la-bigpoint_packet.lo
libbigpoint_la_OBJECTS = $(am_libbigpoint_la_OBJECTS)
libbigpoint_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libbigpoint_la_CFLAGS) \
$(CFLAGS) $(libbigpoint_la_LDFLAGS) $(LDFLAGS) -o $@
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_create_token_OBJECTS = create_token-createToken.$(OBJEXT)
am_create_token_OBJECTS = create_token-base64.$(OBJEXT) \
create_token-createToken.$(OBJEXT)
create_token_OBJECTS = $(am_create_token_OBJECTS)
create_token_DEPENDENCIES = libbigpoint.la $(LIBOBJS)
create_token_DEPENDENCIES = src/libtoken.la $(LIBOBJS)
create_token_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(create_token_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
@ -106,8 +73,8 @@ CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libbigpoint_la_SOURCES) $(create_token_SOURCES)
DIST_SOURCES = $(libbigpoint_la_SOURCES) $(create_token_SOURCES)
SOURCES = $(create_token_SOURCES)
DIST_SOURCES = $(create_token_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
@ -273,16 +240,10 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libbigpoint.la
libbigpoint_la_SOURCES = base64.c bigpoint_cclass.c bigpoint_crypt.c bigpoint_dyntype.c \
bigpoint_hash.c bigpoint_packet.c
libbigpoint_la_CFLAGS = -I include
libbigpoint_la_LDFLAGS = -version-info 0:0:0
create_token_SOURCES = createToken.c
create_token_LDADD = libbigpoint.la $(LIBOBJS)
create_token_SOURCES = base64.c createToken.c
create_token_LDADD = src/libtoken.la $(LIBOBJS)
create_token_CFLAGS = -I include
SUBDIRS = include
SUBDIRS = src include tests
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@ -339,39 +300,6 @@ $(srcdir)/config.h.in: $(am__configure_deps)
distclean-hdr:
-rm -f config.h stamp-h1
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libbigpoint.la: $(libbigpoint_la_OBJECTS) $(libbigpoint_la_DEPENDENCIES)
$(libbigpoint_la_LINK) -rpath $(libdir) $(libbigpoint_la_OBJECTS) $(libbigpoint_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@ -425,13 +353,8 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/create_token-base64.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/create_token-createToken.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbigpoint_la-base64.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbigpoint_la-bigpoint_cclass.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbigpoint_la-bigpoint_crypt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbigpoint_la-bigpoint_dyntype.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbigpoint_la-bigpoint_hash.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbigpoint_la-bigpoint_packet.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -454,47 +377,19 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
libbigpoint_la-base64.lo: base64.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -MT libbigpoint_la-base64.lo -MD -MP -MF $(DEPDIR)/libbigpoint_la-base64.Tpo -c -o libbigpoint_la-base64.lo `test -f 'base64.c' || echo '$(srcdir)/'`base64.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libbigpoint_la-base64.Tpo $(DEPDIR)/libbigpoint_la-base64.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='base64.c' object='libbigpoint_la-base64.lo' libtool=yes @AMDEPBACKSLASH@
create_token-base64.o: base64.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(create_token_CFLAGS) $(CFLAGS) -MT create_token-base64.o -MD -MP -MF $(DEPDIR)/create_token-base64.Tpo -c -o create_token-base64.o `test -f 'base64.c' || echo '$(srcdir)/'`base64.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/create_token-base64.Tpo $(DEPDIR)/create_token-base64.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='base64.c' object='create_token-base64.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -c -o libbigpoint_la-base64.lo `test -f 'base64.c' || echo '$(srcdir)/'`base64.c
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(create_token_CFLAGS) $(CFLAGS) -c -o create_token-base64.o `test -f 'base64.c' || echo '$(srcdir)/'`base64.c
libbigpoint_la-bigpoint_cclass.lo: bigpoint_cclass.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -MT libbigpoint_la-bigpoint_cclass.lo -MD -MP -MF $(DEPDIR)/libbigpoint_la-bigpoint_cclass.Tpo -c -o libbigpoint_la-bigpoint_cclass.lo `test -f 'bigpoint_cclass.c' || echo '$(srcdir)/'`bigpoint_cclass.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libbigpoint_la-bigpoint_cclass.Tpo $(DEPDIR)/libbigpoint_la-bigpoint_cclass.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bigpoint_cclass.c' object='libbigpoint_la-bigpoint_cclass.lo' libtool=yes @AMDEPBACKSLASH@
create_token-base64.obj: base64.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(create_token_CFLAGS) $(CFLAGS) -MT create_token-base64.obj -MD -MP -MF $(DEPDIR)/create_token-base64.Tpo -c -o create_token-base64.obj `if test -f 'base64.c'; then $(CYGPATH_W) 'base64.c'; else $(CYGPATH_W) '$(srcdir)/base64.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/create_token-base64.Tpo $(DEPDIR)/create_token-base64.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='base64.c' object='create_token-base64.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -c -o libbigpoint_la-bigpoint_cclass.lo `test -f 'bigpoint_cclass.c' || echo '$(srcdir)/'`bigpoint_cclass.c
libbigpoint_la-bigpoint_crypt.lo: bigpoint_crypt.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -MT libbigpoint_la-bigpoint_crypt.lo -MD -MP -MF $(DEPDIR)/libbigpoint_la-bigpoint_crypt.Tpo -c -o libbigpoint_la-bigpoint_crypt.lo `test -f 'bigpoint_crypt.c' || echo '$(srcdir)/'`bigpoint_crypt.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libbigpoint_la-bigpoint_crypt.Tpo $(DEPDIR)/libbigpoint_la-bigpoint_crypt.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bigpoint_crypt.c' object='libbigpoint_la-bigpoint_crypt.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -c -o libbigpoint_la-bigpoint_crypt.lo `test -f 'bigpoint_crypt.c' || echo '$(srcdir)/'`bigpoint_crypt.c
libbigpoint_la-bigpoint_dyntype.lo: bigpoint_dyntype.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -MT libbigpoint_la-bigpoint_dyntype.lo -MD -MP -MF $(DEPDIR)/libbigpoint_la-bigpoint_dyntype.Tpo -c -o libbigpoint_la-bigpoint_dyntype.lo `test -f 'bigpoint_dyntype.c' || echo '$(srcdir)/'`bigpoint_dyntype.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libbigpoint_la-bigpoint_dyntype.Tpo $(DEPDIR)/libbigpoint_la-bigpoint_dyntype.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bigpoint_dyntype.c' object='libbigpoint_la-bigpoint_dyntype.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -c -o libbigpoint_la-bigpoint_dyntype.lo `test -f 'bigpoint_dyntype.c' || echo '$(srcdir)/'`bigpoint_dyntype.c
libbigpoint_la-bigpoint_hash.lo: bigpoint_hash.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -MT libbigpoint_la-bigpoint_hash.lo -MD -MP -MF $(DEPDIR)/libbigpoint_la-bigpoint_hash.Tpo -c -o libbigpoint_la-bigpoint_hash.lo `test -f 'bigpoint_hash.c' || echo '$(srcdir)/'`bigpoint_hash.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libbigpoint_la-bigpoint_hash.Tpo $(DEPDIR)/libbigpoint_la-bigpoint_hash.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bigpoint_hash.c' object='libbigpoint_la-bigpoint_hash.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -c -o libbigpoint_la-bigpoint_hash.lo `test -f 'bigpoint_hash.c' || echo '$(srcdir)/'`bigpoint_hash.c
libbigpoint_la-bigpoint_packet.lo: bigpoint_packet.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -MT libbigpoint_la-bigpoint_packet.lo -MD -MP -MF $(DEPDIR)/libbigpoint_la-bigpoint_packet.Tpo -c -o libbigpoint_la-bigpoint_packet.lo `test -f 'bigpoint_packet.c' || echo '$(srcdir)/'`bigpoint_packet.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libbigpoint_la-bigpoint_packet.Tpo $(DEPDIR)/libbigpoint_la-bigpoint_packet.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bigpoint_packet.c' object='libbigpoint_la-bigpoint_packet.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbigpoint_la_CFLAGS) $(CFLAGS) -c -o libbigpoint_la-bigpoint_packet.lo `test -f 'bigpoint_packet.c' || echo '$(srcdir)/'`bigpoint_packet.c
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(create_token_CFLAGS) $(CFLAGS) -c -o create_token-base64.obj `if test -f 'base64.c'; then $(CYGPATH_W) 'base64.c'; else $(CYGPATH_W) '$(srcdir)/base64.c'; fi`
create_token-createToken.o: createToken.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(create_token_CFLAGS) $(CFLAGS) -MT create_token-createToken.o -MD -MP -MF $(DEPDIR)/create_token-createToken.Tpo -c -o create_token-createToken.o `test -f 'createToken.c' || echo '$(srcdir)/'`createToken.c
@ -831,12 +726,10 @@ distcleancheck: distclean
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) config.h
install-binPROGRAMS: install-libLTLIBRARIES
all-am: Makefile $(PROGRAMS) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; do \
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
@ -866,8 +759,7 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
clean-libtool mostlyclean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
@ -894,7 +786,7 @@ install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
install-exec-am: install-binPROGRAMS
install-html: install-html-recursive
@ -936,29 +828,28 @@ ps: ps-recursive
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES
uninstall-am: uninstall-binPROGRAMS
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
ctags-recursive install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-binPROGRAMS \
clean-generic clean-libLTLIBRARIES clean-libtool ctags \
ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-lzma \
dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
distclean-compile distclean-generic distclean-hdr \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-libLTLIBRARIES install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
uninstall-binPROGRAMS uninstall-libLTLIBRARIES
clean-generic clean-libtool ctags ctags-recursive dist \
dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \
dist-xz dist-zip distcheck distclean distclean-compile \
distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-binPROGRAMS
# Tell versions [3.59,3.63) of GNU make to not export all variables.

104
bigpoint_packet.c

@ -1,104 +0,0 @@
#include <json/json.h>
#include "bigpoint/bigpoint_packet.h"
static
void
__construct(struct BIGPOINT_PACKET * _this, va_list * params)
{
bigpoint_packet_set_default_content(_this);
}
static
void
__jsonConst(struct BIGPOINT_PACKET * _this, struct json_object * json)
{
struct json_object * header = NULL;
struct json_object * data = NULL;
if (! json_type_array == json_object_get_type(json)) {
bigpoint_packet_set_default_content(_this);
return;
}
header = json_object_array_get_idx(json, 0);
data = json_object_array_get_idx(json, 1);
if (! (header && data)) {
bigpoint_packet_set_default_content(_this);
return;
}
bigpoint_packet_setHeader(_this, newFromJson(BIGPOINT_DYNTYPE, header));
bigpoint_packet_setData(_this, newFromJson(BIGPOINT_DYNTYPE, data));
}
static
void
__destruct(struct BIGPOINT_PACKET * _this)
{
}
static
struct json_object *
__toJson(struct BIGPOINT_PACKET * _this)
{
struct json_object * json = json_object_new_array();
json_object_array_add(json, toJson(bigpoint_packet_getHeader(_this)));
json_object_array_add(json, toJson(bigpoint_packet_getData(_this)));
return json;
}
static const
struct BIGPOINT_CCLASS _bigpoint_packet = {
sizeof(struct BIGPOINT_PACKET),
(ctor)__construct,
(jCtor)__jsonConst,
(dtor)__destruct,
(jTo)__toJson
};
const struct BIGPOINT_CCLASS * const BIGPOINT_PACKET = &_bigpoint_packet;
struct BIGPOINT_DYNTYPE *
bigpoint_packet_getHeader(
struct BIGPOINT_PACKET * _this)
{
return _this->content[BIGPOINT_PACKET_HEADER];
}
struct BIGPOINT_DYNTYPE *
bigpoint_packet_getData(
struct BIGPOINT_PACKET * _this)
{
return _this->content[BIGPOINT_PACKET_DATA];
}
void
bigpoint_packet_setHeader(
struct BIGPOINT_PACKET * _this,
struct BIGPOINT_DYNTYPE * header)
{
_this->content[BIGPOINT_PACKET_HEADER] = header;
}
void
bigpoint_packet_setData(
struct BIGPOINT_PACKET * _this,
struct BIGPOINT_DYNTYPE * data)
{
_this->content[BIGPOINT_PACKET_DATA] = data;
}
void
bigpoint_packet_set_default_content(
struct BIGPOINT_PACKET * _this)
{
_this->content[BIGPOINT_PACKET_HEADER] = NULL;
_this->content[BIGPOINT_PACKET_DATA] = NULL;
}
// vim: set et ts=4 sw=4:

11
bigpoint_token_cryptdec.c

@ -1,11 +0,0 @@
#include "bigpoint_token_cryptdec"
static
void
__construct(struct BIGPOINT_TOKEN_CRYPTDEC * _this, va_list * params)
{
_this->containerFactory = va_arg(* params, struct BIGPOINT_CONTANER_FACTORY *);
_this->crypt = va_arg(* params, struct BIGPOINT_CRYPT *);
}
// vim: set et ts=4 sw=4:

17
bigpoint_token_cryptdec.h

@ -1,17 +0,0 @@
#ifndef __BIGPOINT_TOKEN_CRPYTDEC_H__
#define __BIGPOINT_TOKEN_CRPYTDEC_H__
#include "bigpoint_cclass.h"
struct BIGPOINT_TOKEN_CRYPTDEC {
const struct BIGPOINT_CCLASS * const class;
struct BIGPOINT_CONTAINTER_FACTORY * containerFactory;
struct BIGPOINT_CRYPT * crypt;
}
extern const struct BIGPOINT_CCLASS * const BIGPOINT_TOKEN_CRYPTDEC;
#endif//__BIGPOINT_TOKEN_CRPYTDEC_H__
// vim: set et ts=4 sw=4:

6
build.sh

@ -0,0 +1,6 @@
#!/bin/sh
libtoolize --copy
aclocal
autoconf
automake --add-missing --copy

4
configure

@ -11927,7 +11927,7 @@ fi
done
ac_config_files="$ac_config_files Makefile include/Makefile"
ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile tests/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -12939,7 +12939,9 @@ do
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac

2
configure.ac

@ -33,5 +33,5 @@ AC_TYPE_SIZE_T
# Checks for library functions.
AC_CHECK_FUNCS([memchr memmove memset])
AC_CONFIG_FILES([Makefile include/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile include/Makefile tests/Makefile])
AC_OUTPUT

80
createToken.c

@ -5,71 +5,67 @@
#include <time.h>
#include <json/json.h>
#include "bigpoint/bigpoint_cclass.h"
#include "bigpoint/bigpoint_packet.h"
#include "bigpoint/bigpoint_dyntype.h"
#include "bigpoint/bigpoint_hash.h"
#include "bigpoint/bigpoint_crypt.h"
#include "token.h"
#include "base64.h"
void
setHashString(struct BIGPOINT_HASH * hash, const char * key, const char * value)
setHashString(struct DYNTYPE_HASH * hash, const char * key, const char * value)
{
struct BIGPOINT_DYNTYPE * dyn;
struct DYNTYPE * dyn;
dyn = new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_STRING, strlen(value), value);
bigpoint_hash_set(hash, key, dyn);
dyn = new(DYNTYPE, DYNTYPE_TYPE_STRING, strlen(value), value);
dyntype_hash_set(hash, key, dyn);
}
void
setHashInt(struct BIGPOINT_HASH * hash, const char * key, const int value)
setHashInt(struct DYNTYPE_HASH * hash, const char * key, const int value)
{
struct BIGPOINT_DYNTYPE * dyn;
struct DYNTYPE * dyn;
dyn = new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_INT, sizeof(int), value);
bigpoint_hash_set(hash, key, dyn);
dyn = new(DYNTYPE, DYNTYPE_TYPE_INT, sizeof(int), value);
dyntype_hash_set(hash, key, dyn);
}
int
main(int argc, char * argv[])
{
struct BIGPOINT_CRYPT * crypt;
struct BIGPOINT_PACKET * packet;
struct BIGPOINT_HASH * data;
struct json_object * json;
const char * json_str;
char * encrypted;
char * b64d;
char pass[] = "1234";
size_t length;
packet = new(BIGPOINT_PACKET);
bigpoint_packet_setHeader(
struct CRYPT * crypt;
struct PACKET * packet;
struct DYNTYPE_HASH * data;
struct json_object * json;
const char * json_str;
char * encrypted;
char * b64d;
char pass[] = "1234";
size_t length;
packet = new(PACKET);
packet_setHeader(
packet,
new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_INT, sizeof(int), time(NULL)));
new(DYNTYPE, DYNTYPE_TYPE_INT, sizeof(int), time(NULL)));
data = new(BIGPOINT_HASH);
data = new(DYNTYPE_HASH);
setHashString(data, "#C#", "this comes from C");
setHashString(data, "usr", "ppohg");
setHashString(data, "pas", "yyyyy");
setHashInt(data, "val", 321);
bigpoint_packet_setData(
packet,
new(BIGPOINT_DYNTYPE,
BIGPOINT_DYNTYPE_HASH,
sizeof(struct BIGPOINT_HASH *),
data));
packet_setData(
packet,
new(DYNTYPE,
DYNTYPE_TYPE_HASH,
sizeof(struct DYNTYPE_HASH *),
data));
json = toJson(packet);
json_str = json_object_to_json_string(json);
length = strlen(json_str);
crypt = new(BIGPOINT_CRYPT, MCRYPT_RIJNDAEL_256, MCRYPT_CFB);
encrypted = bigpoint_crypt_encrypt(crypt, json_str, pass, &length);
crypt = new(CRYPT, MCRYPT_RIJNDAEL_256, MCRYPT_CFB);
encrypted = crypt_encrypt(crypt, json_str, pass, &length);
delete(crypt);
json_object_put(json);
@ -84,12 +80,12 @@ main(int argc, char * argv[])
printf("%s\n", b64d);
free(b64d);
delete(bigpoint_hash_get(data, "#C#"));
delete(bigpoint_hash_get(data, "usr"));
delete(bigpoint_hash_get(data, "pas"));
delete(bigpoint_hash_get(data, "val"));
delete(bigpoint_packet_getHeader(packet));
delete(bigpoint_packet_getData(packet));
delete(dyntype_hash_get(data, "#C#"));
delete(dyntype_hash_get(data, "usr"));
delete(dyntype_hash_get(data, "pas"));
delete(dyntype_hash_get(data, "val"));
delete(packet_getHeader(packet));
delete(packet_getData(packet));
delete(packet);

2
include/Makefile.am

@ -1 +1 @@
nobase_include_HEADERS = bigpoint/*
nobase_include_HEADERS = cclass.h crypt.h dyntype.h dyntype/hash.h packet.h

82
include/Makefile.in

@ -70,6 +70,8 @@ am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(includedir)"
HEADERS = $(nobase_include_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -184,7 +186,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
nobase_include_HEADERS = bigpoint/*
nobase_include_HEADERS = cclass.h crypt.h dyntype.h dyntype/hash.h packet.h
all: all-am
.SUFFIXES:
@ -247,12 +249,58 @@ uninstall-nobase_includeHEADERS:
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(includedir)" && rm -f $$files
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS:
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS:
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@ -322,7 +370,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-am
@ -384,18 +432,18 @@ uninstall-am: uninstall-nobase_includeHEADERS
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man \
install-nobase_includeHEADERS install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-nobase_includeHEADERS
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool ctags distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-nobase_includeHEADERS \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-nobase_includeHEADERS
# Tell versions [3.59,3.63) of GNU make to not export all variables.

11
include/bigpoint/bigpoint.h

@ -1,11 +0,0 @@
#ifndef __BIGPOINT_H__
#define __BIGPOINT_H__
#include "bigpoint_cclass.h"
#include "bigpoint_crypt.h"
#include "bigpoint_dyntype.h"
#include "bigpoint_hash.h"
#include "bigpoint_packet.h"
#endif//__BIGPOINT_H__
// vim: set et ts=4 sw=4:

49
include/bigpoint/bigpoint_crypt.h

@ -1,49 +0,0 @@
#ifndef __BIGPOINT_CRYPT_H__
#define __BIGPOINT_CRYPT_H__
#include <sys/types.h>
#include "bigpoint_cclass.h"
struct BIGPOINT_CRYPT {
const struct BIGPOINT_CCLASS * const class;
const char * algorithm;
const char * mode;
MCRYPT mcrypt;
size_t ivsize;
size_t keysize;
void * iv;
};
extern const struct BIGPOINT_CCLASS * const BIGPOINT_CRYPT;
void * bigpoint_crypt_encrypt(
struct BIGPOINT_CRYPT * _this,
const void * const data,
const char * const password,
size_t * length);
void * bigpoint_crypt_decrypt(
struct BIGPOINT_CRYPT * _this,
const void * const data,
const char * const password,
size_t * length);
void * bigpoint_crypt_createIv(
struct BIGPOINT_CRYPT * _this);
void bigpoint_crypt_setIv(
struct BIGPOINT_CRYPT * _this,
const void * const iv);
void bigpoint_crypt_setIvsize(
struct BIGPOINT_CRYPT * _this,
const size_t size);
void bigpoint_crypt_setKeysize(
struct BIGPOINT_CRYPT * _this,
const size_t size);
#endif//__BIGPOINT_CRYPT_H__
// vim: set et ts=4 sw=4:

42
include/bigpoint/bigpoint_dyntype.h

@ -1,42 +0,0 @@
#ifndef __BIGPOINT_DYNTYPE_H__
#define __BIGPOINT_DYNTYPE_H__
#include <sys/types.h>
#include "bigpoint_cclass.h"
struct BIGPOINT_DYNTYPE;
#include "bigpoint_hash.h"
enum BIGPOINT_DYNTYPE_TYPES {
BIGPOINT_DYNTYPE_NULL = 0,
BIGPOINT_DYNTYPE_BOOLEAN,
BIGPOINT_DYNTYPE_INT,
BIGPOINT_DYNTYPE_FLOAT,
BIGPOINT_DYNTYPE_STRING,
BIGPOINT_DYNTYPE_ARRAY,
BIGPOINT_DYNTYPE_HASH
};
struct BIGPOINT_DYNTYPE {
const struct BIGPOINT_CCLASS * const class;
enum BIGPOINT_DYNTYPE_TYPES type;
size_t size;
union _data {
unsigned char _boolean;
int _int;
double _float;
char * _string;
struct BIGPOINT_DYNTYPE ** _array;
struct BIGPOINT_HASH * _hash;
} data;
};
extern const struct BIGPOINT_CCLASS * const BIGPOINT_DYNTYPE;
#endif//__BIGPOINT_DYNTYPE_H__
// vim: set et ts=4 sw=4:

32
include/bigpoint/bigpoint_hash.h

@ -1,32 +0,0 @@
#ifndef __BIGPOINT_HASH_H__
#define __BIGPOINT_HASH_H__
#include <sys/types.h>
#include "bigpoint_cclass.h"
#include "bigpoint_dyntype.h"
struct BIGPOINT_HASH {
const struct BIGPOINT_CCLASS * const class;
char ** keys;
struct BIGPOINT_DYNTYPE ** values;
size_t size;
size_t used;
};
extern const struct BIGPOINT_CCLASS * const BIGPOINT_HASH;
void bigpoint_hash_set(struct BIGPOINT_HASH * _this,
const char * key,
struct BIGPOINT_DYNTYPE * value);
struct BIGPOINT_DYNTYPE *
bigpoint_hash_get(struct BIGPOINT_HASH * _this, const char * key);
struct BIGPOINT_DYNTYPE *
bigpoint_hash_del(struct BIGPOINT_HASH * _this, const char * key);
#endif//__BIGPOINT_HASH_H__
// vim: set et ts=4 sw=4:

39
include/bigpoint/bigpoint_packet.h

@ -1,39 +0,0 @@
#ifndef __BIGPOINT_PACKET_H__
#define __BIGPOINT_PACKET_H__
#include "bigpoint_cclass.h"
#include "bigpoint_dyntype.h"
enum BIGPOINT_PACKET_CONTENT_KEYS {
BIGPOINT_PACKET_HEADER = 0,
BIGPOINT_PACKET_DATA
};
struct BIGPOINT_PACKET {
const struct BIGPOINT_CCLASS * const class;
struct BIGPOINT_DYNTYPE * content[2];
};
extern const struct BIGPOINT_CCLASS * const BIGPOINT_PACKET;
struct BIGPOINT_DYNTYPE * bigpoint_packet_getHeader(
struct BIGPOINT_PACKET * _this);
struct BIGPOINT_DYNTYPE * bigpoint_packet_getData(
struct BIGPOINT_PACKET * _this);
void bigpoint_packet_setHeader(
struct BIGPOINT_PACKET * _this,
struct BIGPOINT_DYNTYPE * header);
void bigpoint_packet_setData(
struct BIGPOINT_PACKET * _this,
struct BIGPOINT_DYNTYPE * data);
void bigpoint_packet_set_default_content(
struct BIGPOINT_PACKET * _this);
#endif//__BIGPOINT_PACKET_H__
// vim: set et ts=4 sw=4:

8
include/bigpoint/bigpoint_cclass.h → include/cclass.h

@ -1,5 +1,5 @@
#ifndef __BIGPOINT_CCLASS_H__
#define __BIGPOINT_CCLASS_H__
#ifndef __CCLASS_H__
#define __CCLASS_H__
#include <stdarg.h>
#include <sys/types.h>
@ -11,7 +11,7 @@ typedef void (* jCtor)(void *, struct json_object *);
typedef struct json_object * (* jTo)(void *);
struct BIGPOINT_CCLASS {
struct CCLASS {
size_t size;
void (* __construct)(void * _this, va_list * params);
void (* __jsonConst)(void * _this, struct json_object * json);
@ -31,6 +31,6 @@ delete(void * _object);
struct json_object *
toJson(void * _object);
#endif//__BIGPOINT_CCLASS_H__
#endif//__CCLASS_H__
// vim: set et ts=4 sw=4:

49
include/crypt.h

@ -0,0 +1,49 @@
#ifndef __CRYPT_H__
#define __CRYPT_H__
#include <sys/types.h>
#include "cclass.h"
struct CRYPT {
const struct CCLASS * const class;
const char * algorithm;
const char * mode;
MCRYPT mcrypt;
size_t ivsize;
size_t keysize;
void * iv;
};
extern const struct CCLASS * const CRYPT;
void * crypt_encrypt(
struct CRYPT * _this,
const void * const data,
const char * const password,
size_t * length);
void * crypt_decrypt(
struct CRYPT * _this,
const void * const data,
const char * const password,
size_t * length);
void * crypt_createIv(
struct CRYPT * _this);
void crypt_setIv(
struct CRYPT * _this,
const void * const iv);
void crypt_setIvsize(
struct CRYPT * _this,
const size_t size);
void crypt_setKeysize(
struct CRYPT * _this,
const size_t size);
#endif//__CRYPT_H__
// vim: set et ts=4 sw=4:

42
include/dyntype.h

@ -0,0 +1,42 @@
#ifndef __DYNTYPE_H__
#define __DYNTYPE_H__
#include <sys/types.h>
#include "cclass.h"
struct DYNTYPE;
#include "dyntype/hash.h"
enum DYNTYPE_TYPES {
DYNTYPE_TYPE_NULL = 0,
DYNTYPE_TYPE_BOOLEAN,
DYNTYPE_TYPE_INT,
DYNTYPE_TYPE_FLOAT,
DYNTYPE_TYPE_STRING,
DYNTYPE_TYPE_ARRAY,
DYNTYPE_TYPE_HASH
};
struct DYNTYPE {
const struct CCLASS * const class;
enum DYNTYPE_TYPES type;
size_t size;
union _data {
unsigned char _boolean;
int _int;
double _float;
char * _string;
struct DYNTYPE ** _array;
struct DYNTYPE_HASH * _hash;
} data;
};
extern const struct CCLASS * const DYNTYPE;
#endif//__DYNTYPE_H__
// vim: set et ts=4 sw=4:

32
include/dyntype/hash.h

@ -0,0 +1,32 @@
#ifndef __DYNTYPE_HASH_H__
#define __DYNTYPE_HASH_H__
#include <sys/types.h>
#include "cclass.h"
#include "dyntype.h"
struct DYNTYPE_HASH {
const struct CCLASS * const class;
char ** keys;
struct DYNTYPE ** values;
size_t size;
size_t used;
};
extern const struct CCLASS * const DYNTYPE_HASH;
void dyntype_hash_set(struct DYNTYPE_HASH * _this,
const char * key,
struct DYNTYPE * value);
struct DYNTYPE *
dyntype_hash_get(struct DYNTYPE_HASH * _this, const char * key);
struct DYNTYPE *
dyntype_hash_del(struct DYNTYPE_HASH * _this, const char * key);
#endif//__DYNTYPE_HASH_H__
// vim: set et ts=4 sw=4:

39
include/packet.h

@ -0,0 +1,39 @@
#ifndef __PACKET_H__
#define __PACKET_H__
#include "cclass.h"
#include "dyntype.h"
enum PACKET_CONTENT_KEYS {
PACKET_HEADER = 0,
PACKET_DATA
};
struct PACKET {
const struct CCLASS * const class;
struct DYNTYPE * content[2];
};
extern const struct CCLASS * const PACKET;
struct DYNTYPE * packet_getHeader(
struct PACKET * _this);
struct DYNTYPE * packet_getData(
struct PACKET * _this);
void packet_setHeader(
struct PACKET * _this,
struct DYNTYPE * header);
void packet_setData(
struct PACKET * _this,
struct DYNTYPE * data);
void packet_set_default_content(
struct PACKET * _this);
#endif//__PACKET_H__
// vim: set et ts=4 sw=4:

11
include/token.h

@ -0,0 +1,11 @@
#ifndef __TOKEN_H__
#define __TOKEN_H__
#include "cclass.h"
#include "crypt.h"
#include "dyntype.h"
#include "dyntype/hash.h"
#include "packet.h"
#endif//__TOKEN_H__
// vim: set et ts=4 sw=4:

6
src/Makefile.am

@ -0,0 +1,6 @@
ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libtoken.la
libtoken_la_SOURCES = cclass.c crypt.c dyntype.c dyntype/hash.c packet.c
libtoken_la_CFLAGS = -I ../include
libtoken_la_LDFLAGS = -version-info 0:0:0

560
src/Makefile.in

@ -0,0 +1,560 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(libdir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libtoken_la_LIBADD =
am_libtoken_la_OBJECTS = libtoken_la-cclass.lo libtoken_la-crypt.lo \
libtoken_la-dyntype.lo libtoken_la-hash.lo \
libtoken_la-packet.lo
libtoken_la_OBJECTS = $(am_libtoken_la_OBJECTS)
libtoken_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libtoken_la_CFLAGS) \
$(CFLAGS) $(libtoken_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libtoken_la_SOURCES)
DIST_SOURCES = $(libtoken_la_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libtoken.la
libtoken_la_SOURCES = cclass.c crypt.c dyntype.c dyntype/hash.c packet.c
libtoken_la_CFLAGS = -I ../include
libtoken_la_LDFLAGS = -version-info 0:0:0
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libtoken.la: $(libtoken_la_OBJECTS) $(libtoken_la_DEPENDENCIES)
$(libtoken_la_LINK) -rpath $(libdir) $(libtoken_la_OBJECTS) $(libtoken_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtoken_la-cclass.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtoken_la-crypt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtoken_la-dyntype.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtoken_la-hash.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtoken_la-packet.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
libtoken_la-cclass.lo: cclass.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoken_la_CFLAGS) $(CFLAGS) -MT libtoken_la-cclass.lo -MD -MP -MF $(DEPDIR)/libtoken_la-cclass.Tpo -c -o libtoken_la-cclass.lo `test -f 'cclass.c' || echo '$(srcdir)/'`cclass.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtoken_la-cclass.Tpo $(DEPDIR)/libtoken_la-cclass.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cclass.c' object='libtoken_la-cclass.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoken_la_CFLAGS) $(CFLAGS) -c -o libtoken_la-cclass.lo `test -f 'cclass.c' || echo '$(srcdir)/'`cclass.c
libtoken_la-crypt.lo: crypt.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoken_la_CFLAGS) $(CFLAGS) -MT libtoken_la-crypt.lo -MD -MP -MF $(DEPDIR)/libtoken_la-crypt.Tpo -c -o libtoken_la-crypt.lo `test -f 'crypt.c' || echo '$(srcdir)/'`crypt.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtoken_la-crypt.Tpo $(DEPDIR)/libtoken_la-crypt.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crypt.c' object='libtoken_la-crypt.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoken_la_CFLAGS) $(CFLAGS) -c -o libtoken_la-crypt.lo `test -f 'crypt.c' || echo '$(srcdir)/'`crypt.c
libtoken_la-dyntype.lo: dyntype.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoken_la_CFLAGS) $(CFLAGS) -MT libtoken_la-dyntype.lo -MD -MP -MF $(DEPDIR)/libtoken_la-dyntype.Tpo -c -o libtoken_la-dyntype.lo `test -f 'dyntype.c' || echo '$(srcdir)/'`dyntype.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtoken_la-dyntype.Tpo $(DEPDIR)/libtoken_la-dyntype.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dyntype.c' object='libtoken_la-dyntype.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoken_la_CFLAGS) $(CFLAGS) -c -o libtoken_la-dyntype.lo `test -f 'dyntype.c' || echo '$(srcdir)/'`dyntype.c
libtoken_la-hash.lo: dyntype/hash.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoken_la_CFLAGS) $(CFLAGS) -MT libtoken_la-hash.lo -MD -MP -MF $(DEPDIR)/libtoken_la-hash.Tpo -c -o libtoken_la-hash.lo `test -f 'dyntype/hash.c' || echo '$(srcdir)/'`dyntype/hash.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtoken_la-hash.Tpo $(DEPDIR)/libtoken_la-hash.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dyntype/hash.c' object='libtoken_la-hash.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoken_la_CFLAGS) $(CFLAGS) -c -o libtoken_la-hash.lo `test -f 'dyntype/hash.c' || echo '$(srcdir)/'`dyntype/hash.c
libtoken_la-packet.lo: packet.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoken_la_CFLAGS) $(CFLAGS) -MT libtoken_la-packet.lo -MD -MP -MF $(DEPDIR)/libtoken_la-packet.Tpo -c -o libtoken_la-packet.lo `test -f 'packet.c' || echo '$(srcdir)/'`packet.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtoken_la-packet.Tpo $(DEPDIR)/libtoken_la-packet.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='packet.c' object='libtoken_la-packet.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoken_la_CFLAGS) $(CFLAGS) -c -o libtoken_la-packet.lo `test -f 'packet.c' || echo '$(srcdir)/'`packet.c
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(libdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-libLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am \
install-libLTLIBRARIES install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-libLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

18
bigpoint_cclass.c → src/cclass.c

@ -3,16 +3,16 @@
#include <stdlib.h>
#include <json/json.h>
#include "bigpoint/bigpoint_cclass.h"
#include "cclass.h"
void *
new(const void * _class, ...)
{
const struct BIGPOINT_CCLASS * class = _class;
void * object = calloc(1, class->size);
const struct CCLASS * class = _class;
void * object = calloc(1, class->size);
* (const struct BIGPOINT_CCLASS **) object = class;
* (const struct CCLASS **) object = class;
if (class->__construct) {
va_list params;
@ -28,10 +28,10 @@ new(const void * _class, ...)
void *
newFromJson(const void * _class, struct json_object * json)
{
const struct BIGPOINT_CCLASS * class = _class;
void * object = calloc(1, class->size);
const struct CCLASS * class = _class;
void * object = calloc(1, class->size);
* (const struct BIGPOINT_CCLASS **) object = class;
* (const struct CCLASS **) object = class;
if (class->__jsonConst && json) {
class->__jsonConst(object, json);
@ -43,7 +43,7 @@ newFromJson(const void * _class, struct json_object * json)
void
delete(void * _object)
{
const struct BIGPOINT_CCLASS ** class = _object;
const struct CCLASS ** class = _object;
if (_object && *class && (*class)->__destruct) {
(*class)->__destruct(_object);
@ -55,7 +55,7 @@ delete(void * _object)
struct json_object *
toJson(void * _object)
{
const struct BIGPOINT_CCLASS ** class = _object;
const struct CCLASS ** class = _object;
if (_object && *class && (*class)->__toJson) {
return (*class)->__toJson(_object);

35
bigpoint_crypt.c → src/crypt.c

@ -7,12 +7,13 @@
#include <mcrypt.h>
#include <mhash.h>
#include "bigpoint/bigpoint_crypt.h"
#include "cclass.h"
#include "crypt.h"
static
void
__construct(struct BIGPOINT_CRYPT * _this, va_list * params)
__construct(struct CRYPT * _this, va_list * params)
{
_this->algorithm = va_arg(* params, const char * const);
_this->mode = va_arg(* params, const char * const);
@ -29,7 +30,7 @@ __construct(struct BIGPOINT_CRYPT * _this, va_list * params)
static
void
__destruct(struct BIGPOINT_CRYPT * _this)
__destruct(struct CRYPT * _this)
{
if (_this->iv) {
free(_this->iv);
@ -39,26 +40,18 @@ __destruct(struct BIGPOINT_CRYPT * _this)
}
static const
struct BIGPOINT_CCLASS _bigpoint_crypt = {
sizeof(struct BIGPOINT_CRYPT),
struct CCLASS _crypt = {
sizeof(struct CRYPT),
(ctor)__construct,
NULL,
(dtor)__destruct,
NULL
};
const struct BIGPOINT_CCLASS * const BIGPOINT_CRYPT = &_bigpoint_crypt;
static
void
mcrypt_close(MCRYPT * mcrypt)
{
mcrypt_free(*mcrypt);
*mcrypt = NULL;
}
const struct CCLASS * const CRYPT = &_crypt;
void *
bigpoint_crypt_createIv(struct BIGPOINT_CRYPT * _this)
crypt_createIv(struct CRYPT * _this)
{
int urandom;
size_t rsize = 0;
@ -79,7 +72,7 @@ bigpoint_crypt_createIv(struct BIGPOINT_CRYPT * _this)
static
void *
createKey(struct BIGPOINT_CRYPT * _this, const char * const password)
createKey(struct CRYPT * _this, const char * const password)
{
void * key = NULL;
@ -100,8 +93,8 @@ createKey(struct BIGPOINT_CRYPT * _this, const char * const password)
}
void *
bigpoint_crypt_encrypt(
struct BIGPOINT_CRYPT * _this,
crypt_encrypt(
struct CRYPT * _this,
const void * const data,
const char * const password,
size_t * length)
@ -114,7 +107,7 @@ bigpoint_crypt_encrypt(
if(_this->iv) {
iv = _this->iv;
} else {
iv = bigpoint_crypt_createIv(_this);
iv = crypt_createIv(_this);
}
mcrypt_generic_init(_this->mcrypt, key, _this->keysize, iv);
@ -136,8 +129,8 @@ bigpoint_crypt_encrypt(
}
void *
bigpoint_crypt_decrypt(
struct BIGPOINT_CRYPT * _this,
crypt_decrypt(
struct CRYPT * _this,
const void * const data,
const char * const password,
size_t * length)

50
bigpoint_dyntype.c → src/dyntype.c

@ -3,29 +3,29 @@
#include <sys/types.h>
#include <json/json.h>
#include "bigpoint/bigpoint_dyntype.h"
#include "bigpoint/bigpoint_hash.h"
#include "dyntype.h"
#include "dyntype/hash.h"
static
void
__construct(struct BIGPOINT_DYNTYPE * _this, va_list * params)
__construct(struct DYNTYPE * _this, va_list * params)
{
_this->type = va_arg(* params, enum BIGPOINT_DYNTYPE_TYPES);
_this->type = va_arg(* params, enum DYNTYPE_TYPES);
_this->size = va_arg(* params, size_t);
switch(_this->type) {
case BIGPOINT_DYNTYPE_INT:
case DYNTYPE_TYPE_INT:
(_this->data)._int = va_arg(* params, int);
break;
case BIGPOINT_DYNTYPE_STRING:
case DYNTYPE_TYPE_STRING:
(_this->data)._string = calloc(_this->size + 1, sizeof(char));
memcpy((_this->data)._string, va_arg(* params, const char *), _this->size);
break;
case BIGPOINT_DYNTYPE_HASH:
(_this->data)._hash = va_arg(* params, struct BIGPOINT_HASH *);
case DYNTYPE_TYPE_HASH:
(_this->data)._hash = va_arg(* params, struct DYNTYPE_HASH *);
break;
default:
@ -35,11 +35,11 @@ __construct(struct BIGPOINT_DYNTYPE * _this, va_list * params)
static
void
__jsonConst(struct BIGPOINT_DYNTYPE * _this, struct json_object * json)
__jsonConst(struct DYNTYPE * _this, struct json_object * json)
{
switch (json_object_get_type(json)) {
case json_type_int:
_this->type = BIGPOINT_DYNTYPE_INT;
_this->type = DYNTYPE_TYPE_INT;
_this->size = sizeof(int);
(_this->data)._int = (int)json_object_get_int(json);
break;
@ -48,7 +48,7 @@ __jsonConst(struct BIGPOINT_DYNTYPE * _this, struct json_object * json)
{
const char * string = json_object_get_string(json);
_this->type = BIGPOINT_DYNTYPE_STRING;
_this->type = DYNTYPE_TYPE_STRING;
_this->size = strlen(string);
(_this->data)._string = calloc(_this->size + 1, sizeof(char));
memcpy((_this->data)._string, string, _this->size);
@ -57,13 +57,13 @@ __jsonConst(struct BIGPOINT_DYNTYPE * _this, struct json_object * json)
break;
case json_type_object:
_this->type = BIGPOINT_DYNTYPE_HASH;
_this->size = sizeof(struct BIGPOINT_HASH *);
(_this->data)._hash = newFromJson(BIGPOINT_HASH, json);
_this->type = DYNTYPE_TYPE_HASH;
_this->size = sizeof(struct DYNTYPE_HASH *);
(_this->data)._hash = newFromJson(DYNTYPE_HASH, json);
break;
default:
_this->type = BIGPOINT_DYNTYPE_NULL;
_this->type = DYNTYPE_TYPE_NULL;
_this->size = 0;
(_this->data)._hash = NULL;
}
@ -71,15 +71,15 @@ __jsonConst(struct BIGPOINT_DYNTYPE * _this, struct json_object * json)
static
void
__destruct(struct BIGPOINT_DYNTYPE * _this)
__destruct(struct DYNTYPE * _this)
{
if (_this) {
switch(_this->type) {
case BIGPOINT_DYNTYPE_STRING:
case DYNTYPE_TYPE_STRING:
free((_this->data)._string);
break;
case BIGPOINT_DYNTYPE_HASH:
case DYNTYPE_TYPE_HASH:
delete((_this->data)._hash);
break;
@ -91,20 +91,20 @@ __destruct(struct BIGPOINT_DYNTYPE * _this)
static
struct json_object *
__toJson(struct BIGPOINT_DYNTYPE * _this)
__toJson(struct DYNTYPE * _this)
{
struct json_object * json = NULL;
switch(_this->type) {
case BIGPOINT_DYNTYPE_INT:
case DYNTYPE_TYPE_INT:
json = json_object_new_int((_this->data)._int);
break;
case BIGPOINT_DYNTYPE_STRING:
case DYNTYPE_TYPE_STRING:
json = json_object_new_string((_this->data)._string);
break;
case BIGPOINT_DYNTYPE_HASH:
case DYNTYPE_TYPE_HASH:
json = toJson((_this->data)._hash);
break;
@ -116,14 +116,14 @@ __toJson(struct BIGPOINT_DYNTYPE * _this)
}
static const
struct BIGPOINT_CCLASS _bigpoint_dyntype = {
sizeof(struct BIGPOINT_DYNTYPE),
struct CCLASS _dyntype = {
sizeof(struct DYNTYPE),
(ctor)__construct,
(jCtor)__jsonConst,
(dtor)__destruct,
(jTo)__toJson
};
const struct BIGPOINT_CCLASS * const BIGPOINT_DYNTYPE = &_bigpoint_dyntype;
const struct CCLASS * const DYNTYPE = &_dyntype;
// vim: set et ts=4 sw=4:

48
bigpoint_hash.c → src/dyntype/hash.c

@ -2,17 +2,19 @@
#include <stdlib.h>
#include <json/json.h>
#include "bigpoint/bigpoint_hash.h"
#include "cclass.h"
#include "dyntype.h"
#include "dyntype/hash.h"
#define HASH_ENTRY_CHUNK_SIZE 128
static void _updateHashSize(struct BIGPOINT_HASH * _this);
static void _updateHashSize(struct DYNTYPE_HASH * _this);
static
void
__construct(struct BIGPOINT_HASH * _this, va_list * params)
__construct(struct DYNTYPE_HASH * _this, va_list * params)
{
_this->size = 0;
_this->used = 0;
@ -21,7 +23,7 @@ __construct(struct BIGPOINT_HASH * _this, va_list * params)
static
void
__jsonConst(struct BIGPOINT_HASH * _this, struct json_object * json)
__jsonConst(struct DYNTYPE_HASH * _this, struct json_object * json)
{
__construct(_this, NULL);
@ -30,13 +32,13 @@ __jsonConst(struct BIGPOINT_HASH * _this, struct json_object * json)
}
json_object_object_foreach(json, key, value) {
bigpoint_hash_set(_this, key, newFromJson(BIGPOINT_DYNTYPE, value));
dyntype_hash_set(_this, key, newFromJson(DYNTYPE, value));
}
}
static
void
__destruct(struct BIGPOINT_HASH * _this)
__destruct(struct DYNTYPE_HASH * _this)
{
size_t index;
@ -50,7 +52,7 @@ __destruct(struct BIGPOINT_HASH * _this)
static
struct json_object *
__toJson(struct BIGPOINT_HASH * _this)
__toJson(struct DYNTYPE_HASH * _this)
{
size_t index;
struct json_object * json = json_object_new_object();
@ -66,19 +68,19 @@ __toJson(struct BIGPOINT_HASH * _this)
}
static const
struct BIGPOINT_CCLASS _bigpoint_hash = {
sizeof(struct BIGPOINT_HASH),
struct CCLASS _dyntype_hash = {
sizeof(struct DYNTYPE_HASH),
(ctor)__construct,
(jCtor)__jsonConst,
(dtor)__destruct,
(jTo)__toJson
};
const struct BIGPOINT_CCLASS * const BIGPOINT_HASH = &_bigpoint_hash;
const struct CCLASS * const DYNTYPE_HASH = &_dyntype_hash;
static
void
_updateHashSize(struct BIGPOINT_HASH * _this)
_updateHashSize(struct DYNTYPE_HASH * _this)
{
if (_this->used == _this->size) {
_this->size += HASH_ENTRY_CHUNK_SIZE;
@ -90,16 +92,16 @@ _updateHashSize(struct BIGPOINT_HASH * _this)
_this->values = realloc(
_this->values,
sizeof(struct BIGPOINT_DYNTYPE *) * _this->size);
memset(_this->values + (_this->used * sizeof(struct BIGPOINT_DYNTYPE *)),
sizeof(struct DYNTYPE *) * _this->size);
memset(_this->values + (_this->used * sizeof(struct DYNTYPE *)),
0,
HASH_ENTRY_CHUNK_SIZE * sizeof(struct BIGPOINT_DYNTYPE *));
HASH_ENTRY_CHUNK_SIZE * sizeof(struct DYNTYPE *));
}
}
static
size_t
_getHashIdx(struct BIGPOINT_HASH * _this, const char * key)
_getHashIdx(struct DYNTYPE_HASH * _this, const char * key)
{
size_t index;
@ -111,9 +113,9 @@ _getHashIdx(struct BIGPOINT_HASH * _this, const char * key)
}
void
bigpoint_hash_set(struct BIGPOINT_HASH * _this,
dyntype_hash_set(struct DYNTYPE_HASH * _this,
const char * key,
struct BIGPOINT_DYNTYPE * value)
struct DYNTYPE * value)
{
size_t index = _getHashIdx(_this, key);
@ -129,8 +131,8 @@ bigpoint_hash_set(struct BIGPOINT_HASH * _this,
_updateHashSize(_this);
}
struct BIGPOINT_DYNTYPE *
bigpoint_hash_get(struct BIGPOINT_HASH * _this, const char * key)
struct DYNTYPE *
dyntype_hash_get(struct DYNTYPE_HASH * _this, const char * key)
{
size_t index = _getHashIdx(_this, key);
@ -141,10 +143,10 @@ bigpoint_hash_get(struct BIGPOINT_HASH * _this, const char * key)
return _this->values[index];
}
struct BIGPOINT_DYNTYPE *
bigpoint_hash_del(struct BIGPOINT_HASH * _this, const char * key)
struct DYNTYPE *
dyntype_hash_del(struct DYNTYPE_HASH * _this, const char * key)
{
struct BIGPOINT_DYNTYPE * found = NULL;
struct DYNTYPE * found = NULL;
size_t index = _getHashIdx(_this, key);
if (index == _this->used) {
@ -159,7 +161,7 @@ bigpoint_hash_del(struct BIGPOINT_HASH * _this, const char * key)
memmove(_this->values + index + 1,
_this->values + index,
(_this->size - index) * sizeof(struct BIGPOINT_DYNTYPE *));
(_this->size - index) * sizeof(struct DYNTYPE *));
_this->used -= 1;
}

104
src/packet.c

@ -0,0 +1,104 @@
#include <json/json.h>
#include "packet.h"
static
void
__construct(struct PACKET * _this, va_list * params)
{
packet_set_default_content(_this);
}
static
void
__jsonConst(struct PACKET * _this, struct json_object * json)
{
struct json_object * header = NULL;
struct json_object * data = NULL;
if (! json_type_array == json_object_get_type(json)) {
packet_set_default_content(_this);
return;
}
header = json_object_array_get_idx(json, 0);
data = json_object_array_get_idx(json, 1);
if (! (header && data)) {
packet_set_default_content(_this);
return;
}
packet_setHeader(_this, newFromJson(DYNTYPE, header));
packet_setData(_this, newFromJson(DYNTYPE, data));
}
static
void
__destruct(struct PACKET * _this)
{
}
static
struct json_object *
__toJson(struct PACKET * _this)
{
struct json_object * json = json_object_new_array();
json_object_array_add(json, toJson(packet_getHeader(_this)));
json_object_array_add(json, toJson(packet_getData(_this)));
return json;
}
static const
struct CCLASS _packet = {
sizeof(struct PACKET),
(ctor)__construct,
(jCtor)__jsonConst,
(dtor)__destruct,
(jTo)__toJson
};
const struct CCLASS * const PACKET = &_packet;
struct DYNTYPE *
packet_getHeader(
struct PACKET * _this)
{
return _this->content[PACKET_HEADER];
}
struct DYNTYPE *
packet_getData(
struct PACKET * _this)
{
return _this->content[PACKET_DATA];
}
void
packet_setHeader(
struct PACKET * _this,
struct DYNTYPE * header)
{
_this->content[PACKET_HEADER] = header;
}
void
packet_setData(
struct PACKET * _this,
struct DYNTYPE * data)
{
_this->content[PACKET_DATA] = data;
}
void
packet_set_default_content(
struct PACKET * _this)
{
_this->content[PACKET_HEADER] = NULL;
_this->content[PACKET_DATA] = NULL;
}
// vim: set et ts=4 sw=4:

22
tests/Makefile.am

@ -0,0 +1,22 @@
TESTS = crypt decrypt dyntype hash packet
check_PROGRAMS = crypt decrypt dyntype hash packet
crypt_SOURCES = crypt.c ../base64.c
crypt_LDADD = ../src/libtoken.la $(LIBOBJS)
crypt_CFLAGS = -I ../include -I ..
decrypt_SOURCES = decrypt.c ../base64.c
decrypt_LDADD = ../src/libtoken.la $(LIBOBJS)
decrypt_CFLAGS = -I ../include -I ..
dyntype_SOURCES = dyntype.c
dyntype_LDADD = ../src/libtoken.la $(LIBOBJS)
dyntype_CFLAGS = -I ../include -I ..
hash_SOURCES = hash.c
hash_LDADD = ../src/libtoken.la $(LIBOBJS)
hash_CFLAGS = -I ../include -I ..
packet_SOURCES = packet.c
packet_LDADD = ../src/libtoken.la $(LIBOBJS)
packet_CFLAGS = -I ../include -I ..

724
tests/Makefile.in

@ -0,0 +1,724 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
TESTS = crypt$(EXEEXT) decrypt$(EXEEXT) dyntype$(EXEEXT) hash$(EXEEXT) \
packet$(EXEEXT)
check_PROGRAMS = crypt$(EXEEXT) decrypt$(EXEEXT) dyntype$(EXEEXT) \
hash$(EXEEXT) packet$(EXEEXT)
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am_crypt_OBJECTS = crypt-crypt.$(OBJEXT) crypt-base64.$(OBJEXT)
crypt_OBJECTS = $(am_crypt_OBJECTS)
crypt_DEPENDENCIES = ../src/libtoken.la $(LIBOBJS)
crypt_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(crypt_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
am_decrypt_OBJECTS = decrypt-decrypt.$(OBJEXT) \
decrypt-base64.$(OBJEXT)
decrypt_OBJECTS = $(am_decrypt_OBJECTS)
decrypt_DEPENDENCIES = ../src/libtoken.la $(LIBOBJS)
decrypt_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(decrypt_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
am_dyntype_OBJECTS = dyntype-dyntype.$(OBJEXT)
dyntype_OBJECTS = $(am_dyntype_OBJECTS)
dyntype_DEPENDENCIES = ../src/libtoken.la $(LIBOBJS)
dyntype_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(dyntype_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
am_hash_OBJECTS = hash-hash.$(OBJEXT)
hash_OBJECTS = $(am_hash_OBJECTS)
hash_DEPENDENCIES = ../src/libtoken.la $(LIBOBJS)
hash_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(hash_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
am_packet_OBJECTS = packet-packet.$(OBJEXT)
packet_OBJECTS = $(am_packet_OBJECTS)
packet_DEPENDENCIES = ../src/libtoken.la $(LIBOBJS)
packet_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(packet_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(crypt_SOURCES) $(decrypt_SOURCES) $(dyntype_SOURCES) \
$(hash_SOURCES) $(packet_SOURCES)
DIST_SOURCES = $(crypt_SOURCES) $(decrypt_SOURCES) $(dyntype_SOURCES) \
$(hash_SOURCES) $(packet_SOURCES)
ETAGS = etags
CTAGS = ctags
am__tty_colors = \
red=; grn=; lgn=; blu=; std=
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
crypt_SOURCES = crypt.c ../base64.c
crypt_LDADD = ../src/libtoken.la $(LIBOBJS)
crypt_CFLAGS = -I ../include -I ..
decrypt_SOURCES = decrypt.c ../base64.c
decrypt_LDADD = ../src/libtoken.la $(LIBOBJS)
decrypt_CFLAGS = -I ../include -I ..
dyntype_SOURCES = dyntype.c
dyntype_LDADD = ../src/libtoken.la $(LIBOBJS)
dyntype_CFLAGS = -I ../include -I ..
hash_SOURCES = hash.c
hash_LDADD = ../src/libtoken.la $(LIBOBJS)
hash_CFLAGS = -I ../include -I ..
packet_SOURCES = packet.c
packet_LDADD = ../src/libtoken.la $(LIBOBJS)
packet_CFLAGS = -I ../include -I ..
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu tests/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
crypt$(EXEEXT): $(crypt_OBJECTS) $(crypt_DEPENDENCIES)
@rm -f crypt$(EXEEXT)
$(crypt_LINK) $(crypt_OBJECTS) $(crypt_LDADD) $(LIBS)
decrypt$(EXEEXT): $(decrypt_OBJECTS) $(decrypt_DEPENDENCIES)
@rm -f decrypt$(EXEEXT)
$(decrypt_LINK) $(decrypt_OBJECTS) $(decrypt_LDADD) $(LIBS)
dyntype$(EXEEXT): $(dyntype_OBJECTS) $(dyntype_DEPENDENCIES)
@rm -f dyntype$(EXEEXT)
$(dyntype_LINK) $(dyntype_OBJECTS) $(dyntype_LDADD) $(LIBS)
hash$(EXEEXT): $(hash_OBJECTS) $(hash_DEPENDENCIES)
@rm -f hash$(EXEEXT)
$(hash_LINK) $(hash_OBJECTS) $(hash_LDADD) $(LIBS)
packet$(EXEEXT): $(packet_OBJECTS) $(packet_DEPENDENCIES)
@rm -f packet$(EXEEXT)
$(packet_LINK) $(packet_OBJECTS) $(packet_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypt-base64.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypt-crypt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decrypt-base64.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decrypt-decrypt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dyntype-dyntype.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash-hash.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet-packet.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
crypt-crypt.o: crypt.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(crypt_CFLAGS) $(CFLAGS) -MT crypt-crypt.o -MD -MP -MF $(DEPDIR)/crypt-crypt.Tpo -c -o crypt-crypt.o `test -f 'crypt.c' || echo '$(srcdir)/'`crypt.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/crypt-crypt.Tpo $(DEPDIR)/crypt-crypt.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crypt.c' object='crypt-crypt.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(crypt_CFLAGS) $(CFLAGS) -c -o crypt-crypt.o `test -f 'crypt.c' || echo '$(srcdir)/'`crypt.c
crypt-crypt.obj: crypt.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(crypt_CFLAGS) $(CFLAGS) -MT crypt-crypt.obj -MD -MP -MF $(DEPDIR)/crypt-crypt.Tpo -c -o crypt-crypt.obj `if test -f 'crypt.c'; then $(CYGPATH_W) 'crypt.c'; else $(CYGPATH_W) '$(srcdir)/crypt.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/crypt-crypt.Tpo $(DEPDIR)/crypt-crypt.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crypt.c' object='crypt-crypt.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(crypt_CFLAGS) $(CFLAGS) -c -o crypt-crypt.obj `if test -f 'crypt.c'; then $(CYGPATH_W) 'crypt.c'; else $(CYGPATH_W) '$(srcdir)/crypt.c'; fi`
crypt-base64.o: ../base64.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(crypt_CFLAGS) $(CFLAGS) -MT crypt-base64.o -MD -MP -MF $(DEPDIR)/crypt-base64.Tpo -c -o crypt-base64.o `test -f '../base64.c' || echo '$(srcdir)/'`../base64.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/crypt-base64.Tpo $(DEPDIR)/crypt-base64.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../base64.c' object='crypt-base64.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(crypt_CFLAGS) $(CFLAGS) -c -o crypt-base64.o `test -f '../base64.c' || echo '$(srcdir)/'`../base64.c
crypt-base64.obj: ../base64.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(crypt_CFLAGS) $(CFLAGS) -MT crypt-base64.obj -MD -MP -MF $(DEPDIR)/crypt-base64.Tpo -c -o crypt-base64.obj `if test -f '../base64.c'; then $(CYGPATH_W) '../base64.c'; else $(CYGPATH_W) '$(srcdir)/../base64.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/crypt-base64.Tpo $(DEPDIR)/crypt-base64.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../base64.c' object='crypt-base64.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(crypt_CFLAGS) $(CFLAGS) -c -o crypt-base64.obj `if test -f '../base64.c'; then $(CYGPATH_W) '../base64.c'; else $(CYGPATH_W) '$(srcdir)/../base64.c'; fi`
decrypt-decrypt.o: decrypt.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(decrypt_CFLAGS) $(CFLAGS) -MT decrypt-decrypt.o -MD -MP -MF $(DEPDIR)/decrypt-decrypt.Tpo -c -o decrypt-decrypt.o `test -f 'decrypt.c' || echo '$(srcdir)/'`decrypt.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/decrypt-decrypt.Tpo $(DEPDIR)/decrypt-decrypt.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='decrypt.c' object='decrypt-decrypt.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(decrypt_CFLAGS) $(CFLAGS) -c -o decrypt-decrypt.o `test -f 'decrypt.c' || echo '$(srcdir)/'`decrypt.c
decrypt-decrypt.obj: decrypt.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(decrypt_CFLAGS) $(CFLAGS) -MT decrypt-decrypt.obj -MD -MP -MF $(DEPDIR)/decrypt-decrypt.Tpo -c -o decrypt-decrypt.obj `if test -f 'decrypt.c'; then $(CYGPATH_W) 'decrypt.c'; else $(CYGPATH_W) '$(srcdir)/decrypt.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/decrypt-decrypt.Tpo $(DEPDIR)/decrypt-decrypt.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='decrypt.c' object='decrypt-decrypt.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(decrypt_CFLAGS) $(CFLAGS) -c -o decrypt-decrypt.obj `if test -f 'decrypt.c'; then $(CYGPATH_W) 'decrypt.c'; else $(CYGPATH_W) '$(srcdir)/decrypt.c'; fi`
decrypt-base64.o: ../base64.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(decrypt_CFLAGS) $(CFLAGS) -MT decrypt-base64.o -MD -MP -MF $(DEPDIR)/decrypt-base64.Tpo -c -o decrypt-base64.o `test -f '../base64.c' || echo '$(srcdir)/'`../base64.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/decrypt-base64.Tpo $(DEPDIR)/decrypt-base64.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../base64.c' object='decrypt-base64.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(decrypt_CFLAGS) $(CFLAGS) -c -o decrypt-base64.o `test -f '../base64.c' || echo '$(srcdir)/'`../base64.c
decrypt-base64.obj: ../base64.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(decrypt_CFLAGS) $(CFLAGS) -MT decrypt-base64.obj -MD -MP -MF $(DEPDIR)/decrypt-base64.Tpo -c -o decrypt-base64.obj `if test -f '../base64.c'; then $(CYGPATH_W) '../base64.c'; else $(CYGPATH_W) '$(srcdir)/../base64.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/decrypt-base64.Tpo $(DEPDIR)/decrypt-base64.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../base64.c' object='decrypt-base64.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(decrypt_CFLAGS) $(CFLAGS) -c -o decrypt-base64.obj `if test -f '../base64.c'; then $(CYGPATH_W) '../base64.c'; else $(CYGPATH_W) '$(srcdir)/../base64.c'; fi`
dyntype-dyntype.o: dyntype.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dyntype_CFLAGS) $(CFLAGS) -MT dyntype-dyntype.o -MD -MP -MF $(DEPDIR)/dyntype-dyntype.Tpo -c -o dyntype-dyntype.o `test -f 'dyntype.c' || echo '$(srcdir)/'`dyntype.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dyntype-dyntype.Tpo $(DEPDIR)/dyntype-dyntype.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dyntype.c' object='dyntype-dyntype.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dyntype_CFLAGS) $(CFLAGS) -c -o dyntype-dyntype.o `test -f 'dyntype.c' || echo '$(srcdir)/'`dyntype.c
dyntype-dyntype.obj: dyntype.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dyntype_CFLAGS) $(CFLAGS) -MT dyntype-dyntype.obj -MD -MP -MF $(DEPDIR)/dyntype-dyntype.Tpo -c -o dyntype-dyntype.obj `if test -f 'dyntype.c'; then $(CYGPATH_W) 'dyntype.c'; else $(CYGPATH_W) '$(srcdir)/dyntype.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dyntype-dyntype.Tpo $(DEPDIR)/dyntype-dyntype.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dyntype.c' object='dyntype-dyntype.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dyntype_CFLAGS) $(CFLAGS) -c -o dyntype-dyntype.obj `if test -f 'dyntype.c'; then $(CYGPATH_W) 'dyntype.c'; else $(CYGPATH_W) '$(srcdir)/dyntype.c'; fi`
hash-hash.o: hash.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hash_CFLAGS) $(CFLAGS) -MT hash-hash.o -MD -MP -MF $(DEPDIR)/hash-hash.Tpo -c -o hash-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hash-hash.Tpo $(DEPDIR)/hash-hash.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hash.c' object='hash-hash.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hash_CFLAGS) $(CFLAGS) -c -o hash-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c
hash-hash.obj: hash.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hash_CFLAGS) $(CFLAGS) -MT hash-hash.obj -MD -MP -MF $(DEPDIR)/hash-hash.Tpo -c -o hash-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hash-hash.Tpo $(DEPDIR)/hash-hash.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hash.c' object='hash-hash.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hash_CFLAGS) $(CFLAGS) -c -o hash-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi`
packet-packet.o: packet.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(packet_CFLAGS) $(CFLAGS) -MT packet-packet.o -MD -MP -MF $(DEPDIR)/packet-packet.Tpo -c -o packet-packet.o `test -f 'packet.c' || echo '$(srcdir)/'`packet.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/packet-packet.Tpo $(DEPDIR)/packet-packet.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='packet.c' object='packet-packet.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(packet_CFLAGS) $(CFLAGS) -c -o packet-packet.o `test -f 'packet.c' || echo '$(srcdir)/'`packet.c
packet-packet.obj: packet.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(packet_CFLAGS) $(CFLAGS) -MT packet-packet.obj -MD -MP -MF $(DEPDIR)/packet-packet.Tpo -c -o packet-packet.obj `if test -f 'packet.c'; then $(CYGPATH_W) 'packet.c'; else $(CYGPATH_W) '$(srcdir)/packet.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/packet-packet.Tpo $(DEPDIR)/packet-packet.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='packet.c' object='packet-packet.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(packet_CFLAGS) $(CFLAGS) -c -o packet-packet.obj `if test -f 'packet.c'; then $(CYGPATH_W) 'packet.c'; else $(CYGPATH_W) '$(srcdir)/packet.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list=' $(TESTS) '; \
$(am__tty_colors); \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
col=$$red; res=XPASS; \
;; \
*) \
col=$$grn; res=PASS; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xfail=`expr $$xfail + 1`; \
col=$$lgn; res=XFAIL; \
;; \
*) \
failed=`expr $$failed + 1`; \
col=$$red; res=FAIL; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
col=$$blu; res=SKIP; \
fi; \
echo "$${col}$$res$${std}: $$tst"; \
done; \
if test "$$all" -eq 1; then \
tests="test"; \
All=""; \
else \
tests="tests"; \
All="All "; \
fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="$$All$$all $$tests passed"; \
else \
if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all $$tests failed"; \
else \
if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
if test "$$skip" -eq 1; then \
skipped="($$skip test was not run)"; \
else \
skipped="($$skip tests were not run)"; \
fi; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
if test "$$failed" -eq 0; then \
echo "$$grn$$dashes"; \
else \
echo "$$red$$dashes"; \
fi; \
echo "$$banner"; \
test -z "$$skipped" || echo "$$skipped"; \
test -z "$$report" || echo "$$report"; \
echo "$$dashes$$std"; \
test "$$failed" -eq 0; \
else :; fi
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool ctags \
distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

12
tests/crypt_test.c → tests/crypt.c

@ -4,9 +4,9 @@
#include <stdio.h>
#include <sys/types.h>
#include "../bigpoint_cclass.h"
#include "../bigpoint_crypt.h"
#include "../base64.h"
#include "cclass.h"
#include "crypt.h"
#include "base64.h"
int
@ -18,10 +18,10 @@ main(int argc, char * argv[])
char * encrypted = NULL;
size_t length = strlen(data);
struct BIGPOINT_CRYPT * crypt = NULL;
struct CRYPT * crypt = NULL;
crypt = new(BIGPOINT_CRYPT, MCRYPT_RIJNDAEL_256, MCRYPT_CFB);
encrypted = bigpoint_crypt_encrypt(crypt, data, pass, &length);
crypt = new(CRYPT, MCRYPT_RIJNDAEL_256, MCRYPT_CFB);
encrypted = crypt_encrypt(crypt, data, pass, &length);
delete(crypt);
b64d = calloc(BASE64_LENGTH(length), sizeof(char));

12
tests/decrypt_test.c → tests/decrypt.c

@ -4,9 +4,9 @@
#include <stdio.h>
#include <sys/types.h>
#include "../bigpoint_cclass.h"
#include "../bigpoint_crypt.h"
#include "../base64.h"
#include "cclass.h"
#include "crypt.h"
#include "base64.h"
int
@ -18,7 +18,7 @@ main(int argc, char * argv[])
char * decrypted = NULL;
size_t length = strlen(b64d);
struct BIGPOINT_CRYPT * crypt = NULL;
struct CRYPT * crypt = NULL;
data = calloc(length, sizeof(char));
base64_decode(b64d, length, data, &length);
@ -26,8 +26,8 @@ main(int argc, char * argv[])
data = realloc(data, length + 1);
data[length] = '\0';
crypt = new(BIGPOINT_CRYPT, MCRYPT_RIJNDAEL_256, MCRYPT_CFB);
decrypted = bigpoint_crypt_decrypt(crypt, data, pass, &length);
crypt = new(CRYPT, MCRYPT_RIJNDAEL_256, MCRYPT_CFB);
decrypted = crypt_decrypt(crypt, data, pass, &length);
delete(crypt);
free(data);

29
tests/dyntype_test.c → tests/dyntype.c

@ -2,8 +2,9 @@
#include <string.h>
#include <json/json.h>
#include "../bigpoint_cclass.h"
#include "../bigpoint_dyntype.h"
#include "cclass.h"
#include "dyntype.h"
#define TEST_STR "this is a foo string"
#define TEST_KEY1 "key1"
@ -14,15 +15,15 @@
int
main(int argc, char * argv[])
{
struct json_object * json = json_object_new_int(123);
struct BIGPOINT_DYNTYPE * dyn = newFromJson(BIGPOINT_DYNTYPE, json);
struct json_object * json = json_object_new_int(123);
struct DYNTYPE * dyn = newFromJson(DYNTYPE, json);
printf("%d\n", (dyn->data)._int);
delete(dyn);
json_object_put(json);
dyn = new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_INT, sizeof(int), 321);
dyn = new(DYNTYPE, DYNTYPE_TYPE_INT, sizeof(int), 321);
json = toJson(dyn);
printf("%s\n", json_object_to_json_string(json));
@ -31,14 +32,14 @@ main(int argc, char * argv[])
json_object_put(json);
json = json_object_new_string(TEST_STR);
dyn = newFromJson(BIGPOINT_DYNTYPE, json);
dyn = newFromJson(DYNTYPE, json);
printf("%s\n", (dyn->data)._string);
delete(dyn);
json_object_put(json);
dyn = new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_STRING, strlen(TEST_STR), TEST_STR);
dyn = new(DYNTYPE, DYNTYPE_TYPE_STRING, strlen(TEST_STR), TEST_STR);
json = toJson(dyn);
printf("%s\n", json_object_to_json_string(json));
@ -47,26 +48,26 @@ main(int argc, char * argv[])
json_object_put(json);
json = json_tokener_parse("{\"key1\":123,\"key2\":321,\"key3\":\"" TEST_STR "\"}");
dyn = newFromJson(BIGPOINT_DYNTYPE, json);
dyn = newFromJson(DYNTYPE, json);
json_object_put(json);
json = toJson(dyn);
printf("%s\n", json_object_to_json_string(json));
json_object_put(json);
if (BIGPOINT_DYNTYPE_HASH == dyn->type) {
struct BIGPOINT_HASH * hash = (dyn->data)._hash;
struct BIGPOINT_DYNTYPE * value;
if (DYNTYPE_TYPE_HASH == dyn->type) {
struct DYNTYPE_HASH * hash = (dyn->data)._hash;
struct DYNTYPE * value;
value = bigpoint_hash_get(hash, TEST_KEY1);
value = dyntype_hash_get(hash, TEST_KEY1);
printf("%d\n", (value->data)._int);
delete(value);
value = bigpoint_hash_get(hash, TEST_KEY2);
value = dyntype_hash_get(hash, TEST_KEY2);
printf("%d\n", (value->data)._int);
delete(value);
value = bigpoint_hash_get(hash, TEST_KEY3);
value = dyntype_hash_get(hash, TEST_KEY3);
printf("%s\n", (value->data)._string);
delete(value);
}

28
tests/hash_test.c → tests/hash.c

@ -2,8 +2,8 @@
#include <string.h>
#include <json/json.h>
#include "../bigpoint_cclass.h"
#include "../bigpoint_hash.h"
#include "cclass.h"
#include "dyntype/hash.h"
#define TEST_KEY1 "key1"
@ -13,39 +13,39 @@
int
main(int argc, char * argv[])
{
struct BIGPOINT_DYNTYPE * dyn;
struct BIGPOINT_HASH * hash = new(BIGPOINT_HASH);
struct json_object * json;
struct DYNTYPE * dyn;
struct DYNTYPE_HASH * hash = new(DYNTYPE_HASH);
struct json_object * json;
dyn = new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_INT, sizeof(int), 123);
bigpoint_hash_set(hash, TEST_KEY1, dyn);
dyn = new(DYNTYPE, DYNTYPE_TYPE_INT, sizeof(int), 123);
dyntype_hash_set(hash, TEST_KEY1, dyn);
dyn = new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_INT, sizeof(int), 321);
bigpoint_hash_set(hash, TEST_KEY2, dyn);
dyn = new(DYNTYPE, DYNTYPE_TYPE_INT, sizeof(int), 321);
dyntype_hash_set(hash, TEST_KEY2, dyn);
json = toJson(hash);
printf("%s\n", json_object_to_json_string(json));
json_object_put(json);
dyn = bigpoint_hash_get(hash, TEST_KEY1);
dyn = dyntype_hash_get(hash, TEST_KEY1);
printf("%d\n", (dyn->data)._int);
delete(dyn);
dyn = bigpoint_hash_get(hash, TEST_KEY2);
dyn = dyntype_hash_get(hash, TEST_KEY2);
printf("%d\n", (dyn->data)._int);
delete(dyn);
delete(hash);
json = json_tokener_parse("{\"key1\":123,\"key2\":321}");
hash = newFromJson(BIGPOINT_HASH, json);
hash = newFromJson(DYNTYPE_HASH, json);
json_object_put(json);
dyn = bigpoint_hash_get(hash, TEST_KEY1);
dyn = dyntype_hash_get(hash, TEST_KEY1);
printf("%d\n", (dyn->data)._int);
delete(dyn);
dyn = bigpoint_hash_get(hash, TEST_KEY2);
dyn = dyntype_hash_get(hash, TEST_KEY2);
printf("%d\n", (dyn->data)._int);
delete(dyn);

100
tests/packet.c

@ -0,0 +1,100 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <json/json.h>
#include "cclass.h"
#include "packet.h"
#include "dyntype.h"
#include "dyntype/hash.h"
void
setHashString(struct DYNTYPE_HASH * hash, const char * key, const char * value)
{
struct DYNTYPE * dyn;
dyn = new(DYNTYPE, DYNTYPE_TYPE_STRING, strlen(value), value);
dyntype_hash_set(hash, key, dyn);
}
void
setHashInt(struct DYNTYPE_HASH * hash, const char * key, const int value)
{
struct DYNTYPE * dyn;
dyn = new(DYNTYPE, DYNTYPE_TYPE_INT, sizeof(int), value);
dyntype_hash_set(hash, key, dyn);
}
int
main(int argc, char * argv[])
{
struct PACKET * packet;
struct DYNTYPE_HASH * data;
struct json_object * json;
char * json_str;
packet = new(PACKET);
packet_setHeader(
packet,
new(DYNTYPE, DYNTYPE_TYPE_INT, sizeof(int), time(NULL)));
data = new(DYNTYPE_HASH);
setHashString(data, "#C#", "this comes from C");
setHashString(data, "usr", "ppohg");
setHashString(data, "pas", "yyyyy");
setHashInt(data, "val", 321);
packet_setData(
packet,
new(DYNTYPE,
DYNTYPE_HASH,
sizeof(struct DYNTYPE_HASH *),
data));
json = toJson(packet);
json_str = calloc(
strlen(json_object_to_json_string(json)) + 1,
sizeof(char));
memcpy(json_str,
json_object_to_json_string(json),
strlen(json_object_to_json_string(json)));
printf("%s\n", json_str);
delete(dyntype_hash_get(data, "#C#"));
delete(dyntype_hash_get(data, "usr"));
delete(dyntype_hash_get(data, "pas"));
delete(dyntype_hash_get(data, "val"));
delete(packet_getHeader(packet));
delete(packet_getData(packet));
delete(packet);
json_object_put(json);
json = json_tokener_parse(json_str);
packet = newFromJson(PACKET, json);
printf("%s\n", json_object_to_json_string(json));
data = (packet_getData(packet)->data)._hash;
delete(dyntype_hash_get(data, "#C#"));
delete(dyntype_hash_get(data, "usr"));
delete(dyntype_hash_get(data, "pas"));
delete(dyntype_hash_get(data, "val"));
delete(packet_getHeader(packet));
delete(packet_getData(packet));
delete(packet);
free(json_str);
json_object_put(json);
return 0;
}
// vim: set et ts=4 sw=4:

100
tests/packet_test.c

@ -1,100 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <json/json.h>
#include "../bigpoint_cclass.h"
#include "../bigpoint_packet.h"
#include "../bigpoint_dyntype.h"
#include "../bigpoint_hash.h"
void
setHashString(struct BIGPOINT_HASH * hash, const char * key, const char * value)
{
struct BIGPOINT_DYNTYPE * dyn;
dyn = new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_STRING, strlen(value), value);
bigpoint_hash_set(hash, key, dyn);
}
void
setHashInt(struct BIGPOINT_HASH * hash, const char * key, const int value)
{
struct BIGPOINT_DYNTYPE * dyn;
dyn = new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_INT, sizeof(int), value);
bigpoint_hash_set(hash, key, dyn);
}
int
main(int argc, char * argv[])
{
struct BIGPOINT_PACKET * packet;
struct BIGPOINT_HASH * data;
struct json_object * json;
char * json_str;
packet = new(BIGPOINT_PACKET);
bigpoint_packet_setHeader(
packet,
new(BIGPOINT_DYNTYPE, BIGPOINT_DYNTYPE_INT, sizeof(int), time(NULL)));
data = new(BIGPOINT_HASH);
setHashString(data, "#C#", "this comes from C");
setHashString(data, "usr", "ppohg");
setHashString(data, "pas", "yyyyy");
setHashInt(data, "val", 321);
bigpoint_packet_setData(
packet,
new(BIGPOINT_DYNTYPE,
BIGPOINT_DYNTYPE_HASH,
sizeof(struct BIGPOINT_HASH *),
data));
json = toJson(packet);
json_str = calloc(
strlen(json_object_to_json_string(json)) + 1,
sizeof(char));
memcpy(json_str,
json_object_to_json_string(json),
strlen(json_object_to_json_string(json)));
printf("%s\n", json_str);
delete(bigpoint_hash_get(data, "#C#"));
delete(bigpoint_hash_get(data, "usr"));
delete(bigpoint_hash_get(data, "pas"));
delete(bigpoint_hash_get(data, "val"));
delete(bigpoint_packet_getHeader(packet));
delete(bigpoint_packet_getData(packet));
delete(packet);
json_object_put(json);
json = json_tokener_parse(json_str);
packet = newFromJson(BIGPOINT_PACKET, json);
printf("%s\n", json_object_to_json_string(json));
data = (bigpoint_packet_getData(packet)->data)._hash;
delete(bigpoint_hash_get(data, "#C#"));
delete(bigpoint_hash_get(data, "usr"));
delete(bigpoint_hash_get(data, "pas"));
delete(bigpoint_hash_get(data, "val"));
delete(bigpoint_packet_getHeader(packet));
delete(bigpoint_packet_getData(packet));
delete(packet);
free(json_str);
json_object_put(json);
return 0;
}
// vim: set et ts=4 sw=4:
Loading…
Cancel
Save