]> ncurses.scripts.mit.edu Git - ncurses.git/blob - form/frm_adabind.c
ncurses 4.1
[ncurses.git] / form / frm_adabind.c
1 /*-----------------------------------------------------------------------------+
2 |           The ncurses form library is  Copyright (C) 1995-1997               |
3 |             by Juergen Pfeifer <Juergen.Pfeifer@T-Online.de>                 |
4 |                          All Rights Reserved.                                |
5 |                                                                              |
6 | Permission to use, copy, modify, and distribute this software and its        |
7 | documentation for any purpose and without fee is hereby granted, provided    |
8 | that the above copyright notice appear in all copies and that both that      |
9 | copyright notice and this permission notice appear in supporting             |
10 | documentation, and that the name of the above listed copyright holder(s) not |
11 | be used in advertising or publicity pertaining to distribution of the        |
12 | software without specific, written prior permission.                         | 
13 |                                                                              |
14 | THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO  |
15 | THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-  |
16 | NESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR   |
17 | ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RE- |
18 | SULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
19 | NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH    |
20 | THE USE OR PERFORMANCE OF THIS SOFTWARE.                                     |
21 +-----------------------------------------------------------------------------*/
22
23 /***************************************************************************
24 * Module frm_adabind.c                                                     *
25 * Helper routines to ease the implementation of an Ada95 binding to        *
26 * ncurses. For details and copyright of the binding see the ../Ada95       *
27 * subdirectory.                                                            *
28 ***************************************************************************/
29 #include "form.priv.h"
30
31 MODULE_ID("$Id: frm_adabind.c,v 1.3 1997/05/01 16:47:54 juergen Exp $")
32
33 /* Prototypes for the functions in this module */
34 void _nc_ada_normalize_field_opts (int *opt);
35 void _nc_ada_normalize_form_opts (int *opt);
36 void *_nc_ada_getvarg(va_list *);
37
38
39 void _nc_ada_normalize_field_opts (int *opt)
40 {
41   *opt = ALL_FIELD_OPTS & (*opt);
42 }
43
44 void _nc_ada_normalize_form_opts (int *opt)
45 {
46   *opt = ALL_FORM_OPTS & (*opt);
47 }
48
49
50 /*  This tiny stub helps us to get a void pointer from an argument list.
51 //  The mechanism for libform to handle arguments to field types uses
52 //  unfortunately functions with variable argument lists. In the Ada95
53 //  binding we replace this by a mechanism that only uses one argument
54 //  that is a pointer to a record describing all the specifics of an
55 //  user defined field type. So we need only this simple generic
56 //  procedure to get the pointer from the arglist.
57 */
58 void *_nc_ada_getvarg(va_list *ap)
59 {
60   return va_arg(*ap,void*);
61 }