/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/************************************************************
* File name: stdarg.h
************************************************************/
#ifndef _STDARG_H_
#define _STDARG_H_

/* used as 2nd arg of va_start() for func(...) */
#define VA_NOARG 

typedef void *va_list;
#define va_start(list, name) list = __va_start()
#define va_count(list) __va_count(list)
#define va_copy(des,src) des=src
#define va_arg(list, mode) ((mode *)__va_arg((mode *)&list))[0]
/* va_isarray() is obsolete */
#define va_isarray(list) __va_array(list, -3) 
#define va_arraytype(list) __va_array(list, -3) 
#define va_dim(list) __va_array(list, -2)
#define va_elementtype(list) __va_array(list, -1)
/* int a[n][m]; index 0 for n, index 1 for m */ 
#define va_extent(list, index) __va_array(list, index)
extern void va_end(va_list);
#define va_end(list) 

/* returned Ch array type for va_arraytype() */
enum {
    CH_UNDEFINETYPE,/* int i */
    CH_CARRAYTYPE=80,  /* int a[3] */
    CH_CARRAYPTRTYPE,  /* int (*ap)[3]; */
    CH_CARRAYVLATYPE,  /* int a[n]; int func(int a[n], int b[:], int c[&]) */
    CH_CHARRAYTYPE,    /* array int a[3] */
    CH_CHARRAYPTRTYPE, /* array int (*ap)[3] */
    CH_CHARRAYVLATYPE, /* array int a[n]; int fun(array int a[n], array int b[:], array int c[&]) */
};

#endif  /* _STDARG_H_ */  
