adime_va_start (3) - Linux Manuals

NAME

adime_va_list, adime_va_start, adime_va_arg, adime_va_end

SYNOPSIS

#include <adime.h>

typedef adime_va_list;

void adime_va_start(adime_va_list ap, first_arg);

TYPE adime_va_arg(adime_va_list ap, TYPE);

void adime_va_end(adime_va_list ap);

DESCRIPTION

Because of weirdnesses in the C language, some things that Adime does with va_lists would not be portable if it used a va_list directly. Instead you always have to use this replacement API, which works exactly like the standard API for va_lists, but is more portable. Also, if you pass an `adime_va_list' to another function, which reads an argument with `adime_va_arg()', then the `adime_va_list' will have advanced to the same position in the calling function as in the called function. In particular, after calling `adime_vdialogf()', the `adime_va_list' will have advanced to after the last argument used by Adime.

The following example shows how `adime_dialogf()' is implemented in terms of `adime_vdialogf()':

   int adime_dialogf(char *title, int x, int y, int edit_w,
                     char *format, ...)
   {
      int ret;
      va_list ap;
   
      va_start(ap, format);
      ret = adime_vdialogf(title, x, y, edit_w, format, ap);
      va_end(ap);
   
      return ret;
   }
   
See documentation for the standard `va_list', `va_start()', `va_arg()' and `va_end()' for more information.