aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-05-15 18:03:30 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2023-05-15 18:03:30 +0200
commit449c547e78c9b79ffc1e0c180940b6f117e435a7 (patch)
tree92bcc70fb54e99e48b352556f2ae23cdf42b39ca
parent650d928cc6164fbf10dc3a32e416737654cd1c2e (diff)
downloadsdep-449c547e78c9b79ffc1e0c180940b6f117e435a7.tar.gz
sdep-449c547e78c9b79ffc1e0c180940b6f117e435a7.zip
Removed calls to ctype.h
Diffstat (limited to '')
-rw-r--r--sdep.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sdep.c b/sdep.c
index 8516678..eae0b3d 100644
--- a/sdep.c
+++ b/sdep.c
@@ -1,6 +1,5 @@
1/* See LICENSE file for copyright and license details. */ 1/* See LICENSE file for copyright and license details. */
2 2
3#include <ctype.h>
4#include <stdio.h> 3#include <stdio.h>
5#include <stdlib.h> 4#include <stdlib.h>
6#include <string.h> 5#include <string.h>
@@ -54,6 +53,7 @@ static int compare_event(const void *, const void *);
54static Options default_op(void); 53static Options default_op(void);
55static int events_in_range(EventList *, Options, Event *); 54static int events_in_range(EventList *, Options, Event *);
56static char *format_line(Event, Options, char *); 55static char *format_line(Event, Options, char *);
56static int is_space(char);
57static void read_input(Options, EventList *); 57static void read_input(Options, EventList *);
58static Options read_op(int, char *[]); 58static Options read_op(int, char *[]);
59static char *strtrim(char *); 59static char *strtrim(char *);
@@ -156,6 +156,12 @@ format_line(Event ev, Options op, char *out)
156 return out; 156 return out;
157} 157}
158 158
159static int
160is_space(char c)
161{
162 return c == ' ' || c == '\t';
163}
164
159static void 165static void
160read_input(Options op, EventList *evlist) 166read_input(Options op, EventList *evlist)
161{ 167{
@@ -221,8 +227,8 @@ strtrim(char *t)
221{ 227{
222 char *s; 228 char *s;
223 229
224 for (s = &t[strlen(t)-1]; s != t && isspace(*s); *s = '\0', s--); 230 for (s = &t[strlen(t)-1]; s != t && is_space(*s); *s = '\0', s--);
225 for (; *t != '\0' && isspace(*t); t++); 231 for (; *t != '\0' && is_space(*t); t++);
226 232
227 return t; 233 return t;
228} 234}

Generated with cgit - Back to sebastiano.tronto.net