projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added the ECHO command.
[pspp]
/
src
/
var.h
diff --git
a/src/var.h
b/src/var.h
index 60b374ecfc0c16cdc33b32df80409a02e45fd157..63296b9f4b35c6554e3c244c12d9c934a05b2110 100644
(file)
--- a/
src/var.h
+++ b/
src/var.h
@@
-20,10
+20,15
@@
#if !var_h
#define var_h 1
#if !var_h
#define var_h 1
+
#include <stddef.h>
#include <stddef.h>
+#include "config.h"
+#include "bool.h"
#include "format.h"
#include "val.h"
#include "format.h"
#include "val.h"
+
+
/* Script variables. */
/* Variable type. */
/* Script variables. */
/* Variable type. */
@@
-53,10
+58,12
@@
enum
MISSING_COUNT
};
MISSING_COUNT
};
+
/* A variable's dictionary entry. */
struct variable
{
/* A variable's dictionary entry. */
struct variable
{
- char name[9]; /* As a string. */
+ char name[SHORT_NAME_LEN + 1]; /* As a string. */
+ char *longname; /* Pointer to entry in dictionary's table */
int index; /* Index into its dictionary's var[]. */
int type; /* NUMERIC or ALPHA. */
int index; /* Index into its dictionary's var[]. */
int type; /* NUMERIC or ALPHA. */
@@
-77,13
+84,37
@@
struct variable
struct val_labs *val_labs; /* Value labels. */
char *label; /* Variable label. */
struct val_labs *val_labs; /* Value labels. */
char *label; /* Variable label. */
+
+ /* GUI display parameters */
+ enum measure measure; /* Nominal ordinal or continuous */
+ int display_width; /* Width of data editor column */
+ enum alignment alignment; /* Alignment of data in gui */
+
/* Per-command info. */
void *aux;
void (*aux_dtor) (struct variable *);
};
/* Per-command info. */
void *aux;
void (*aux_dtor) (struct variable *);
};
+
+/* A tuple containing short names and longnames */
+struct name_table_entry
+{
+ char *longname;
+ char *name;
+};
+
+bool var_is_valid_name (const char *, bool issue_error);
int compare_var_names (const void *, const void *, void *);
unsigned hash_var_name (const void *, void *);
int compare_var_names (const void *, const void *, void *);
unsigned hash_var_name (const void *, void *);
+
+/* Destroy and free up an nte */
+void free_nte(struct name_table_entry *nte);
+
+
+unsigned hash_long_name (const void *e_, void *aux UNUSED) ;
+int compare_long_names(const void *a_, const void *b_, void *aux);
+
+
int compare_var_ptr_names (const void *, const void *, void *);
unsigned hash_var_ptr_name (const void *, void *);
int compare_var_ptr_names (const void *, const void *, void *);
unsigned hash_var_ptr_name (const void *, void *);
@@
-108,7
+139,7
@@
const char *dict_class_to_name (enum dict_class dict_class);
struct vector
{
int idx; /* Index for dict_get_vector(). */
struct vector
{
int idx; /* Index for dict_get_vector(). */
- char name[
9];
/* Name. */
+ char name[
SHORT_NAME_LEN + 1];
/* Name. */
struct variable **var; /* Vector of variables. */
int cnt; /* Number of variables. */
};
struct variable **var; /* Vector of variables. */
int cnt; /* Number of variables. */
};