Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=fwpl.git;a=commitdiff;h=fcd39e0e3a944dc82d6994a123fe4baaa4f21097
commit fcd39e0e3a944dc82d6994a123fe4baaa4f21097 Author: James Buren <r...@frugalware.org> Date: Sun Oct 18 18:23:26 2009 -0500 utility.c * initial draft diff --git a/src/c/utility.c b/src/c/utility.c new file mode 100644 index 0000000..44e6283 --- /dev/null +++ b/src/c/utility.c @@ -0,0 +1,21 @@ +//[of]:includes +#include <stdlib.h> +#include <stdio.h> +#include <assert.h> +#include <iso646.h> +#include "utility.h" +//[cf] +//[of]:functions +//[of]:_alloc +void _alloc(void **ptr,size_t size) { + assert((ptr != NULL) and (size > 0)); + + (*ptr) = malloc(size); + + if((*ptr) == NULL) { + fprintf(stderr,"Failed to allocate %u bytes of memory.\n",size); + abort(); + } +} +//[cf] +//[cf] _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git