ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/ihost-perl/plugins/libukcprog/strf.c
Revision: 1.2
Committed: Fri Mar 28 16:30:32 2003 UTC (21 years, 7 months ago) by tdb
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
State: FILE REMOVED
Log Message:
Removed some un-used code from CVS. We can always resurrect this later if
someone feels they want to work on it. Gone are the old perl ihost which
isn't needed now, winhost which is broken and shows no sign of being fixed,
and DBReporter. If someone wants to revive them, I'll undelete them :-)

File Contents

# Content
1 /* strf.c -- formatted strings, storage allocated from malloc */
2
3 /* Copyright 1992 Godfrey Paul, University of Kent at Canterbury.
4 *
5 * You can do what you like with this source code as long as
6 * you don't try to make money out of it and you include an
7 * unaltered copy of this message (including the copyright).
8 */
9
10 char ukcprog_strf_sccsid[] = "$Id: strf.c,v 1.1 2002/03/08 14:37:29 tdb Exp $ UKC";
11
12 #ifdef __STDC__
13 #include <stdarg.h>
14 #else
15 #include <varargs.h>
16 #endif
17
18 #include <stdio.h>
19 #include <stdlib.h>
20
21 #include "ukcprog.h"
22
23
24 #ifdef __STDC__
25 char *
26 strf(const char *fmt, ...)
27 {
28
29 #else /* !__STDC__ */
30 char *
31 strf(va_alist)
32 va_dcl
33 {
34 char *fmt;
35 #endif /* !__STDC__ */
36 va_list args;
37 char buffer[100];
38 char *s;
39
40 #ifdef __STDC__
41 va_start(args, fmt);
42 #else
43 va_start(args);
44 fmt = va_arg(args, char *);
45 #endif
46
47 s = formf(buffer, sizeof(buffer), fmt, args);
48
49 va_end(args);
50
51 if (s == buffer) /* not obtained from malloc */
52 s = strsave(s);
53
54 return s;
55 }