Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!mrose@twg.arpa From: mrose@twg.arpa (Marshall Rose) Newsgroups: comp.unix.wizards Subject: (simple?) varargs question Message-ID: <10937@brl-adm.ARPA> Date: 21 Dec 87 17:24:37 GMT Sender: news@brl-adm.ARPA Lines: 40 I am trying to retrofit some code to use and have hit a problem. Perhaps some portability expert out there can help me out. The problem is that I want to be able to do upto several levels of nesting of routines with variable arguments. The hierarchy is like this: pktlose | | | | saplose xsprintf | | | | | | | | +--------------------------------+ | | | | asprintf Each of these routines starts with a fixed number of arguments, followed by a format string and then a variable number of arguments. Ultimately asprintf will call vsprintf or _doprnt to format a string. The trick here is figuring out the declaration and calling sequences of each of these routines since asprintf can be called either 2 or 3 levels deep from the routine which actually made a call with variable arguments. The man page for varargs gives a cryptic reference to nesting, but is essentially undecipherable. Thanks in advance, /mtr