ReactOS  0.4.12-dev-57-g7050ac4
alloc.c File Reference
#include <rosdhcp.h>
Include dependency graph for alloc.c:

Go to the source code of this file.

Functions

struct string_listnew_string_list (size_t size)
 
struct hash_tablenew_hash_table (int count)
 
struct hash_bucketnew_hash_bucket (void)
 
void dfree (void *ptr, char *name)
 
void free_hash_bucket (struct hash_bucket *ptr, char *name)
 

Function Documentation

◆ dfree()

void dfree ( void ptr,
char name 
)

Definition at line 79 of file alloc.c.

Referenced by do_host_lookup(), free_hash_bucket(), tree_concat(), and tree_evaluate().

80 {
81  if (!ptr) {
82  warning("dfree %s: free on null pointer.", name);
83  return;
84  }
85  free(ptr);
86 }
#define free
Definition: debug_ros.c:5
Definition: name.c:36
#define warning(s)
Definition: debug.h:71

◆ free_hash_bucket()

void free_hash_bucket ( struct hash_bucket ptr,
char name 
)

Definition at line 89 of file alloc.c.

Referenced by delete_hash_entry().

90 {
91  dfree(ptr, name);
92 }
void dfree(void *ptr, char *name)
Definition: alloc.c:79
Definition: name.c:36

◆ new_hash_bucket()

struct hash_bucket* new_hash_bucket ( void  )

Definition at line 71 of file alloc.c.

Referenced by add_hash().

72 {
73  struct hash_bucket *rval = calloc(1, sizeof(struct hash_bucket));
74 
75  return (rval);
76 }
float rval
Definition: cylfrac.c:48
#define calloc
Definition: rosglue.h:14

◆ new_hash_table()

struct hash_table* new_hash_table ( int  count)

Definition at line 57 of file alloc.c.

Referenced by new_hash().

58 {
59  struct hash_table *rval;
60 
61  rval = calloc(1, sizeof(struct hash_table) -
62  (DEFAULT_HASH_SIZE * sizeof(struct hash_bucket *)) +
63  (count * sizeof(struct hash_bucket *)));
64  if (rval == NULL)
65  return (NULL);
66  rval->hash_count = count;
67  return (rval);
68 }
int hash_count
Definition: dhcpd.h:269
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define DEFAULT_HASH_SIZE
Definition: dhcpd.h:259
smooth NULL
Definition: ftsmooth.c:416
float rval
Definition: cylfrac.c:48
#define calloc
Definition: rosglue.h:14

◆ new_string_list()

struct string_list* new_string_list ( size_t  size)

Definition at line 46 of file alloc.c.

47 {
48  struct string_list *rval;
49 
50  rval = calloc(1, sizeof(struct string_list) + size);
51  if (rval != NULL)
52  rval->string = ((char *)rval) + sizeof(struct string_list);
53  return (rval);
54 }
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
float rval
Definition: cylfrac.c:48
#define calloc
Definition: rosglue.h:14
char * string
Definition: dhcpd.h:122