~ubuntu-branches/debian/sid/genius/sid

« back to all changes in this revision

Viewing changes to src/utype.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-08-21 12:57:45 UTC
  • Revision ID: james.westby@ubuntu.com-20060821125745-sl9ks8v7fq324bdf
Tags: upstream-0.7.6.1
ImportĀ upstreamĀ versionĀ 0.7.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GENIUS Calculator
 
2
 * Copyright (C) 1997-2002 George Lebl
 
3
 *
 
4
 * Author: George Lebl
 
5
 *
 
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.
 
10
 *
 
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.
 
15
 *
 
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,
 
19
 * USA.
 
20
 */
 
21
 
 
22
#ifndef _UTYPE_H_
 
23
#define _UTYPE_H_
 
24
 
 
25
/*declarations of structures*/
 
26
#include "structs.h"
 
27
 
 
28
/* User type stuff */
 
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);
 
50
 
 
51
#endif