shopping-list

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a43dcc5b47947bb274bd4ef31dd2c41a8b97a42b
parent 63d8a0b5408bdc17bf6d738bce2248d0d3b94748
Author: mrgrouse <mrgrouse@mrgrouse.com>
Date:   Thu, 10 Sep 2026 22:54:06 -0400

add prototypes for functions to extend build system

Diffstat:
Mfunctions.c | 27++++++++++++++++++++++-----
Afunctions.h | 6++++++
2 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/functions.c b/functions.c @@ -5,6 +5,24 @@ #include <string.h> const char *getconfigdir(); +void new_list(char *sarg) { + return; +} +void list_items(char *sarg) { + return; +} +void add_item(char *sarg, char *narg) { + return; +} +void del_item(char *fargv) { + return; +} +/* TODO: + * new_list(argv[2]) + * list_items(argv[2]) + * add_item(argv[2], argv[3]) + * del_item(argv[?]) + */ const char *getconfigdir() { static const char confdirname[] = "shoplist"; @@ -13,18 +31,17 @@ const char *getconfigdir() { if (XDG_CONFIG_HOME == NULL) { fprintf(stderr, "XDG_CONFIG_HOME not in env"); return "X"; - } + } /* the size of the final string, * typically "/home/user/.config/shoplist" */ - size_t finalsize = (sizeof(char) * (strlen(XDG_CONFIG_HOME) + strlen(confdirname) + 1)); + size_t finalsize = + (sizeof(char) * (strlen(XDG_CONFIG_HOME) + strlen(confdirname) + 1)); - char *final = (char *)malloc(finalsize); + char *final = malloc(finalsize); sprintf(final, "%s/%s", XDG_CONFIG_HOME, confdirname); return final; - } - diff --git a/functions.h b/functions.h @@ -0,0 +1,6 @@ +/* funciton prototypes so main.c knows wth to do */ +const char *getconfigdir(); +void new_list(char *sarg); +void list_items(char *sarg); +void add_item(char *sarg, char *narg); +void del_item(char *fargv);