Skip to content

Commit e8e0835

Browse files
authored
Add files via upload
1 parent ba154a3 commit e8e0835

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

src/symtab/string_hash.c

+6-8
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
#include <stdlib.h>
2323
#include <stdio.h>
2424
#include <string.h>
25-
#include "../cmd.h"
25+
#include "../include/cmd.h"
2626
#include "string_hash.h"
27-
#include "../debug.h"
27+
#include "../include/debug.h"
2828

2929
/* defined in ../strbuf.c */
3030
char *__get_malloced_str(char *str);
@@ -99,8 +99,7 @@ struct hashtab_s *new_hashtable_sz(int size)
9999
struct hashtab_s *table = malloc(sizeof(struct hashtab_s));
100100
if(!table)
101101
{
102-
PRINT_ERROR("%s: insufficient memory for creating hash table\n",
103-
SOURCE_NAME);
102+
INSUFFICIENT_MEMORY_ERROR(SHELL_NAME, "creating hash table");
104103
return NULL;
105104
}
106105
table->size = size; /* use the given size */
@@ -110,8 +109,7 @@ struct hashtab_s *new_hashtable_sz(int size)
110109
if(!table->items)
111110
{
112111
free(table);
113-
PRINT_ERROR("%s: insufficient memory for creating hash table\n",
114-
SOURCE_NAME);
112+
INSUFFICIENT_MEMORY_ERROR(SHELL_NAME, "creating hash table");
115113
return NULL;
116114
}
117115
memset(table->items, 0, itemsz); /* init buckets list */
@@ -283,7 +281,7 @@ struct hashitem_s *add_hash_item(struct hashtab_s *table, char *key, char *value
283281
entry = malloc(sizeof(struct hashitem_s));
284282
if(!entry)
285283
{
286-
PRINT_ERROR("%s: failed to malloc hashtable item\n", SOURCE_NAME);
284+
PRINT_ERROR(SHELL_NAME, "failed to malloc hashtable item");
287285
return NULL;
288286
}
289287
/* initialize it */
@@ -332,7 +330,7 @@ struct hashitem_s *add_hash_itemb(struct hashtab_s *table, char *key, long value
332330
entry = malloc(sizeof(struct hashitem_s));
333331
if(!entry)
334332
{
335-
PRINT_ERROR("%s: failed to malloc hashtable item\n", SOURCE_NAME);
333+
PRINT_ERROR(SHELL_NAME, "failed to malloc hashtable item");
336334
return NULL;
337335
}
338336
/* initialize it */

src/symtab/symtab.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
#include <stdlib.h>
2323
#include <stdio.h>
2424
#include <string.h>
25-
#include "../cmd.h"
25+
#include "../include/cmd.h"
2626
#include "../parser/node.h"
2727
#include "../parser/parser.h"
2828
#include "../builtins/setx.h"
29-
#include "../debug.h"
29+
#include "../include/debug.h"
3030
#include "symtab.h"
3131

3232
struct symtab_stack_s symtab_stack; /* the symbol tables stack */

src/symtab/symtab_hash.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
#include <stdlib.h>
2323
#include <stdio.h>
2424
#include <string.h>
25-
#include "../cmd.h"
25+
#include "../include/cmd.h"
2626
#include "../parser/node.h"
2727
#include "../parser/parser.h"
2828
#include "../builtins/setx.h"
29-
#include "../debug.h"
29+
#include "../include/debug.h"
3030
#include "symtab.h"
3131

3232
struct symtab_stack_s symtab_stack; /* the symbol tables stack */

0 commit comments

Comments
 (0)