cpc

Cryptocurrency price checker
git clone git://git.wimdupont.com/cpc.git
Log | Files | Refs | README | LICENSE

commit 18f23c8074bdfe3f218776db29669d0a1d599517
parent 2c51639edc91b4c50ef6d62e9372785916b0b8b4
Author: Wim Dupont <wim@wimdupont.com>
Date:   Sat, 14 Jun 2025 21:48:54 +0200

updated flags

Diffstat:
MMakefile | 8+-------
Aconfig.mk | 11+++++++++++
Mcpc.c | 5++---
3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,10 +1,4 @@ -CC = gcc - -NAME = cpc -VERSION = 0.1 - -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man +include config.mk BIN = cpc SRC = cpc.c diff --git a/config.mk b/config.mk @@ -0,0 +1,11 @@ +NAME = cpc + +VERSION = 0.1 + +CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" +CFLAGS = -std=c99 -pedantic -Wall -Wextra -I/usr/local/include ${CPPFLAGS} + +PREFIX = /usr/local +MANPREFIX = ${PREFIX}/share/man + +CC = gcc diff --git a/cpc.c b/cpc.c @@ -23,7 +23,7 @@ static void wfile(cJSON *array); static void parse_json_object(const char *json_string); static char * replace_home(char *buf, const char *path); static void do_action(Action action, const double value); -static void call_api(); +static void call_api(void); static char * cpstr(char *dest, const char *src); static void fatal(const char *fmt, ...); @@ -140,7 +140,6 @@ do_action(Action action, const double value) { char name[50], *line_buf = NULL; size_t line_buf_size = 0; - ssize_t line_size; double price; FILE *fp; ; @@ -167,7 +166,7 @@ do_action(Action action, const double value) } void -call_api() +call_api(void) { char libversion[20], request[strlen(URL) + strlen(FIAT) + strlen(CURRENCIES) + 1]; struct curl_slist *headers = NULL;