X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdictionary.c;h=2dd1dfc4641108a08deb9b3e054acb7e872e53da;hb=ccead09ac2bc67bbaa40e67904f6c48f7cdf6700;hp=ba840898112494b775d02c810edee29c98037fee;hpb=9a331fe64eb814ae5c1322e21717a04fb254bf65;p=pspp-builds.git diff --git a/src/data/dictionary.c b/src/data/dictionary.c index ba840898..2dd1dfc4 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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,21 @@ struct dictionary void *changed_data; }; + +void +dict_set_encoding (struct dictionary *d, const char *enc) +{ + if (enc) + d->encoding = xstrdup (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 +212,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 = xstrdup (s->encoding); + dict_set_attributes (d, dict_get_attributes (s)); return d;