2
* Copyright (C) 1997-2002 George Lebl
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
25
/*declarations of structures*/
29
typedef void (*GelUTDestroyFunc)(gpointer data);
30
typedef gpointer (*GelUTCopyFunc)(gpointer data);
31
/* make a new unique identifier for a user type and set the destruction
32
function which is called when a variable of that type is killed,
33
and a function to copy the data,
34
returns -1 on error */
35
int gel_new_user_type(char *name,
36
GelUTDestroyFunc destructor,
37
GelUTCopyFunc copier);
38
/* destroy the type itself, not a specific variable */
39
void gel_destroy_user_type(int type);
40
/* lookup the id of a type */
41
int gel_get_user_type(const char *name);
42
/* lookup the name of type 'type' (don't free!)*/
43
char * gel_get_user_type_name(int type);
44
/* make a new variable of type 'type' with data 'data' */
45
GelETree *gel_make_new_user_variable(int type, gpointer data);
46
/* free the 'data' of type 'type' using the destructor */
47
void gel_free_user_variable_data(int type, gpointer data);
48
/* copy the 'data' of type 'type' using the copier */
49
gpointer gel_copy_user_variable_data(int type, gpointer data);