0
0
mirror of https://github.com/python/cpython.git synced 2024-11-24 08:52:25 +01:00
cpython/Include/modsupport.h
Guido van Rossum e537240c25 * Changed many files to use mkvalue() instead of newtupleobject().
* Fixcprt.py: added [-y file] option, do only files younger than file.
* modsupport.[ch]: added vmkvalue().
* intobject.c: use mkvalue().
* stringobject.c: added "formatstring"; renamed string* to string_*;
  ceval.c: call formatstring for string % value.
* longobject.c: close memory leak in divmod.
* parsetok.c: set result node to NULL when returning an error.
1993-03-16 12:15:04 +00:00

69 lines
3.0 KiB
C

/***********************************************************
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
Amsterdam, The Netherlands.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose 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 names of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
/* Module support interface */
#ifdef HAVE_PROTOTYPES
#define USE_STDARG
#endif
#ifdef USE_STDARG
#include <stdarg.h>
#else
#include <varargs.h>
#endif
extern object *initmodule PROTO((char *, struct methodlist *));
extern int getargs PROTO((object *, char *, ...));
extern int vgetargs PROTO((object *, char *, va_list));
extern object *mkvalue PROTO((char *, ...));
extern object *vmkvalue PROTO((char *, va_list));
#define getnoarg(v) getargs(v, "")
#define getintarg(v, a) getargs(v, "i", a)
#define getintintarg(v, a, b) getargs(v, "(ii)", a, b)
#define getintintintarg(v, a, b, c) getargs(v, "(iii)", a, b, c)
#define getlongarg(v, a) getargs(v, "l", a)
#define getlonglongarg(v, a, b) getargs(v, "(ll)", a, b)
#define getlonglongobjectarg(v, a, b, c) getargs(v, "(llO)", a, b, c)
#define getStrarg(v, a) getargs(v, "S", a)
#define getstrarg(v, a) getargs(v, "s", a)
#define getstrstrarg(v, a, b) getargs(v, "(ss)", a, b)
#define getStrStrarg(v, a, b) getargs(v, "(SS)", a, b)
#define getstrstrintarg(v, a, b, c) getargs(v, "(ssi)", a, b, c)
#define getStrintarg(v, a, b) getargs(v, "(Si)", a, b)
#define getstrintarg(v, a, b) getargs(v, "(si)", a, b)
#define getintstrarg(v, a, b) getargs(v, "(is)", a, b)
#define getpointarg(v, a) getargs(v, "(ii)", a, (a)+1)
#define get3pointarg(v, a) getargs(v, "((ii)(ii)(ii))", \
a, a+1, a+2, a+3, a+4, a+5)
#define getrectarg(v, a) getargs(v, "((ii)(ii))", a, a+1, a+2, a+3)
#define getrectintarg(v, a) getargs(v, "(((ii)(ii))i)", a, a+1, a+2, a+3, a+4)
#define getpointintarg(v, a) getargs(v, "((ii)i)", a, a+1, a+2)
#define getpointstrarg(v, a, b) getargs(v, "((ii)s)", a, a+1, b)
#define getrectpointarg(v, a) getargs(v, "(((ii)(ii))(ii))", \
a, a+1, a+2, a+3, a+4, a+5)
#define getdoublearg(v, a) getargs(v, "d", a)
#define get2doublearg(v, a, b) getargs(v, "(dd)", a, b)