(54 lines)
1 //2 // utils.c3 // Copyright 2021 Bruce Hill4 // Released under the MIT license with the Commons Clause5 //6 // This file contains implementations of some convenience functions for more7 // easily error checking.8 //14 //15 // If the given argument is nonnegative, print the error message and exit with16 // failure. Otherwise, return the given argument.17 //20 va_list args;24 }26 }28 //29 // If the given argument is NULL, print the error message and exit with30 // failure. Otherwise return the given argument.31 //34 va_list args;38 }40 }42 //43 // For a given pointer to a memory-allocated pointer, free its memory and set44 // the pointer to NULL. (This is a safer alternative to free() that45 // automatically NULLs out the pointer so it can't be used after freeing)46 //51 }52 }54 // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0