File: form_wrap.h

package info (click to toggle)
ncurses-ruby 1.1-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 356 kB
  • ctags: 617
  • sloc: ansic: 3,923; ruby: 998; makefile: 57
file content (62 lines) | stat: -rw-r--r-- 1,885 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * This is a curses forms wrapper as part of ncurses-ruby
 * Contributed by Simon Kaczor <skaczor@cox.net>
 * Prognosoft Inc. <http://www.prognosoft.biz>
 * Copyright 2004
 * 
 *  This module is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This module is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this module; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 *
 */

#if !defined(FORM_HH) && defined(HAVE_FORM_H)
#define FORM_HH

#include <form.h>
#include <ruby.h>

extern VALUE mForm;
extern VALUE cFIELD;
extern VALUE cFIELDTYPE;
extern VALUE cFORM;
/*extern VALUE cPAGE;*/

typedef struct {
 		bool (* field_check)(FIELD *,const void *); 
		FIELDTYPE* fieldtype;
} FLDCHKFUNC;



#define FORM_DEF_CONST(name) \
 rb_define_const(mForm, #name, INT2NUM(name));

#define FORM_SNG_FUNC(name, nargs)                \
  rb_define_singleton_method(mForm,               \
                             #name,               \
                             &rbncurs_m_ ## name, \
                             nargs)
#define RB_CLASS_METH(class, name, nargs)       \
	rb_define_method(class,                      \
                    #name,                      \
						  (&rbncurs_c_ ## name),      \
						  nargs);

void init_req_constants();
void init_just_constants();
void init_opts_constants();

void init_form(void);

#endif