Enlightenment CVS committal

Author  : mej
Project : eterm
Module  : libast

Dir     : eterm/libast/src


Modified Files:
        Makefile.am array.c msgs.c 
Added Files:
        module.c pthreads.c 


Log Message:
Thu Jul 13 14:02:08 2006                        Michael Jennings (mej)

Added thread, mutex, and condition interfaces along with their
corresponding pthreads-based implementations.  Not quite done yet, and
not tested.

Added dynamically-loadable module object class along with
corresponding unit tests.  Appears to work fine.
----------------------------------------------------------------------

===================================================================
RCS file: /cvs/e/eterm/libast/src/Makefile.am,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- Makefile.am 20 Apr 2006 21:44:40 -0000      1.17
+++ Makefile.am 13 Jul 2006 23:03:44 -0000      1.18
@@ -3,11 +3,13 @@
 lib_LTLIBRARIES = libast.la
 
 INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/include/$(PACKAGE)
+AM_CFLAGS = $(PTHREAD_CFLAGS)
+AM_LDFLAGS = $(PTHREAD_LIBS)
 
-libast_la_SOURCES =                                                    \
-    array.c builtin_hashes.c conf.c debug.c dlinked_list.c file.c      \
-    linked_list.c mbuff.c mem.c msgs.c obj.c objpair.c options.c       \
-    regexp.c socket.c str.c strings.c snprintf.c tok.c url.c ustr.c
+libast_la_SOURCES = array.c builtin_hashes.c conf.c debug.c            \
+dlinked_list.c file.c linked_list.c mbuff.c mem.c module.c msgs.c      \
+obj.c objpair.c options.c pthreads.c regexp.c socket.c str.c strings.c \
+snprintf.c tok.c url.c ustr.c
 
-libast_la_LDFLAGS = -version-info 2:1:0
+libast_la_LDFLAGS = -version-info 2:2:0
 MAINTAINERCLEANFILES = Makefile.in
===================================================================
RCS file: /cvs/e/eterm/libast/src/array.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- array.c     20 Apr 2006 21:44:40 -0000      1.20
+++ array.c     13 Jul 2006 23:03:44 -0000      1.21
@@ -728,7 +728,6 @@
     }
 
     left = self->len - i - 1;
-    printf("%d %d %d\n", i, left, self->len);
     tmp = self->items[i];
     memmove(self->items + i, self->items + i + 1, sizeof(spif_obj_t) * left);
     self->len--;
===================================================================
RCS file: /cvs/e/eterm/libast/src/msgs.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- msgs.c      23 Jul 2004 21:38:39 -0000      1.11
+++ msgs.c      13 Jul 2006 23:03:44 -0000      1.12
@@ -29,11 +29,11 @@
  * error messages to the end user.
  *
  * @author Michael Jennings <[EMAIL PROTECTED]>
- * $Revision: 1.11 $
- * $Date: 2004/07/23 21:38:39 $
+ * $Revision: 1.12 $
+ * $Date: 2006/07/13 23:03:44 $
  */
 
-static const char __attribute__((unused)) cvs_ident[] = "$Id: msgs.c,v 1.11 
2004/07/23 21:38:39 mej Exp $";
+static const char __attribute__((unused)) cvs_ident[] = "$Id: msgs.c,v 1.12 
2006/07/13 23:03:44 mej Exp $";
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -61,6 +61,14 @@
 spif_charptr_t libast_program_version = SPIF_CAST(charptr) VERSION;
 
 /**
+ * Silence mode
+ *
+ * This variable determines whether or not error, warning, and
+ * debugging messages may be printed.
+ */
+static spif_bool_t silent = FALSE;
+
+/**
  * Sets the program name.
  *
  * This function is provided for safe and sane setting of the
@@ -119,6 +127,22 @@
 }
 
 /**
+ * Sets silent mode.
+ *
+ * This function turns on/off error, warning, and debugging output.
+ *
+ * @param flag Boolean value to set silent flag
+ * @return     The new value
+ *
+ * @see silent
+ */
+spif_bool_t
+libast_set_silent(spif_bool_t flag)
+{
+    return (silent = flag);
+}
+
+/**
  * Prints debugging output.
  *
  * This function is the guts behing the D_*() and DPRINTF() families of
@@ -140,6 +164,7 @@
     int n;
 
     ASSERT_RVAL(!SPIF_PTR_ISNULL(format), SPIF_CAST_C(int) -1);
+    REQUIRE_RVAL(!silent, 0);
     REQUIRE_RVAL(libast_program_name != NULL, 0);
     va_start(args, format);
     n = vfprintf(LIBAST_DEBUG_FD, format, args);
@@ -168,6 +193,7 @@
     va_list arg_ptr;
 
     ASSERT(!SPIF_PTR_ISNULL(fmt));
+    REQUIRE(!silent);
     REQUIRE(libast_program_name != NULL);
     va_start(arg_ptr, fmt);
     fprintf(stderr, "%s:  Error:  ", libast_program_name);
@@ -195,6 +221,7 @@
     va_list arg_ptr;
 
     ASSERT(!SPIF_PTR_ISNULL(fmt));
+    REQUIRE(!silent);
     REQUIRE(libast_program_name != NULL);
     va_start(arg_ptr, fmt);
     fprintf(stderr, "%s:  Warning:  ", libast_program_name);
@@ -222,7 +249,7 @@
     va_list arg_ptr;
 
     ASSERT(!SPIF_PTR_ISNULL(fmt));
-    if (libast_program_name != NULL) {
+    if ((!silent) && (libast_program_name != NULL)) {
         va_start(arg_ptr, fmt);
         fprintf(stderr, "%s:  FATAL:  ", libast_program_name);
         vfprintf(stderr, fmt, arg_ptr);
@@ -230,3 +257,4 @@
     }
     exit(-1);
 }
+




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to