void IssuingInstitutionCacheController::insertCache(sql::ResultSet* resSet) { SET_PROPERTIES_BEGIN(IssuingInstitutionCache); SET_STRING_FIELD(id); SET_STRING_FIELD(institution_code); SET_STRING_FIELD(institution_type); SET_STRING_FIELD(full_name_c); SET_STRING_FIELD(delflag); SET_PROPERTIES_END; }
static void ctf_read_tp (struct uploaded_tp **uploaded_tps) { gdb_assert (ctf_iter != NULL); while (1) { struct bt_ctf_event *event; const struct bt_definition *scope; uint32_t u32; int32_t int32; uint64_t u64; struct uploaded_tp *utp = NULL; event = bt_ctf_iter_read_event (ctf_iter); scope = bt_ctf_get_top_level_scope (event, BT_STREAM_EVENT_HEADER); u32 = bt_ctf_get_uint64 (bt_ctf_get_field (event, scope, "id")); if (u32 != CTF_EVENT_ID_TP_DEF) break; scope = bt_ctf_get_top_level_scope (event, BT_EVENT_FIELDS); int32 = (int32_t) bt_ctf_get_int64 (bt_ctf_get_field (event, scope, "number")); u64 = bt_ctf_get_uint64 (bt_ctf_get_field (event, scope, "addr")); utp = get_uploaded_tp (int32, u64, uploaded_tps); SET_INT32_FIELD (event, scope, utp, enabled); SET_INT32_FIELD (event, scope, utp, step); SET_INT32_FIELD (event, scope, utp, pass); SET_INT32_FIELD (event, scope, utp, hit_count); SET_INT32_FIELD (event, scope, utp, type); /* Read 'cmd_strings'. */ SET_ARRAY_FIELD (event, scope, utp, cmd_num, cmd_strings); /* Read 'actions'. */ SET_ARRAY_FIELD (event, scope, utp, action_num, actions); /* Read 'step_actions'. */ SET_ARRAY_FIELD (event, scope, utp, step_action_num, step_actions); SET_STRING_FIELD(event, scope, utp, at_string); SET_STRING_FIELD(event, scope, utp, cond_string); if (bt_iter_next (bt_ctf_get_iter (ctf_iter)) < 0) break; } }
/* Parse options and put in the right field in the struct */ int option_dispatcher(char *n, char *p, struct rc_conf_s *r) { /* Database Hostname */ if (!strcmp(n, "db_host")) SET_STRING_FIELD(r, db_host, p); /* Database Name */ else if (!strcmp(n, "db_name")) SET_STRING_FIELD(r, db_name, p); /* Database User */ else if (!strcmp(n, "db_user")) SET_STRING_FIELD(r, db_user, p); /* Database password */ else if (!strcmp(n, "db_passwd")) SET_STRING_FIELD(r, db_passwd, p); /* Director subgenre change rate */ else if (!strcmp(n, "dir_change_subgenre")) SET_INT_FIELD(r, dir_change_subgenre, p); /* Director genre change rate on a measure */ else if (!strcmp(n, "dir_change_genre_on_one")) SET_INT_FIELD(r, dir_change_genre_on_one, p); /* Director genre change rate on any measure */ else if (!strcmp(n, "dir_change_genre_on_any")) SET_INT_FIELD(r, dir_change_genre_on_any, p); /* Director mood change rate on a measure */ else if (!strcmp(n, "dir_change_mood_on_one")) SET_INT_FIELD(r, dir_change_mood_on_one, p); /* Director mood change rate on any measure */ else if (!strcmp(n, "dir_change_mood_on_any")) SET_INT_FIELD(r, dir_change_mood_on_any, p); /* Director chord change rate on a measure */ else if (!strcmp(n, "dir_change_chord_on_one")) SET_INT_FIELD(r, dir_change_chord_on_one, p); /* Director chord change rate on any measure */ else if (!strcmp(n, "dir_change_chord_on_any")) SET_INT_FIELD(r, dir_change_chord_on_any, p); /* Director multi chord rate */ else if (!strcmp(n, "dir_random_multi_chord")) SET_INT_FIELD(r, dir_random_multi_chord, p); /* Director tritone rate */ else if (!strcmp(n, "dir_chord_tritone")) SET_INT_FIELD(r, dir_chord_tritone, p); /* Director "cadenza" of chords. */ else if (!strcmp(n, "dir_chord_cadenza")) SET_INT_FIELD(r, dir_chord_cadenza, p); /* Director tonal zone */ else if (!strcmp(n, "dir_chord_tonal_zone")) SET_INT_FIELD(r, dir_chord_tonal_zone, p); /* Option not implemented */ else return 1; return 0; }
static void save_profile_cb(GaimConnection *gc, GaimRequestFields *fields) { TrepiaSession *session = gc->proto_data; const char *value; char *buf, *temp; int int_val; buf = g_strdup("<K>"); temp = buf; SET_STRING_FIELD("b", "email"); SET_STRING_FIELD("c", "homepage"); SET_STRING_FIELD("d", "firstname"); SET_STRING_FIELD("e", "lastname"); SET_STRING_FIELD("f", "icq"); SET_STRING_FIELD("g", "aim"); SET_STRING_FIELD("h", "msn"); SET_STRING_FIELD("i", "yahoo"); SET_INT_FIELD( "j", "age"); int_val = gaim_request_fields_get_choice(fields, "gender"); buf = g_strdup_printf("%s<k>%c</k>", temp, (int_val == 1 ? 'F' : 'M')); g_free(temp); temp = buf; SET_STRING_FIELD("l", "profile"); SET_STRING_FIELD("n", "country"); SET_STRING_FIELD("o", "state"); SET_STRING_FIELD("p", "city"); buf = g_strdup_printf("%s</K>", temp); if (trepia_write(session->fd, buf, strlen(buf)) < 0) { gaim_connection_error(session->gc, _("Write error")); return; } }