rem: if (pa_domain.s == NULL) pa_domain.s = "sip.handhelds.org"; LOG(L_CRIT, "pa_domain=%s\n", pa_domain.s); pa_domain.len = strlen(pa_domain.s); LOG(L_CRIT, "pa_mod: use_db=%d db_url.s=%s pa_domain=%s\n", use_db, ZSW(db_url.s), ZSW(pa_domain.s));
context: static int pa_mod_init(void){	load_tm_f load_tm;	DBG("Presence Agent - initializing\n");	     /* import the TM auto-loading function */	if ( !(load_tm=(load_tm_f)find_export("load_tm", NO_SCRIPT, 0))) {		LOG(L_ERR, "Can't import tm\n");		return -1;	}	     /* let the auto-loading function load all TM stuff */	if (load_tm( &tmb )==-1) {		return -1;	}		if (register_fifo_cmd(fifo_pa_publish, "pa_publish", 0) < 0) {		LOG(L_CRIT, "cannot register fifo pa_publish\n");		return -1;	}	if (register_fifo_cmd(fifo_pa_presence, "pa_presence", 0) < 0) {		LOG(L_CRIT, "cannot register fifo pa_presence\n");		return -1;	}	if (register_fifo_cmd(fifo_pa_location, "pa_location", 0) < 0) {		LOG(L_CRIT, "cannot register fifo pa_location\n");		return -1;	}	if (register_fifo_cmd(fifo_pa_location_contact, "pa_location_contact", 0) < 0) {		LOG(L_CRIT, "cannot register fifo pa_location_contact\n");		return -1;	}	if (register_fifo_cmd(fifo_pa_watcherinfo, "pa_watcherinfo", 0) < 0) {		LOG(L_CRIT, "cannot register fifo pa_watcherinfo\n");		return -1;	}	if (init_unixsock_iface() < 0) {		LOG(L_ERR, "pa_mod_init: Error while initializing unix socket interface\n");		return -1;	}	     /* Register cache timer */	register_timer(timer, 0, timer_interval);	LOG(L_CRIT, "db_url=%p\n", db_url.s);	LOG(L_CRIT, "db_url=%s\n", ZSW(db_url.s));	db_url.len = db_url.s ? strlen(db_url.s) : 0;	LOG(L_CRIT, "db_url.len=%d\n", db_url.len);	if (pa_domain.s == NULL)	  pa_domain.s = "sip.handhelds.org";	LOG(L_CRIT, "pa_domain=%s\n", pa_domain.s);	pa_domain.len = strlen(pa_domain.s);	LOG(L_CRIT, "pa_mod: use_db=%d db_url.s=%s pa_domain=%s\n", 	    use_db, ZSW(db_url.s), ZSW(pa_domain.s));	if (use_db) {		if (!db_url.len) {			LOG(L_ERR, "pa_mod_init(): no db_url specified but use_db=1\n");			return -1;		}		if (bind_dbmod(db_url.s, &pa_dbf) < 0) { /* Find database module */			LOG(L_ERR, "pa_mod_init(): Can't bind database module via url %s\n", db_url.s);			return -1;		}		if (!DB_CAPABILITY(pa_dbf, DB_CAP_ALL)) {			LOG(L_ERR, "pa_mod_init(): Database module does not implement all functions needed by the module\n");			return -1;		}	}	default_priority = ((double)default_priority_percentage) / 100.0;	LOG(L_CRIT, "pa_mod_init done\n");	return 0;}