public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: stdarg question
@ 1999-06-04  8:02 Lincoln, W. Terry
  1999-06-30 22:10 ` Lincoln, W. Terry
  0 siblings, 1 reply; 6+ messages in thread
From: Lincoln, W. Terry @ 1999-06-04  8:02 UTC (permalink / raw)
  To: 'dyoung', cygwin

Sir,

Might not this type of question be more appropriately targeted toward a
programming list?
Just my thoughts.

> -----Original Message-----
> From: dyoung [ mailto:dyoung@vviuh221.vvi.com ]
> Sent: Thursday, June 03, 1999 1:49 PM
> To: cygwin
> Subject: stdarg question
> 
> 
> ----------------------------------------------------
> 
> I have a function using the stdarg facility such as:
> 
> myfunc(arg1, arg2, ...)
> 
> and in its body I want to pass the stdarg (vararg) part of 
> the stack such as:
> 
> myfunc(arg1, arg2, ...)
> {
> 
> /* do stuff */
> 
> anotherfunction(argA, ...);
> 
> /* do more stuff */
> 
> return;
> }
> 
> But because there is no parameter name for the vararg 
> argument part (i.e.:  
> ...) I don't see how to pass that to anotherfunction()
> 
> Can passing the vararg part be done? How?
> 
> Thanks A Bunch! David Young; VVI-DCS
> dyoung@vvi.com
> 

Regards,

W. Terry Lincoln - Senior Engineer            \     \   _   /
Ultimate Technology Corporation                \     \ |J| /
a Tridex Company (NASDAQ:trdx)                  \     _|E|_
ICQ# 39362285                                    \   |_ S _|
Email:  < mailto:WTerryLincoln@engineer.com >       \    |U|
1: < http://www.AngelFire.com/ny/TerryLincoln >      \ / |S| \
2: < http://www.geocities.com/Eureka/Concourse/7326 > \  | |
========================================================= ~~~~~
Opinions expressed do not represent the management of UTC.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: stdarg question
  1999-06-04  8:02 stdarg question Lincoln, W. Terry
@ 1999-06-30 22:10 ` Lincoln, W. Terry
  0 siblings, 0 replies; 6+ messages in thread
From: Lincoln, W. Terry @ 1999-06-30 22:10 UTC (permalink / raw)
  To: 'dyoung', cygwin

Sir,

Might not this type of question be more appropriately targeted toward a
programming list?
Just my thoughts.

> -----Original Message-----
> From: dyoung [ mailto:dyoung@vviuh221.vvi.com ]
> Sent: Thursday, June 03, 1999 1:49 PM
> To: cygwin
> Subject: stdarg question
> 
> 
> ----------------------------------------------------
> 
> I have a function using the stdarg facility such as:
> 
> myfunc(arg1, arg2, ...)
> 
> and in its body I want to pass the stdarg (vararg) part of 
> the stack such as:
> 
> myfunc(arg1, arg2, ...)
> {
> 
> /* do stuff */
> 
> anotherfunction(argA, ...);
> 
> /* do more stuff */
> 
> return;
> }
> 
> But because there is no parameter name for the vararg 
> argument part (i.e.:  
> ...) I don't see how to pass that to anotherfunction()
> 
> Can passing the vararg part be done? How?
> 
> Thanks A Bunch! David Young; VVI-DCS
> dyoung@vvi.com
> 

Regards,

W. Terry Lincoln - Senior Engineer            \     \   _   /
Ultimate Technology Corporation                \     \ |J| /
a Tridex Company (NASDAQ:trdx)                  \     _|E|_
ICQ# 39362285                                    \   |_ S _|
Email:  < mailto:WTerryLincoln@engineer.com >       \    |U|
1: < http://www.AngelFire.com/ny/TerryLincoln >      \ / |S| \
2: < http://www.geocities.com/Eureka/Concourse/7326 > \  | |
========================================================= ~~~~~
Opinions expressed do not represent the management of UTC.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* stdarg question
  1999-06-03 10:39   ` stdarg question David Young
@ 1999-06-30 22:10     ` David Young
  0 siblings, 0 replies; 6+ messages in thread
From: David Young @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin

I have a function using the stdarg facility such as:

myfunc(arg1, arg2, ...)

and in its body I want to pass the stdarg (vararg) part of the stack such as:

myfunc(arg1, arg2, ...)
{

/* do stuff */

anotherfunction(argA, ...);

/* do more stuff */

return;
}

But because there is no parameter name for the vararg argument part (i.e.:  
...) I don't see how to pass that to anotherfunction()

Can passing the vararg part be done? How?

Thanks A Bunch! David Young; VVI-DCS
dyoung@vvi.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: stdarg question
  1999-06-03 11:37 139a80000-HallM(DR3132)37x10
@ 1999-06-30 22:10 ` 139a80000-HallM(DR3132)37x10
  0 siblings, 0 replies; 6+ messages in thread
From: 139a80000-HallM(DR3132)37x10 @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin, dyoung

> I have a function using the stdarg facility such as:
> 
> myfunc(arg1, arg2, ...)
> 
> and in its body I want to pass the stdarg (vararg) part of the stack such as:
> 
> myfunc(arg1, arg2, ...)
> {
> 
> /* do stuff */
> 
> anotherfunction(argA, ...);
> 
> /* do more stuff */
> 
> return;
> }
> 
> But because there is no parameter name for the vararg argument part (i.e.:  
> ...) I don't see how to pass that to anotherfunction()
> 
> Can passing the vararg part be done? How?

What you have to do is to pass the argument vector to the second function.
You must have another version of "anotherfunction()" that takes a va_list
as an argument instead of a variable number of arguments (like vprintf()).

Your function would be similar to this:

extern void vanotherfunction(va_list);

void
myfunc(arg1, arg2, ...)
{
va_list arglist;

va_start(arglist, arg2);
vanotherfunction(arglist);
va_end(arglist);

}


Within vanotherfunction(), you manilulate arglist as if you had done a
va_start() there, but the va_start is actually done in myfunc().

marcus hall

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: stdarg question
@ 1999-06-03 11:37 139a80000-HallM(DR3132)37x10
  1999-06-30 22:10 ` 139a80000-HallM(DR3132)37x10
  0 siblings, 1 reply; 6+ messages in thread
From: 139a80000-HallM(DR3132)37x10 @ 1999-06-03 11:37 UTC (permalink / raw)
  To: cygwin, dyoung

> I have a function using the stdarg facility such as:
> 
> myfunc(arg1, arg2, ...)
> 
> and in its body I want to pass the stdarg (vararg) part of the stack such as:
> 
> myfunc(arg1, arg2, ...)
> {
> 
> /* do stuff */
> 
> anotherfunction(argA, ...);
> 
> /* do more stuff */
> 
> return;
> }
> 
> But because there is no parameter name for the vararg argument part (i.e.:  
> ...) I don't see how to pass that to anotherfunction()
> 
> Can passing the vararg part be done? How?

What you have to do is to pass the argument vector to the second function.
You must have another version of "anotherfunction()" that takes a va_list
as an argument instead of a variable number of arguments (like vprintf()).

Your function would be similar to this:

extern void vanotherfunction(va_list);

void
myfunc(arg1, arg2, ...)
{
va_list arglist;

va_start(arglist, arg2);
vanotherfunction(arglist);
va_end(arglist);

}


Within vanotherfunction(), you manilulate arglist as if you had done a
va_start() there, but the va_start is actually done in myfunc().

marcus hall

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* stdarg question
  1999-06-03 10:21 ` Glenn Spell
@ 1999-06-03 10:39   ` David Young
  1999-06-30 22:10     ` David Young
  0 siblings, 1 reply; 6+ messages in thread
From: David Young @ 1999-06-03 10:39 UTC (permalink / raw)
  To: cygwin

I have a function using the stdarg facility such as:

myfunc(arg1, arg2, ...)

and in its body I want to pass the stdarg (vararg) part of the stack such as:

myfunc(arg1, arg2, ...)
{

/* do stuff */

anotherfunction(argA, ...);

/* do more stuff */

return;
}

But because there is no parameter name for the vararg argument part (i.e.:  
...) I don't see how to pass that to anotherfunction()

Can passing the vararg part be done? How?

Thanks A Bunch! David Young; VVI-DCS
dyoung@vvi.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-06-30 22:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-04  8:02 stdarg question Lincoln, W. Terry
1999-06-30 22:10 ` Lincoln, W. Terry
  -- strict thread matches above, loose matches on Subject: below --
1999-06-03 11:37 139a80000-HallM(DR3132)37x10
1999-06-30 22:10 ` 139a80000-HallM(DR3132)37x10
1999-06-02 22:22 various 'cywin1.dll' tested with PERL's 'Configure' script Samy Alex ZAIMI
1999-06-03 10:21 ` Glenn Spell
1999-06-03 10:39   ` stdarg question David Young
1999-06-30 22:10     ` David Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).