Rename global.h to util.h

The functionality has changed since we no longer need a place for global
variables.
This commit is contained in:
Nicolás A. Ortega Froysa 2024-09-17 17:53:08 +02:00
parent 5058070fcb
commit 6ce5417c70
4 changed files with 4 additions and 6 deletions

View File

@ -20,7 +20,7 @@ INCFLAGS=
LDFLAGS=-lsqlite3 LDFLAGS=-lsqlite3
DEFS= DEFS=
CFLAGS=$(INCFLAGS) -std=c99 -Wall -Wextra -Wfatal-errors -Werror CFLAGS=$(INCFLAGS) -std=c99 -Wall -Wextra -Wfatal-errors -Werror
HDRS=src/arg_parse.h HDRS=src/arg_parse.h src/util.h
OBJS=src/main.o src/arg_parse.o OBJS=src/main.o src/arg_parse.o
VERSION=1.0 VERSION=1.0

View File

@ -17,6 +17,9 @@
*/ */
#include "arg_parse.h" #include "arg_parse.h"
#include "util.h"
#include <string.h>
enum cmd_id parse_args(const char *cmd) { enum cmd_id parse_args(const char *cmd) {
for(int i = 0; i < (int)ARRAY_LEN(commands); ++i) { for(int i = 0; i < (int)ARRAY_LEN(commands); ++i) {
for(int j = 0; j < (int)ARRAY_LEN(commands[i].str); ++j) { for(int j = 0; j < (int)ARRAY_LEN(commands[i].str); ++j) {

View File

@ -17,11 +17,6 @@
*/ */
#pragma once #pragma once
#include <string.h>
#include <stdio.h>
#include "global.h"
enum cmd_id { enum cmd_id {
CMD_UNKNOWN = 0, CMD_UNKNOWN = 0,
CMD_HELP, CMD_HELP,