22 |
#ifndef __PSPP_DICT_H__ |
#ifndef __PSPP_DICT_H__ |
23 |
#define __PSPP_DICT_H__ |
#define __PSPP_DICT_H__ |
24 |
|
|
25 |
|
|
26 |
#include <glib-object.h> |
#include <glib-object.h> |
27 |
#include <glib.h> |
#include <glib.h> |
28 |
|
|
29 |
|
#include <dictionary.h> |
30 |
|
#include <var.h> |
31 |
|
|
32 |
G_BEGIN_DECLS |
G_BEGIN_DECLS |
33 |
|
|
34 |
|
|
46 |
typedef struct _PSPP_Dict PSPP_Dict; |
typedef struct _PSPP_Dict PSPP_Dict; |
47 |
typedef struct _PSPP_DictClass PSPP_DictClass; |
typedef struct _PSPP_DictClass PSPP_DictClass; |
48 |
|
|
|
|
|
|
/* Pinched from the pspp code */ |
|
|
struct variable |
|
|
{ |
|
|
char name[9]; |
|
|
int type; |
|
|
int width; |
|
|
}; |
|
|
|
|
49 |
struct _PSPP_Dict |
struct _PSPP_Dict |
50 |
{ |
{ |
51 |
GObject parent; |
GObject parent; |
52 |
GPtrArray *array; |
struct dictionary *dict; |
53 |
}; |
}; |
54 |
|
|
55 |
struct _PSPP_DictClass |
struct _PSPP_DictClass |
65 |
void pspp_dict_set_name(PSPP_Dict* s, gint idx, const gchar *name); |
void pspp_dict_set_name(PSPP_Dict* s, gint idx, const gchar *name); |
66 |
void pspp_dict_delete_var(PSPP_Dict *s, gint idx); |
void pspp_dict_delete_var(PSPP_Dict *s, gint idx); |
67 |
|
|
68 |
|
/* Return the variable indexed by IDX. |
69 |
|
returns NULL if IDX is not valid. |
70 |
|
*/ |
71 |
|
struct variable *pspp_dict_get_var(PSPP_Dict *d, gint idx); |
72 |
|
|
73 |
|
/* Return the number of variables in the dictionary */ |
74 |
|
gint pspp_dict_get_var_cnt(const PSPP_Dict *d); |
75 |
|
|
76 |
|
/* Return a variable by name. |
77 |
|
Return NULL if it doesn't exist |
78 |
|
*/ |
79 |
|
struct variable * pspp_dict_lookup_var (const PSPP_Dict *d, const gchar *name); |
80 |
|
|
81 |
|
|
82 |
G_END_DECLS |
G_END_DECLS |
83 |
|
|
84 |
#endif /* __PSPP_DICT_H__ */ |
#endif /* __PSPP_DICT_H__ */ |