format.c
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:1k
- /*-------------------------------------------------------------------------
- *
- * format.c
- * a wrapper around code that does what vsprintf does.
- *
- * Copyright (c) 1994, Regents of the University of California
- *
- *
- * IDENTIFICATION
- * $Header: /usr/local/cvsroot/pgsql/src/backend/utils/error/format.c,v 1.13.2.1 1999/08/02 05:25:05 scrappy Exp $
- *
- *-------------------------------------------------------------------------
- */
- #include "postgres.h"
- #define FormMaxSize 1024
- #define FormMinSize (FormMaxSize / 8)
- static char FormBuf[FormMaxSize];
- /* ----------------
- * vararg_format
- * ----------------
- */
- char *
- vararg_format(const char *fmt,...)
- {
- va_list args;
- va_start(args, fmt);
- vsnprintf(FormBuf, FormMaxSize - 1, fmt, args);
- va_end(args);
- return FormBuf;
- }