mccp_result_t mccp_hashmap_find_no_lock(mccp_hashmap_t *hmptr, void *key, void **valptr) { mccp_result_t ret = MCCP_RESULT_ANY_FAILURES; if (hmptr != NULL && *hmptr != NULL && valptr != NULL) { ret = s_find(hmptr, key, valptr); } else { ret = MCCP_RESULT_INVALID_ARGS; } return ret; }
lagopus_result_t lagopus_hashmap_find_no_lock(lagopus_hashmap_t *hmptr, void *key, void **valptr) { lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES; if (hmptr != NULL && *hmptr != NULL && valptr != NULL) { ret = s_find(hmptr, key, valptr); } else { ret = LAGOPUS_RESULT_INVALID_ARGS; } return ret; }
lagopus_result_t lagopus_hashmap_find(lagopus_hashmap_t *hmptr, void *key, void **valptr) { lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES; if (hmptr != NULL && *hmptr != NULL && valptr != NULL) { int cstate; s_read_lock(*hmptr, &cstate); { ret = s_find(hmptr, key, valptr); } s_unlock(*hmptr, cstate); } else { ret = LAGOPUS_RESULT_INVALID_ARGS; } return ret; }
HandlerInfo *HL_New(ReqInfo *req) { HandlerInfo *hl = (HandlerInfo*) MEM_calloc(sizeof(HandlerInfo), "HandlerInfo"); char *buf; hl->docroot = s_dup(docroot); hl->servroot = s_dup(servroot); hl->req = req; RQ_SplitQuery(req->path, NULL, &buf, NULL); hl->query = RQ_ParseQuery(buf); s_free(buf); if (!strcncmp(req->method, "POST", 5, 5) && req->body != NULL) { char *encoding = RQ_GetHeader(req, "Content-Type"); if (encoding && s_find(encoding, "urlencoded") >= 0) { //turn binary body data into 0-terminated C string array_append(req->body, 0); hl->query2 = RQ_ParseQuery(req->body); } } return hl; }
MainController::MainController(): m_mw(new MainWindow), m_search(m_mw) { connect(m_mw, SIGNAL(s_save(QString)), this, SLOT(save(QString))); connect(m_mw, SIGNAL(s_load(QString)), this, SLOT(load(QString))); connect(m_mw, SIGNAL(s_newBase()), this, SLOT(newBase())); connect(m_mw, SIGNAL(s_addCategory(QString)), this, SLOT(newCategory(QString))); connect(m_mw, SIGNAL(s_removeCategory(QString)), this, SLOT(removeCategory(QString))); connect(m_mw, SIGNAL(s_seeCategory()), this, SLOT(editCategory())); connect(m_mw, SIGNAL(s_showCategory()), this, SLOT(showCategory())); connect(m_mw, SIGNAL(s_addMedia(QString)), this, SLOT(newMedia(QString))); connect(m_mw, SIGNAL(s_removeMedia(QString,QString)), this, SLOT(removeMedia(QString,QString))); connect(m_mw, SIGNAL(s_seeMedia()), this, SLOT(editMedia())); connect(m_mw, SIGNAL(s_showUser()), this, SLOT(setUser())); connect(m_mw, SIGNAL(s_search()), this, SLOT(search())); connect(&m_search, SIGNAL(s_find(QList<MediaSPointer>)), this, SLOT(showSearch(QList<MediaSPointer>))); connect(m_mw, SIGNAL(s_settings()), this, SLOT(settings())); m_mw->setShortcut(SettingsController::settings()); SettingsController artemis; artemis.newSettings(SettingsController::settings()); if(UserController::userCount() == 0) UserController().exec(); else UserController::connectUser(); }