void set_resource_path(const char* path) { nulltest(path); if(resource_path != NULL) free(resource_path); resource_path = strdup(path); }
bool init_input(GLFWwindow* win) { nulltest(win); glfwSetKeyCallback(win, keyCodeCallback); return true; }
int main() { //int* ptr; //ptr = 0; //if(*((int*)0) == 0 || 1) printf(1,"pointer dereferenced\n"); //int i = *ptr; //i++; nulltest(); exit(); }
void set_resource_path_relative(const char* path) { nulltest(path); if(resource_path != NULL) free(resource_path); resource_path = calloc(512 + strlen(path), sizeof(char)); get_exe_path(resource_path, 512); strcat(resource_path, "/"); strcat(resource_path, path); }
char* construct_extended_resource_path(resource_pair) { nulltest(resource_name); size_t len = strlen(get_base_resource_path()) + strlen(resource_name) + 2; char* path = NULL; if(resource_location != NULL) { len += strlen(resource_location) + 1; path = calloc(len, sizeof(char)); strcat(path, resource_path); strcat(path, "/"); strcat(path, resource_location); strcat(path, "/"); strcat(path, resource_name); } else { path = calloc(len, sizeof(char)); strcat(path, resource_path); strcat(path, "/"); strcat(path, resource_name); } return path; }