unsigned int cmd_script(callbackp *callbacki) { char *domain = CONFIG_VAL(Server, domain, callbacki->g_ape->srv); char *script = NULL; int alloc = 0; APE_PARAMS_INIT(); if (domain == NULL) { send_error(callbacki->call_user, "NO_DOMAIN", "201", callbacki->g_ape); } else { char *autodom; if (strcmp(domain, "auto") == 0 && (autodom = JSTR(domain)) != NULL) { domain = autodom; #if 0 /* http://geekandpoke.typepad.com/.a/6a00d8341d3df553ef0120a6d65b8a970b-pi */ struct _http_header_line *hlines; for (hlines = callbacki->client->http.hlines; hlines != NULL; hlines = hlines->next) { if (strcasecmp(hlines->key.val, "host") == 0) { char *loc; char *newdom = xmalloc(sizeof(char) * (hlines->value.len + 1)); memset(newdom, '\0', hlines->value.len + 1); if ((loc = strrchr(hlines->value.val, '.')) != NULL) { int i, pos = 0; for (i = 0; i < hlines->value.len; i++, pos++) { newdom[pos] = hlines->value.val[i]; if (newdom[pos] == ':') { newdom[pos] = '\0'; break; } if (hlines->value.val[i] == '.' && &hlines->value.val[i] < loc) { pos = -1; } } newdom[pos] = '\0'; domain = newdom; alloc = 1; } } } #endif } sendf(callbacki->client->fd, callbacki->g_ape, "%s<html>\n<head>\n\t<script>\n\t\tdocument.domain=\"%s\"\n\t</script>\n", HEADER_DEFAULT, domain); if (alloc) { free(domain); } JFOREACH(scripts, script) { sendf(callbacki->client->fd, callbacki->g_ape, "\t<script type=\"text/javascript\" src=\"%s\"></script>\n", script); } sendbin(callbacki->client->fd, "</head>\n<body>\n</body>\n</html>", 30, 0, callbacki->g_ape); }
/* * Class: uniquantum_search_SearchModule * Method: GetPoiCallNumber * Signature: ()Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_kr_co_uniquantum_search_SearchModule_GetPoiCallNumber__ (JNIEnv * env, jobject obj) { //if( m_pPoiDatasIterator == NULL ) return NULL; if( m_bChangedPoiIterator ) { m_pPoiHeader = &(*m_pPoiDatasIterator).second; m_pPoiBody = g_pSearchModule->GetSearchPoiResult( m_pPoiHeader ); m_bChangedPoiIterator = false; } return m_pPoiBody->info.tel_cnt > 0 ? JSTR( m_pPoiBody->tel[0] ) : NULL; }
/* * Class: uniquantum_search_SearchModule * Method: JNI_GetPoiCallNumber * Signature: (I)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_kr_co_uniquantum_search_SearchModule_GetPoiCallNumber__I (JNIEnv * env, jobject obj, jint poiIdx ) { if( m_pPoiBody == NULL || g_poiHeaderIdx != poiIdx ) { std::multimap<tstring,POI_HEADER>::iterator it = m_pPoiDatas->begin();// + nAptIdx; for( int i = 0; i < poiIdx; ++i, ++it ); m_pPoiHeader = &(*it).second; m_pPoiBody = g_pSearchModule->GetSearchPoiResult( m_pPoiHeader ); g_poiHeaderIdx = poiIdx; } return m_pPoiBody->info.tel_cnt > 0 ? JSTR( m_pPoiBody->tel[0] ) : NULL; }