cftime

Guy Harris guy at auspex.auspex.com
Fri Feb 2 06:35:24 AEST 1990


>I've written a replacement for "cftime()"
>which runs on SystemVr2 and BSD (& presumably
>others), but I need to know the type and
>meaning of the return value of the function
>before releasing the code.

"cftime()" is, I presume, the non-standard date formatting routine in
S5R3.1; an implementation of "strftime()", which is 1) standard, since
it's in ANSI C, and 2) preferable, since you can tell it how long the
buffer into which it's formatting is and keep it from going past the
end, would be preferable.  You can fairly easily implement "cftime()"
atop "strftime()".

(If it's *not* that, you need to indicate what it *is*.)

If, however, you really *do* want to implement "cftime()", then
according to the S5R3.1 CTIME(3C) (BTW, if you don't have that handy - I
presume you don't, since the manual gives its return value - you might
want to think about getting it, so you know which formatting codes it
supports), its returned value is an "int" that is the length of the
string it generated. 

>I also need to know if the global variable "error" is set
>for invalid format strings.

The S5R3.1 implementation sets neither the global variable "error" nor
the standard UNIX error global variable "errno". 



More information about the Comp.unix.wizards mailing list