54 error = gfx->write_data_to_db(data, xstring);
62 int SEC_structure_toggler::current() {
66 GB_ERROR SEC_structure_toggler::set_current(
int idx) {
78 GBDATA *SEC_structure_toggler::find(
int num) {
81 while (gb_found && num>0) {
86 if (!gb_found) Count = cnt;
90 GBDATA *SEC_structure_toggler::create(
const char *structure_name) {
92 if (st_error)
return NULp;
97 st_error = setName(gb_new, structure_name);
99 if (!st_error) st_error = store(gb_new);
100 if (!st_error) st_error = set_current(Count);
121 if (!gb_structures) {
128 gb_current = create(ali_name);
129 st_error = set_current(0);
132 int curr = current();
134 gb_current = find(current());
137 st_error = set_current(0);
138 gb_current = find(0);
150 error =
"No other structure in DB";
153 int nextNum = current()+1;
154 if (nextNum >= Count) nextNum = 0;
158 error = store(gb_current);
159 if (!error) error = set_current(nextNum);
161 gb_current = find(nextNum);
166 error = restore(gb_current);
170 return ta.
close(error);
180 GBDATA *gb_new = create(structure_name);
189 sec_assert(error || (find(current()) == gb_current));
190 return ta.
close(error);
198 GBDATA *gb_del = gb_current;
203 int curr = current();
207 if (curr >= del) error = set_current(curr-1);
210 return ta.
close(error);
214 const char *structure_name =
NULp;
221 st_error = ta.
close(st_error);
222 return structure_name;
225 GB_ERROR SEC_structure_toggler::setName(
GBDATA *gb_struct,
const char *new_name) {
229 GB_ERROR SEC_structure_toggler::setName(
const char *new_name) {
231 GB_ERROR error = setName(gb_current, new_name);
232 return ta.
close(error);
SEC_structure_toggler(GBDATA *gb_main, const char *ali_name, SEC_graphic *Gfx)
GBDATA * GB_nextEntry(GBDATA *entry)
const char * GBS_global_string(const char *templat,...)
GB_ERROR GB_delete(GBDATA *&source)
GB_ERROR GB_await_error()
NOT4PERL long * GBT_read_int(GBDATA *gb_container, const char *fieldpath)
GBDATA * GB_create_container(GBDATA *father, const char *key)
static void error(const char *msg)
GB_ERROR GB_write_int(GBDATA *gbd, long i)
GB_ERROR close(GB_ERROR error)
GB_ERROR GBT_write_string(GBDATA *gb_container, const char *fieldpath, const char *content)
GB_ERROR copyTo(const char *name)
char * GB_read_string(GBDATA *gbd)
GB_transaction ta(gb_var)
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
GBDATA * GB_entry(GBDATA *father, const char *key)