head     1.3;
branch   ;
access   ;
symbols  C_Demo_1:1.2;
locks    cimarron:1.3; strict;
comment  @ * @;


1.3
date     90.09.25.16.34.19;  author kemnitz;  state Exp;
branches ;
next     1.2;

1.2
date     89.09.05.17.15.51;  author mao;  state C_Demo_1;
branches ;
next     1.1;

1.1
date     89.01.17.05.55.16;  author cimarron;  state Stab;
branches ;
next     ;


desc
@@


1.3
log
@Updating from revision 1.2 to revision 1.5
@
text
@/*LINTLIBRARY*/

#ifndef lint
#ifdef	SCCS
static char sccsid[] = "%W% (serge) %G%";
#endif	/* defined(SCCS) */
#ifdef	RCS
static char rcsid[] = "$Header: RCS/format.c,v 1.5 90/08/22 12:44:11 choi Exp $";
#endif	/* defined(RCS) */
#endif	/* !defined(lint) */

#include <varargs.h>
#include <stdio.h>

#ifdef	_SBFSIZ
typedef unsigned char iochar;
#else
typedef char iochar;
#endif

#ifndef _IOSTRG
#define _IOSTRG	0
#endif

#ifndef	_NFILE
#define _NFILE (-1)
#endif

#define FormMaxSize	1024
#define FormMinSize	(FormMaxSize / 8)

static	char	FormBuf[FormMaxSize];
static	char	*FormBufP = FormBuf;

/*VARARGS1*/
char *
#ifdef	lint
form(fmt, va_alist)
	char	*fmt;
#else
form(va_alist)
#endif
	va_dcl
{
	va_list	args;
	char	*format;
	char	*str;
	FILE	fake;

#if !sprite
#ifdef	lint
	fmt = fmt;
#endif  /* lint */

	if (FormBufP + FormMinSize > FormBuf + FormMaxSize)
		FormBufP = FormBuf;

	fake._cnt  = ((FormBuf + FormMaxSize) - FormBufP) - 1;
	fake._base = fake._ptr = (iochar *)FormBufP;
	fake._flag = _IOWRT | _IOSTRG;
	fake._file = _NFILE;
#endif /* sprite */
	va_start(args);

	format = va_arg(args, char *);
#if !sprite
	_doprnt(format, args, &fake);

	va_end(args);

#ifndef	lint
	(void) putc('\0', &fake);
#endif  /* lint */

	str = FormBufP;

	FormBufP += strlen(FormBufP) + 1;
#else   /* sprite */
        str = vsprintf(FormBuf, format, args);
        va_end(args);
#endif  /* sprite */
	return (str);
}
@


1.2
log
@Working version of C-only demo
@
text
@a0 27

/*
 * 
 * POSTGRES Data Base Management System
 * 
 * Copyright (c) 1988 Regents of the University of California
 * 
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for educational, research, and non-profit purposes and
 * without fee is hereby granted, provided that the above copyright
 * notice appear in all copies and that both that copyright notice and
 * this permission notice appear in supporting documentation, and that
 * the name of the University of California not be used in advertising
 * or publicity pertaining to distribution of the software without
 * specific, written prior permission.  Permission to incorporate this
 * software into commercial products can be obtained from the Campus
 * Software Office, 295 Evans Hall, University of California, Berkeley,
 * Ca., 94720 provided only that the the requestor give the University
 * of California a free licence to any derived software for educational
 * and research purposes.  The University of California makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 * 
 */



d8 1
a8 1
static char rcsid[] = "$Header: RCS/format.c,v 1.1 89/01/17 05:55:16 cimarron Stab $";
d50 1
d53 1
a53 1
#endif
d62 1
a62 1

d66 1
a66 1

d73 1
a73 1
#endif
d78 4
a81 1

@


1.1
log
@Initial revision
@
text
@d35 1
a35 1
static char rcsid[] = "$Header: format.c,v 1.1 88/11/11 16:37:49 postgres Exp $";
@
