Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwpl.git;a=commitdiff;h=07253de5b348b288df0bfc6b0f5a6ac17d55818d

commit 07253de5b348b288df0bfc6b0f5a6ac17d55818d
Author: James Buren <r...@frugalware.org>
Date:   Mon Sep 21 02:38:31 2009 -0500

src
* create clean slate

diff --git a/src/src.cbi b/src/src.cbi
deleted file mode 100644
index de9fa0d..0000000
--- a/src/src.cbi
+++ /dev/null
@@ -1,4 +0,0 @@
-#[of]:utility
-#[l]:source:utility.c
-#[l]:header:utility.h
-#[cf]
diff --git a/src/utility.c b/src/utility.c
deleted file mode 100644
index cc57e9d..0000000
--- a/src/utility.c
+++ /dev/null
@@ -1,69 +0,0 @@
-//[of]:includes
-#include <stdlib.h>
-#include <string.h>
-#include <regex.h>
-#include <iso646.h>
-#include <assert.h>
-#include "utility.h"
-//[cf]
-//[of]:macros
-#define REG_MATCH_FLAGS   (REG_EXTENDED|REG_NOSUB)
-#define REG_REPLACE_FLAGS (REG_EXTENDED)
-//[cf]
-
-//[of]:functions
-//[of]:xmalloc
-void *xmalloc(size_t num) {
-  void *ptr;
-
-  assert((num > 0));
-
-  ptr = malloc(num);
-
-  if(!ptr) {
-    abort();
-  }
-
-  return ptr;
-}
-//[cf]
-//[of]:regreplace
-bool regreplace(char **dest,const char *str,const char *pat,const char *sub) {
-  regex_t reg;
-  regmatch_t mat;
-  size_t n1, n2, n3, n4;
-
-  assert((dest != NULL) and (str != NULL) and (pat != NULL) and (sub != NULL));
-
-  if(regcomp(&reg,pat,REG_REPLACE_FLAGS))
-    return false;
-
-  if(regexec(&reg,str,1,&mat,0)) {
-    regfree(&reg);
-    return false;
-  }
-
-  n1 = mat.rm_so;
-
-  n2 = strlen(sub);
-
-  n3 = mat.rm_eo - mat.rm_so;
-
-  n4 = strlen(str) - n3 + n2 + 1;
-
-  (*dest) = new(char,n4);
-
-  n3 += n1;
-
-  strncpy(&(*dest)[0],str,n1);
-
-  strncpy(&(*dest)[n1],sub,n2);
-
-  strcpy(&(*dest)[n1+n2],&str[n3]);
-
-  regfree(&reg);
-
-  return true;
-}
-//[cf]
-//[cf]
diff --git a/src/utility.h b/src/utility.h
deleted file mode 100644
index 515b634..0000000
--- a/src/utility.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _utility_header_
-#define _utility_header_
-//[of]:includes
-#include <stddef.h>
-#include <stdbool.h>
-//[cf]
-//[of]:macros
-#define new(T,N) (T*)xmalloc(sizeof(T)*(N))
-//[cf]
-//[of]:prototypes
-extern void *xmalloc(size_t);
-extern bool regreplace(char **,const char *,const char *,const char *);
-//[cf]
-#endif
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to