X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdictionary.c;h=6e377f803212a6fbdce251ce17b36f3121e28177;hb=3393b6c0fe4006c0b17be9e9e999b753ce2b7d92;hp=ba840898112494b775d02c810edee29c98037fee;hpb=c2026467b6982086ba9fd5c44e549a0fe735285e;p=pspp-builds.git diff --git a/src/data/dictionary.c b/src/data/dictionary.c index ba840898..6e377f80 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -63,6 +63,9 @@ struct dictionary struct vector **vector; /* Vectors of variables. */ size_t vector_cnt; /* Number of vectors. */ struct attrset attributes; /* Custom attributes. */ + + char *encoding; /* Character encoding of string data */ + const struct dict_callbacks *callbacks; /* Callbacks on dictionary modification */ void *cb_data ; /* Data passed to callbacks */ @@ -71,6 +74,20 @@ struct dictionary void *changed_data; }; + +void +dict_set_encoding (struct dictionary *d, const char *enc) +{ + d->encoding = strdup (enc); +} + +const char * +dict_get_encoding (const struct dictionary *d) +{ + return d->encoding ; +} + + void dict_set_change_callback (struct dictionary *d, void (*changed) (struct dictionary *, void*), @@ -194,6 +211,9 @@ dict_clone (const struct dictionary *s) for (i = 0; i < s->vector_cnt; i++) d->vector[i] = vector_clone (s->vector[i], s, d); + if ( s->encoding) + d->encoding = strdup (s->encoding); + dict_set_attributes (d, dict_get_attributes (s)); return d;