1 /****************************************************************************
2  * Copyright (c) 2011,2014 Free Software Foundation, Inc.                   *
3  *                                                                          *
4  * Permission is hereby granted, free of charge, to any person obtaining a  *
5  * copy of this software and associated documentation files (the            *
6  * "Software"), to deal in the Software without restriction, including      *
7  * without limitation the rights to use, copy, modify, merge, publish,      *
8  * distribute, distribute with modifications, sublicense, and/or sell       *
9  * copies of the Software, and to permit persons to whom the Software is    *
10  * furnished to do so, subject to the following conditions:                 *
11  *                                                                          *
12  * The above copyright notice and this permission notice shall be included  *
13  * in all copies or substantial portions of the Software.                   *
14  *                                                                          *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22  *                                                                          *
23  * Except as contained in this notice, the name(s) of the above copyright   *
24  * holders shall not be used in advertising or otherwise to promote the     *
25  * sale, use or other dealings in this Software without prior written       *
26  * authorization.                                                           *
27  ****************************************************************************/
28 
29 /****************************************************************************
30  *   Author:  Nicolas Boulenguez, 2011                                      *
31  ****************************************************************************/
32 
33 /*
34     Version Control
35     $Id: c_varargs_to_ada.c,v 1.6 2014/05/24 21:32:18 tom Exp $
36   --------------------------------------------------------------------------*/
37 /*
38   */
39 
40 #include "c_varargs_to_ada.h"
41 
42 int
set_field_type_alnum(FIELD * field,int minimum_width)43 set_field_type_alnum(FIELD *field,
44 		     int minimum_width)
45 {
46   return set_field_type(field, TYPE_ALNUM, minimum_width);
47 }
48 
49 int
set_field_type_alpha(FIELD * field,int minimum_width)50 set_field_type_alpha(FIELD *field,
51 		     int minimum_width)
52 {
53   return set_field_type(field, TYPE_ALPHA, minimum_width);
54 }
55 
56 int
set_field_type_enum(FIELD * field,char ** value_list,int case_sensitive,int unique_match)57 set_field_type_enum(FIELD *field,
58 		    char **value_list,
59 		    int case_sensitive,
60 		    int unique_match)
61 {
62   return set_field_type(field, TYPE_ENUM, value_list, case_sensitive,
63 			unique_match);
64 }
65 
66 int
set_field_type_integer(FIELD * field,int precision,long minimum,long maximum)67 set_field_type_integer(FIELD *field,
68 		       int precision,
69 		       long minimum,
70 		       long maximum)
71 {
72   return set_field_type(field, TYPE_INTEGER, precision, minimum, maximum);
73 }
74 
75 int
set_field_type_numeric(FIELD * field,int precision,double minimum,double maximum)76 set_field_type_numeric(FIELD *field,
77 		       int precision,
78 		       double minimum,
79 		       double maximum)
80 {
81   return set_field_type(field, TYPE_NUMERIC, precision, minimum, maximum);
82 }
83 
84 int
set_field_type_regexp(FIELD * field,char * regular_expression)85 set_field_type_regexp(FIELD *field,
86 		      char *regular_expression)
87 {
88   return set_field_type(field, TYPE_REGEXP, regular_expression);
89 }
90 
91 int
set_field_type_ipv4(FIELD * field)92 set_field_type_ipv4(FIELD *field)
93 {
94   return set_field_type(field, TYPE_IPV4);
95 }
96 
97 int
set_field_type_user(FIELD * field,FIELDTYPE * fieldtype,void * arg)98 set_field_type_user(FIELD *field,
99 		    FIELDTYPE *fieldtype,
100 		    void *arg)
101 {
102   return set_field_type(field, fieldtype, arg);
103 }
104 
105 void *
void_star_make_arg(va_list * list)106 void_star_make_arg(va_list *list)
107 {
108   return va_arg(*list, void *);
109 }
110 
111 #ifdef TRACE
112 void
_traces(const char * fmt,char * arg)113 _traces(const char *fmt, char *arg)
114 {
115   _tracef(fmt, arg);
116 }
117 #endif
118