Permalink
Browse files

create the basic result table.

  • Loading branch information...
0 parents commit 03be6f2fb609311ee14dc8c8fc31a87461775aa6 @agentzh agentzh committed Aug 30, 2011
Showing with 639 additions and 0 deletions.
  1. +7 −0 .gitignore
  2. +67 −0 Makefile
  3. +14 −0 src/ddebug.h
  4. +310 −0 src/rds_parser.c
  5. +49 −0 src/rds_parser.h
  6. +59 −0 src/resty_dbd_stream.h
  7. +88 −0 t/RdsParser.pm
  8. +45 −0 t/sanity.t
@@ -0,0 +1,7 @@
+*~
+*.swp
+*.swo
+test.rds
+test_case.lua
+*.o
+*.so
@@ -0,0 +1,67 @@
+version=0.09
+
+name=lua-rds-parser
+dist=$(name)-$(version)
+
+LUA_VERSION = 5.1
+
+# See http://lua-users.org/wiki/BuildingModules for platform specific
+# details.
+
+## Linux/BSD
+PREFIX ?= /usr/local
+LDFLAGS += -shared
+
+## OSX (Macports)
+#PREFIX ?= /opt/local
+#LDFLAGS += -bundle -undefined dynamic_lookup
+
+LUA_INCLUDE_DIR ?= $(PREFIX)/include
+LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION)
+
+#CFLAGS ?= -g -Wall -pedantic -fno-inline
+CFLAGS ?= -g -O -Wall
+override CFLAGS += -fpic -I$(LUA_INCLUDE_DIR)
+
+INSTALL ?= install
+
+.PHONY: all clean dist test t
+
+#CC = gcc
+RM = rm -f
+
+all: parser.so
+
+src/rds_parser.o: src/ddebug.h src/rds_parser.h src/resty_dbd_stream.h
+
+parser.so: src/rds_parser.o
+ $(CC) $(LDFLAGS) -o $@ $^
+
+install:
+ $(INSTALL) -d $(DESTDIR)/$(LUA_LIB_DIR)/rds
+ $(INSTALL) parser.so $(DESTDIR)/$(LUA_LIB_DIR)/rds
+
+clean:
+ $(RM) *.so *.o rds/*.so
+
+test: all
+ $(INSTALL) -d rds
+ $(INSTALL) parser.so rds/
+ prove -r t
+
+valtest: parser.so
+ $(INSTALL) -d rds
+ $(INSTALL) parser.so rds/
+ TEST_LUA_USE_VALGRIND=1 prove -r t
+
+t: parser.so
+ $(INSTALL) -d rds
+ $(INSTALL) parser.so rds/
+ TEST_LUA_USE_VALGRIND=1 prove t/sanity.t
+
+dist:
+ git archive --prefix="$(dist)/" master | \
+ gzip -9 > "$(dist).tar.gz"
+ git archive --prefix="$(dist)/" \
+ -o "$(dist).zip" master
+
@@ -0,0 +1,14 @@
+#if defined(DDEBUG) && (DDEBUG)
+
+# include <stdio.h>
+
+# define dd(...) \
+ fprintf(stderr, __VA_ARGS__); \
+ fprintf(stderr, "\n")
+
+#else
+
+# define dd(fmt, ...)
+
+#endif
+
Oops, something went wrong.

0 comments on commit 03be6f2

Please sign in to comment.