diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-05-18 14:38:41 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-05-18 14:38:41 -0400 |
| commit | a1d18fd4225f67275ea4173532969e4ddf55b39f (patch) | |
| tree | 6473f7cee0e829783bd64cc3d52af53f5089340f /builtins/functions.c | |
| parent | ee9a40f9102f12357e7a46c3b48a486c62c2311e (diff) | |
Add C string type
Diffstat (limited to 'builtins/functions.c')
| -rw-r--r-- | builtins/functions.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/builtins/functions.c b/builtins/functions.c index f668b253..eedcc9fb 100644 --- a/builtins/functions.c +++ b/builtins/functions.c @@ -240,4 +240,24 @@ public bool pop_flag(char **argv, int *i, const char *flag, CORD *result) } } +public void *xfopen(CORD path, CORD flags) +{ + return fopen(CORD_to_const_char_star(path), CORD_to_const_char_star(flags)); +} + +public CORD xfread_all(void *fp) +{ + return CORD_from_file_eager(fp); +} + +public void xfputs(CORD text, void *fp) +{ + CORD_put(text, fp); +} + +public void xfclose(void *fp) +{ + fclose(fp); +} + // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
