static int itf_sd_init() { unsigned long hd = 0; if ((hd = CfgInitialize(cfgfile)) == 0ul) { LOGERROR("Parsing configuration file [%s] failed.", cfgfile); return -1; } call_adap_to = adapter_register_archive(hd, (char *)"Call.Archive", CallOutputCallback); sms_adap_to = adapter_register_archive(hd, (char *)"SMS.Archive", SMSOutputCallback); power_adap_to = adapter_register_archive(hd, (char *)"Power.Archive", PowerOutputCallback); switch_adap_to = adapter_register_archive(hd, (char *)"Switch.Archive", SwitchOutputCallback); location_adap_to = adapter_register_archive(hd, (char *)"Location.Archive", LocationOutputCallback); if ((call_adap_to == NULL) || (power_adap_to == NULL) || (sms_adap_to == NULL) || (switch_adap_to == NULL) || (location_adap_to == NULL)) { CfgInvalidate(hd); return -1; } itf_sd_init_lacci_mapping(hd); CfgInvalidate(hd); if (!InitDbus(PKTTYPE_CDR, PKTTYPE_CDR_BSSAP, g_dbus_cdr)) return -1; if (!InitDbus(PKTTYPE_EVENT, PKTTYPE_EVENT_BSSAP, g_dbus_event)) return -1; swdbus_update_filter( g_dbus_event, filter_parse((char *)"(PROTOCOL IN [1, 2])")); g_timer = timer_mgr_create_timerlist(NULL, TIMERMGR_SOURCE_LOCAL, TimerCallback, NULL, "SendCDRConvertStatistics"); timer_mgr_add_timer_periodic(g_timer, 300, NULL); return 0; }
int main(void) { InitDbus(); GMainLoop *loop = g_main_loop_new(NULL, FALSE); g_main_loop_run(loop); while (1) sleep(1); // return 0; }
extern SANE_Status sane_hpaio_init(SANE_Int * pVersionCode, SANE_Auth_Callback authorize) { int stat; DBG_INIT(); InitDbus(); DBG(8, "sane_hpaio_init(): %s %d\n", __FILE__, __LINE__); if( pVersionCode ) { *pVersionCode = SANE_VERSION_CODE( 1, 0, 0 ); } stat = orblite_init(pVersionCode, authorize); return stat; } /* sane_hpaio_init() */