// This function assumes ownership of the pointer TransferRequest::TransferRequest(ClassAd *ip) { ASSERT(ip != NULL); m_pre_push_func_desc = "None"; m_pre_push_func = NULL; m_pre_push_func_this = NULL; m_post_push_func_desc = "None"; m_post_push_func = NULL; m_post_push_func_this = NULL; m_update_func_desc = "None"; m_update_func = NULL; m_update_func_this = NULL; m_reaper_func_desc = "None"; m_reaper_func = NULL; m_reaper_func_this = NULL; m_ip = ip; m_rejected = false; /* Since this schema check happens here I don't need to check the existance of these attributes when I use them. */ ASSERT(check_schema() == INFO_PACKET_SCHEMA_OK); m_client_sock = NULL; m_procids = NULL; }
int main(int argc, char *argv[]) { const char *dbpath; rb_helper *bandb_helper; setup_signals(); bandb_helper = rb_helper_child(parse_request, error_cb, NULL, NULL, NULL, 256); if(bandb_helper == NULL) { fprintf(stderr, "This is ircd-ratbox bandb. You aren't supposed to run me directly. Maybe you want bantool?\n"); fprintf(stderr, "However I will print my Id tag $Id: bandb.c 28981 2015-11-03 01:58:58Z androsyn $\n"); fprintf(stderr, "Have a nice day\n"); exit(1); } dbpath = getenv("BANDB_DPATH"); if(dbpath == NULL) dbpath = DBPATH; dbconn = rsdb_init(dbpath, db_error_cb, bandb_helper); if(dbconn == NULL) { fprintf(stderr, "ircd-ratbox bandb reports it cannot open the database, giving up\n"); exit(1); } check_schema(); rb_helper_loop(bandb_helper, 0); }
/* ** Generate new object parser ** @params void ** @return success -> parser object error -> NULL */ t_parser *new_parser() { t_parser *parser; if ((parser = malloc(sizeof(t_parser))) == NULL) return (NULL); parser->alias_manager = new_alias_manager(); parser_methods(parser); parser_schema(parser); parser_explode_token(parser); if (!check_schema(parser) || parser->alias_manager == NULL) { parser->destruct(parser); return (NULL); } return (parser); }
int main(int argc, char *argv[]) { setup_signals(); bandb_helper = rb_helper_child(parse_request, error_cb, NULL, NULL, NULL, 256, 256, 256); /* XXX fix me */ if(bandb_helper == NULL) { fprintf(stderr, "This is ircd-ratbox bandb. You aren't supposed to run me directly. Maybe you want bantool?\n"); fprintf(stderr, "However I will print my Id tag $Revision$\n"); fprintf(stderr, "Have a nice day\n"); exit(1); } rsdb_init(db_error_cb); check_schema(); rb_helper_loop(bandb_helper, 0); return 0; }
/** * add self to panel white list if * there isn't */ static void check_and_set_sys_tray() { GSettings *sett; gchar **values; gboolean need_to_set = TRUE; gint len; gint i; if (!check_schema("com.canonical.Unity.Panel")) return ; sett = g_settings_new("com.canonical.Unity.Panel"); if (sett == NULL) return ; do { i = 0; values = g_settings_get_strv(sett, "systray-whitelist"); if (values == NULL) break; len = strlen(PACKAGE_NAME); while(values[i] != NULL) { if (g_ascii_strncasecmp(values[i], "all", 3) == 0) { need_to_set = FALSE; break; } else if(g_ascii_strncasecmp(values[i], PACKAGE_NAME, len) == 0) { need_to_set = FALSE; break; } i++; } } while(0); if (need_to_set) { if (values == NULL) i = 0; else i = g_strv_length(values); values = (gchar **)g_realloc(values, (i + 2 ) * sizeof(gchar *)); values[i] = g_strdup(PACKAGE_NAME); values[i + 1] = NULL; g_settings_set_strv(sett, "systray-whitelist", (const gchar *const *)values); } if (values) g_strfreev(values); g_object_unref(sett); }