VPR-7.0
|
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include "util.h"
Go to the source code of this file.
Macros | |
#define | CHUNK_SIZE 32768 |
#define | FRAGMENT_THRESHOLD 100 |
#define | IA 1103515245u |
#define | IC 12345u |
#define | IM 2147483648u |
#define | CHECK_RAND |
Functions | |
int | limit_value (int cur, int max, const char *name) |
char * | my_strncpy (char *dest, const char *src, size_t size) |
FILE * | my_fopen (const char *fname, const char *flag, int prompt) |
char * | my_strdup (const char *str) |
int | my_atoi (const char *str) |
void * | my_calloc (size_t nelem, size_t size) |
void * | my_malloc (size_t size) |
void * | my_realloc (void *ptr, size_t size) |
void * | my_chunk_malloc (size_t size, t_chunk *chunk_info) |
void | free_chunk_memory (t_chunk *chunk_info) |
struct s_linked_vptr * | insert_in_vptr_list (struct s_linked_vptr *head, void *vptr_to_add) |
struct s_linked_vptr * | delete_in_vptr_list (struct s_linked_vptr *head) |
t_linked_int * | insert_in_int_list (t_linked_int *head, int data, t_linked_int **free_list_head_ptr) |
void | free_int_list (t_linked_int **int_list_head_ptr) |
void | alloc_ivector_and_copy_int_list (t_linked_int **list_head_ptr, int num_items, struct s_ivec *ivec, t_linked_int **free_list_head_ptr) |
char * | my_fgets (char *buf, int max_size, FILE *fp) |
char * | my_strtok (char *ptr, const char *tokens, FILE *fp, char *buf) |
void | free_ivec_vector (struct s_ivec *ivec_vector, int nrmin, int nrmax) |
void | free_ivec_matrix (struct s_ivec **ivec_matrix, int nrmin, int nrmax, int ncmin, int ncmax) |
void | free_ivec_matrix3 (struct s_ivec ***ivec_matrix3, int nrmin, int nrmax, int ncmin, int ncmax, int ndmin, int ndmax) |
void ** | alloc_matrix (int nrmin, int nrmax, int ncmin, int ncmax, size_t elsize) |
void | free_matrix (void *vptr, int nrmin, int nrmax, int ncmin, size_t elsize) |
void *** | alloc_matrix3 (int nrmin, int nrmax, int ncmin, int ncmax, int ndmin, int ndmax, size_t elsize) |
void **** | alloc_matrix4 (int nrmin, int nrmax, int ncmin, int ncmax, int ndmin, int ndmax, int nemin, int nemax, size_t elsize) |
void | print_int_matrix3 (int ***vptr, int nrmin, int nrmax, int ncmin, int ncmax, int ndmin, int ndmax, char *file) |
void | free_matrix3 (void *vptr, int nrmin, int nrmax, int ncmin, int ncmax, int ndmin, size_t elsize) |
void | free_matrix4 (void *vptr, int nrmin, int nrmax, int ncmin, int ncmax, int ndmin, int ndmax, int nemin, size_t elsize) |
void | my_srandom (int seed) |
int | my_irand (int imax) |
float | my_frand (void) |
boolean | file_exists (const char *filename) |
int | ipow (int base, int exp) |
Variables | |
int | file_line_number |
char * | out_file_prefix = NULL |
messagelogger | vpr_printf = PrintHandlerMessage |
static int | cont |
static unsigned int | current_random = 0 |
#define CHUNK_SIZE 32768 |
#define FRAGMENT_THRESHOLD 100 |
void alloc_ivector_and_copy_int_list | ( | t_linked_int ** | list_head_ptr, |
int | num_items, | ||
struct s_ivec * | ivec, | ||
t_linked_int ** | free_list_head_ptr | ||
) |
void** alloc_matrix | ( | int | nrmin, |
int | nrmax, | ||
int | ncmin, | ||
int | ncmax, | ||
size_t | elsize | ||
) |
void*** alloc_matrix3 | ( | int | nrmin, |
int | nrmax, | ||
int | ncmin, | ||
int | ncmax, | ||
int | ndmin, | ||
int | ndmax, | ||
size_t | elsize | ||
) |
void**** alloc_matrix4 | ( | int | nrmin, |
int | nrmax, | ||
int | ncmin, | ||
int | ncmax, | ||
int | ndmin, | ||
int | ndmax, | ||
int | nemin, | ||
int | nemax, | ||
size_t | elsize | ||
) |
struct s_linked_vptr* delete_in_vptr_list | ( | struct s_linked_vptr * | head | ) |
boolean file_exists | ( | const char * | filename | ) |
void free_chunk_memory | ( | t_chunk * | chunk_info | ) |
void free_int_list | ( | t_linked_int ** | int_list_head_ptr | ) |
void free_ivec_matrix | ( | struct s_ivec ** | ivec_matrix, |
int | nrmin, | ||
int | nrmax, | ||
int | ncmin, | ||
int | ncmax | ||
) |
Definition at line 511 of file util.c.
void free_ivec_matrix3 | ( | struct s_ivec *** | ivec_matrix3, |
int | nrmin, | ||
int | nrmax, | ||
int | ncmin, | ||
int | ncmax, | ||
int | ndmin, | ||
int | ndmax | ||
) |
Definition at line 529 of file util.c.
void free_ivec_vector | ( | struct s_ivec * | ivec_vector, |
int | nrmin, | ||
int | nrmax | ||
) |
void free_matrix | ( | void * | vptr, |
int | nrmin, | ||
int | nrmax, | ||
int | ncmin, | ||
size_t | elsize | ||
) |
void free_matrix3 | ( | void * | vptr, |
int | nrmin, | ||
int | nrmax, | ||
int | ncmin, | ||
int | ncmax, | ||
int | ndmin, | ||
size_t | elsize | ||
) |
void free_matrix4 | ( | void * | vptr, |
int | nrmin, | ||
int | nrmax, | ||
int | ncmin, | ||
int | ncmax, | ||
int | ndmin, | ||
int | ndmax, | ||
int | nemin, | ||
size_t | elsize | ||
) |
t_linked_int* insert_in_int_list | ( | t_linked_int * | head, |
int | data, | ||
t_linked_int ** | free_list_head_ptr | ||
) |
struct s_linked_vptr* insert_in_vptr_list | ( | struct s_linked_vptr * | head, |
void * | vptr_to_add | ||
) |
int ipow | ( | int | base, |
int | exp | ||
) |
int my_atoi | ( | const char * | str | ) |
void* my_chunk_malloc | ( | size_t | size, |
t_chunk * | chunk_info | ||
) |
Definition at line 184 of file util.c.
char* my_fgets | ( | char * | buf, |
int | max_size, | ||
FILE * | fp | ||
) |
FILE* my_fopen | ( | const char * | fname, |
const char * | flag, | ||
int | prompt | ||
) |
float my_frand | ( | void | ) |
int my_irand | ( | int | imax | ) |
void* my_malloc | ( | size_t | size | ) |
void my_srandom | ( | int | seed | ) |
char* my_strdup | ( | const char * | str | ) |
char* my_strncpy | ( | char * | dest, |
const char * | src, | ||
size_t | size | ||
) |
char* my_strtok | ( | char * | ptr, |
const char * | tokens, | ||
FILE * | fp, | ||
char * | buf | ||
) |
void print_int_matrix3 | ( | int *** | vptr, |
int | nrmin, | ||
int | nrmax, | ||
int | ncmin, | ||
int | ncmax, | ||
int | ndmin, | ||
int | ndmax, | ||
char * | file | ||
) |
messagelogger vpr_printf = PrintHandlerMessage |