Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: e32def.h

VA_ARG

VA_ARG (ap, type) ((ap)[0]+=((sizeof(type)+sizeof(TInt)-1)&~(sizeof(TInt)-1)),(*(type *)((ap)[0]-((sizeof(type)+sizeof(TInt)-1)&~(sizeof(TInt)-1)))))

Description

A macro used by Symbian OS code for handling a variable argument list in a function call.

Increments a pointer to a variable argument list to point to the next argument in the list. The current argument is assumed to be of a type defined by the second parameter to this macro.

Typical usage:

Foo(CAbcdef aAbcdef,...)
   {
   VA_LIST list;
   VA_START(list, aAbcdef);
   ...
   TInt x = VA_ARG(list,TInt);
   ...
   const TDesC *pS=VA_ARG(aList,const TDesC*);
   ... 
   etc
   } 

Parameters

ap

A pointer used to hold the address of an argument in the variable argument list. It is assumed to point to the current argument in the variable argument list. After execution of the code generated by this macro, the pointer points to the next argument in the list. This symbol is usually declared as a VA_LIST type.

type

The type of the current argument. This can be any valid type, for example, TInt, const TDesC*, etc.

See also: