Permalink
Browse files

added files to gitignore

moved non-mysql dependent functions from preg.c and ghmysql.c into pregUtils.c
  • Loading branch information...
1 parent 2ef9815 commit fee46cb33e81dbc5ad742a426d0489b2bb072097 raw committed Aug 18, 2013
Showing with 347 additions and 196 deletions.
  1. +13 −0 .gitignore
  2. +2 −0 Makefile.am
  3. +11 −0 Makefile.in
  4. +1 −1 README.md
  5. +3 −2 from_php.c
  6. +59 −4 ghfcns.c
  7. +1 −0 ghfcns.h
  8. +0 −31 ghmysql.c
  9. +1 −1 ghmysql.h
  10. +0 −155 preg.c
  11. +217 −0 preg_utils.c
  12. +37 −0 preg_utils.h
  13. +1 −1 test/Makefile.am
  14. +1 −1 test/Makefile.in
View
@@ -33,7 +33,20 @@ lib_mysqludf_preg_la-lib_mysqludf_preg_rlike.lo
lib_mysqludf_preg_la-lib_mysqludf_preg_rlike.o
lib_mysqludf_preg_la-preg.lo
lib_mysqludf_preg_la-preg.o
+lib_mysqludf_preg_la-ghfcns.lo
+lib_mysqludf_preg_la-ghfcns.o
+lib_mysqludf_preg_la-pregUtils.lo
+lib_mysqludf_preg_la-pregUtils.o
+lib_mysqludf_preg_la-preg_utils.lo
+lib_mysqludf_preg_la-preg_utils.o
+test/lib_mysqludf_preg_capture.log
+test/lib_mysqludf_preg_check.log
+test/lib_mysqludf_preg_info.log
+test/lib_mysqludf_preg_position.log
+test/lib_mysqludf_preg_replace.log
+test/lib_mysqludf_preg_rlike.log
libtool
stamp-h1
test/Makefile
+lib_mysqludf_preg-*.tar.gz
View
@@ -7,6 +7,7 @@ lib_LTLIBRARIES = lib_mysqludf_preg.la
CFILES= \
preg.c \
+ preg_utils.c \
ghmysql.c \
ghfcns.c \
from_php.c \
@@ -21,6 +22,7 @@ HFILES = \
preg.h \
ghmysql.h \
ghfcns.h \
+ preg_utils.h \
from_php.h
lib_mysqludf_preg_la_SOURCES = \
View
@@ -105,6 +105,7 @@ am__installdirs = "$(DESTDIR)$(libdir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
lib_mysqludf_preg_la_LIBADD =
am__objects_1 = lib_mysqludf_preg_la-preg.lo \
+ lib_mysqludf_preg_la-preg_utils.lo \
lib_mysqludf_preg_la-ghmysql.lo lib_mysqludf_preg_la-ghfcns.lo \
lib_mysqludf_preg_la-from_php.lo \
lib_mysqludf_preg_la-lib_mysqludf_preg_capture.lo \
@@ -381,6 +382,7 @@ AUTOMAKE_OPTIONS = foreign
lib_LTLIBRARIES = lib_mysqludf_preg.la
CFILES = \
preg.c \
+ preg_utils.c \
ghmysql.c \
ghfcns.c \
from_php.c \
@@ -395,6 +397,7 @@ HFILES = \
preg.h \
ghmysql.h \
ghfcns.h \
+ preg_utils.h \
from_php.h
lib_mysqludf_preg_la_SOURCES = \
@@ -516,6 +519,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_mysqludf_preg_la-lib_mysqludf_preg_replace.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_mysqludf_preg_la-lib_mysqludf_preg_rlike.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_mysqludf_preg_la-preg.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_mysqludf_preg_la-preg_utils.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -545,6 +549,13 @@ lib_mysqludf_preg_la-preg.lo: preg.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_mysqludf_preg_la_CFLAGS) $(CFLAGS) -c -o lib_mysqludf_preg_la-preg.lo `test -f 'preg.c' || echo '$(srcdir)/'`preg.c
+lib_mysqludf_preg_la-preg_utils.lo: preg_utils.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_mysqludf_preg_la_CFLAGS) $(CFLAGS) -MT lib_mysqludf_preg_la-preg_utils.lo -MD -MP -MF $(DEPDIR)/lib_mysqludf_preg_la-preg_utils.Tpo -c -o lib_mysqludf_preg_la-preg_utils.lo `test -f 'preg_utils.c' || echo '$(srcdir)/'`preg_utils.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lib_mysqludf_preg_la-preg_utils.Tpo $(DEPDIR)/lib_mysqludf_preg_la-preg_utils.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='preg_utils.c' object='lib_mysqludf_preg_la-preg_utils.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_mysqludf_preg_la_CFLAGS) $(CFLAGS) -c -o lib_mysqludf_preg_la-preg_utils.lo `test -f 'preg_utils.c' || echo '$(srcdir)/'`preg_utils.c
+
lib_mysqludf_preg_la-ghmysql.lo: ghmysql.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_mysqludf_preg_la_CFLAGS) $(CFLAGS) -MT lib_mysqludf_preg_la-ghmysql.lo -MD -MP -MF $(DEPDIR)/lib_mysqludf_preg_la-ghmysql.Tpo -c -o lib_mysqludf_preg_la-ghmysql.lo `test -f 'ghmysql.c' || echo '$(srcdir)/'`ghmysql.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lib_mysqludf_preg_la-ghmysql.Tpo $(DEPDIR)/lib_mysqludf_preg_la-ghmysql.Plo
View
@@ -76,7 +76,7 @@ The short instructions are:
Getting libmysql_udf_preg
===========================
Please visit the github repository at: https://github.com/mysqludf/lib_mysqludf_preg
-The latest released code is available on the master branch. Please help test by trying out the latest dev and rc branches too.
+The latest released code is available on the master branch. Please help test by trying out the latest dev and rc releases.
Reporting Bugs & Feedback
View
@@ -47,8 +47,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/
/*
- * This file was modified my Rich Waters <raw@goodhumans.com> for use
- * with a mysql udf.
+ * This file was modified by Rich Waters <raw@goodhumans.net> for use
+ * with a mysql udf and elsewhere.
*/
#include "pcre.h"
@@ -61,6 +61,7 @@ POSSIBILITY OF SUCH DAMAGE.
//#include "preg.h"
#include "ghfcns.h"
+#include "preg_utils.h"
#undef HAVE_SETLOCALE // R.A.W
View
@@ -1,15 +1,39 @@
/*
- * ghfcns.c
- * eMailGanizer
+ * Copyright (C) 2007-2013 Rich Waters <raw@goodhumans.net>
*
- * Created by Rich Waters on 9/3/10.
- * Copyright 2010 GoodHumans. All rights reserved.
+ * This file is part of lib_mysqludf_preg.
*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
+/** @file ghfcns.c
+ *
+ * @brief Provides some utility functions that are independent of mysql.
+ *
+ */
+
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <time.h>
+#include <stdarg.h>
#include "ghfcns.h"
@@ -47,3 +71,34 @@ char *ghstrndup( char *s , size_t l )
}
+/**
+ * @fn void ghlogprintf( fmt, ... )
+ *
+ * @brief log an error message to stderr in MySQL format
+ *
+ * @param fmt - a format string as per sprintf()
+ * @param ... - varargs as per sprintf()
+ *
+ * @return void
+ *
+ * @details - This function writes the specified error message
+ * to stderr prefixed by the current time in the same format
+ * used by MySQL
+ */
+void ghlogprintf(char *fmt, ...) {
+ va_list vargs;
+ char buf[18];
+ time_t now;
+ struct tm time_val;
+
+ memset(&buf, 0, sizeof(buf));
+
+ now = time(NULL);
+ localtime_r(&now, &time_val);
+ strftime(&buf[0], sizeof(buf), "%y%m%d %H:%M:%S ", &time_val);
+ fprintf(stderr, "%s", buf);
+
+ va_start(vargs, fmt);
+ vfprintf(stderr, fmt, vargs);
+ va_end(vargs);
+}
View
@@ -8,4 +8,5 @@
*/
char *ghstrndup( char *s , size_t l );
+void ghlogprintf(char *fmt, ...);
View
@@ -119,34 +119,3 @@ int ghargIsNullConstant(UDF_ARGS *args, int argNum)
return 0 ;
}
-/**
- * @fn void ghlogprintf( fmt, ... )
- *
- * @brief log an error message to stderr in MySQL format
- *
- * @param fmt - a format string as per sprintf()
- * @param ... - varargs as per sprintf()
- *
- * @return void
- *
- * @details - This function writes the specified error message
- * to stderr prefixed by the current time in the same format
- * used by MySQL
- */
-void ghlogprintf(char *fmt, ...) {
- va_list vargs;
- char buf[18];
- time_t now;
- struct tm time_val;
-
- memset(&buf, 0, sizeof(buf));
-
- now = time(NULL);
- localtime_r(&now, &time_val);
- strftime(&buf[0], sizeof(buf), "%y%m%d %H:%M:%S ", &time_val);
- fprintf(stderr, buf);
-
- va_start(vargs, fmt);
- vfprintf(stderr, fmt, vargs);
- va_end(vargs);
-}
View
@@ -1,3 +1,4 @@
+
/*
* Copyright (C) 2007-2013 Rich Waters <raw@goodhumans.net>
*
@@ -78,6 +79,5 @@ char *ghargdup( UDF_ARGS *args,int i ) ;
char *ghargdups( UDF_ARGS *args,int i , unsigned long *l) ;
//char *ghstrndup( char *s , int l );
int ghargIsNullConstant(UDF_ARGS *args, int argNum);
-void ghlogprintf(char *fmt, ...);
#endif
Oops, something went wrong.

0 comments on commit fee46cb

Please sign in to comment.