From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- sys/libc/cfnextn.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sys/libc/cfnextn.c (limited to 'sys/libc/cfnextn.c') diff --git a/sys/libc/cfnextn.c b/sys/libc/cfnextn.c new file mode 100644 index 00000000..9917b89f --- /dev/null +++ b/sys/libc/cfnextn.c @@ -0,0 +1,26 @@ +/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. +*/ + +#define import_spp +#define import_libc +#define import_xnames +#include + + +/* C_FNEXTN -- Extract the filename extension substring from a filename. +*/ +int +c_fnextn ( + char *vfn, /* filename */ + char *extn, /* filename extension (output) */ + int maxch /* max chars out */ +) +{ + XCHAR spp_extn[SZ_FNAME+1]; + XINT x_maxch = SZ_FNAME, nchars; + + nchars = (int) FNEXTN (c_sppstr(vfn), spp_extn, &x_maxch); + c_strpak (spp_extn, extn, maxch); + + return (nchars); +} -- cgit