From 34feee0ed6879a9c28e8f82fde932eb6b20d79d5 Mon Sep 17 00:00:00 2001 From: Vlad Vissoultchev Date: Wed, 13 Apr 2016 14:32:51 +0300 Subject: Move utility functions `trimfront/back` to tccpp.c These are used in `libtcc.c` now and cannot remain in `tccpe.c` --- tccpp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tccpp.c') diff --git a/tccpp.c b/tccpp.c index 58eb5f6..4164c7e 100644 --- a/tccpp.c +++ b/tccpp.c @@ -3490,3 +3490,18 @@ ST_FUNC int tcc_preprocess(TCCState *s1) return 0; } + +ST_FUNC char *trimfront(char *p) +{ + while (*p && (unsigned char)*p <= ' ') + ++p; + return p; +} + +ST_FUNC char *trimback(char *a, char *e) +{ + while (e > a && (unsigned char)e[-1] <= ' ') + --e; + *e = 0;; + return a; +} -- cgit v1.3.1