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

commit 5f656b804ada0fec2db77b639df6395e9e2b24fc
Author: James Buren <r...@frugalware.org>
Date:   Wed Oct 14 14:31:57 2009 -0500

utility.c,h
* deleted

diff --git a/src/utility.c b/src/utility.c
deleted file mode 100644
index ef32e95..0000000
--- a/src/utility.c
+++ /dev/null
@@ -1,108 +0,0 @@
-//[of]:includes
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <iso646.h>
-#include <assert.h>
-#include "utility.h"
-//[cf]
-//[of]:functions
-//[of]:xmalloc
-void *xmalloc(size_t size) {
-  void *ptr;
-
-  assert((size > 0));
-
-  ptr = malloc(size);
-
-  if(!ptr) {
-    eprintf("Failed to allocate memory block of %u bytes.\n",size);
-    abort();
-  }
-
-  return ptr;
-}
-//[cf]
-//[of]:xrealloc
-void *xrealloc(void *ptr,size_t size) {
-  assert((ptr != NULL) and (size > 0));
-
-  ptr = realloc(ptr,size);
-
-  if(!ptr) {
-    eprintf("Failed to reallocate memory block of %u bytes.\n",size);
-    abort();
-  }
-
-  return ptr;
-}
-//[cf]
-//[of]:xstrdup
-char *xstrdup(const char *src) {
-  char *dest;
-  size_t size;
-
-  assert((src != NULL));
-
-  size = maxsize(*src,strlen(src)+1);
-
-  dest = xmalloc(size);
-
-  strcpy(dest,src);
-
-  return dest;
-}
-//[cf]
-//[of]:xstrfmt
-char *xstrfmt(size_t *size,const char *fmt,...) {
-  FILE *buf;
-  char *dest;
-  size_t num;
-  va_list args;
-
-  assert((fmt != NULL));
-
-  buf = open_memstream(&dest,&num);
-
-  if(!buf) {
-    eprintf("Failed to allocate memory for string format buffer.\n");
-    abort();
-  }
-
-  va_start(args,fmt);
-
-  if(vfprintf(buf,fmt,args) < 0) {
-    eprintf("Failed to allocate memory for string format buffer.\n");
-    abort();
-  }
-
-  fflush(buf);
-
-  fclose(buf);
-
-  va_end(args);
-
-  if(size)
-    (*size) = num;
-
-  return dest;
-}
-//[cf]
-//[of]:eprintf
-int eprintf(const char *fmt,...) {
-  va_list args;
-  int rv;
-
-  assert((fmt != NULL));
-
-  va_start(args,fmt);
-
-  rv = vfprintf(stderr,fmt,args);
-
-  va_end(args);
-
-  return rv;
-}
-//[cf]
-//[cf]
diff --git a/src/utility.h b/src/utility.h
deleted file mode 100644
index d773778..0000000
--- a/src/utility.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _utility_header_
-#define _utility_header_
-//[of]:includes
-#include <stddef.h>
-//[cf]
-//[of]:macros
-#define maxsize(T,N) (sizeof((T))*(N))
-//[cf]
-//[of]:prototypes
-extern void *xmalloc(size_t);
-extern void *xrealloc(void *,size_t);
-extern char *xstrdup(const char *);
-extern char *xstrfmt(size_t *,const char *,...);
-extern int eprintf(const char *,...);
-//[cf]
-#endif
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to