/** * \brief Storage plugin initialization. * * \param[in] params parameters for this storage plugin * \param[out] config the plugin specific configuration structure * \return 0 on success, negative value otherwise */ int storage_init(char *params, void **config) { MSG_INFO(msg_module, "Dummy plugin: storage_init called"); struct dummy_config *conf; xmlDocPtr doc; xmlNodePtr cur; /* allocate space for config structure */ conf = (struct dummy_config *) malloc(sizeof(*conf)); if (conf == NULL) { MSG_ERROR(msg_module, "Not enough memory (%s:%d)", __FILE__, __LINE__); return -1; } /* try to parse configuration file */ doc = xmlReadMemory(params, strlen(params), "nobase.xml", NULL, 0); if (doc == NULL) { MSG_ERROR(msg_module, "Plugin configuration parsing failed"); goto err_read_conf; } cur = xmlDocGetRootElement(doc); if (cur == NULL) { MSG_ERROR(msg_module, "Empty configuration"); goto err_init; } if (xmlStrcmp(cur->name, (const xmlChar *) "fileWriter")) { MSG_ERROR(msg_module, "Root node != fileWriter"); goto err_init; } /* default delay */ conf->delay = 0; cur = cur->xmlChildrenNode; while (cur != NULL) { /* find out the desired delay */ if ((!xmlStrcmp(cur->name, (const xmlChar *) "delay"))) { conf->delay = atoi((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); break; } cur = cur->next; } MSG_INFO(msg_module, "Dummy plugin: delay set to %ius", conf->delay); /* we don't need this xml tree anymore */ xmlFreeDoc(doc); /* pass config to core */ *config = conf; return 0; err_init: xmlFreeDoc(doc); err_read_conf: free(conf); return -1; }
/** * \brief Print queue usage * * @param conf output manager's config * @param stat_out_file Output file for statistics */ void statistics_print_buffers(struct output_manager_config *conf, FILE *stat_out_file) { /* Print info about preprocessor's output queue */ MSG_INFO(stat_module, "Queue utilization:"); struct ring_buffer *prep_buffer = get_preprocessor_output_queue(); MSG_INFO(stat_module, " preprocessor output queue: %u / %u", prep_buffer->count, prep_buffer->size); /* Print info about Output Manager's queues */ struct data_manager_config *dm = conf->data_managers; if (dm) { MSG_INFO(stat_module, " output manager output queues:"); MSG_INFO(stat_module, " %.4s | %.10s / %.10s", "ODID", "waiting" ,"total size"); while (dm) { MSG_INFO(stat_module, " [%u] %10u / %u", dm->observation_domain_id, dm->store_queue->count, dm->store_queue->size); dm = dm->next; } } // Print to file if (stat_out_file) { // Add contents here } }
/** * \brief Main routine of statistics thread * * \param[in] config configuration structure for thread * \return NULL once thread shutdown is signaled by proxy plugin */ void *stat_thread(void* config) { struct proxy_config *conf = (struct proxy_config *) config; struct sigaction action; /* Catch SIGUSR1 */ sigemptyset(&action.sa_mask); action.sa_flags = 0; action.sa_handler = term_signal_handler; sigaction(SIGUSR1, &action, NULL); /* Set thread name */ prctl(PR_SET_NAME, "med:proxy:stats", 0, 0, 0); while (conf->stat_interval) { sleep(conf->stat_interval); /* Check whether thread should be killed (by proxy plugin) */ if (conf->stat_done) { break; } MSG_INFO(msg_module, ""); MSG_INFO(msg_module, "Records with domain resolution: %u; records without domain resolution: %u", conf->records_resolution, conf->records_wo_resolution); MSG_INFO(msg_module, "Failed resolutions: %u; skipped resolutions: %u", conf->failed_resolutions, conf->skipped_resolutions); MSG_INFO(msg_module, ""); } return NULL; }
/** * \brief Change mode of output manager * * Allow to change mode from single mode to multi mode and vice versa. * If new mode is different from current mode, all data managers are removed. * If the manager thread is running, it will be stopped and restarted later. * * \param[in] mode New mode of output manager * \return 0 on successs */ int output_manager_set_mode(enum om_mode mode) { if (conf->perman_odid_merge) { /* Nothing can be changed, permanent single manager mode enabled */ if (mode == OM_MULTIPLE) { MSG_WARNING(msg_module, "Unable to change Output Manager mode. " "Single manager mode permanently enabled ('-M' argument)"); } return 0; } if (conf->manager_mode == mode) { /* Mode is still the same */ return 0; } if (conf->running) { MSG_DEBUG(msg_module, "Stopping Output Manager thread"); rbuffer_write(conf->in_queue, NULL, 1); pthread_join(conf->thread_id, NULL); } /* Delete data managers */ struct data_manager_config *aux_config = conf->data_managers; while (aux_config) { struct data_manager_config *tmp = aux_config; aux_config = aux_config->next; data_manager_close(&tmp); } conf->data_managers = NULL; conf->last = NULL; conf->manager_mode = mode; if (mode == OM_SINGLE) { MSG_INFO(msg_module, "Switching Output Manager to single manager mode"); } else if (mode == OM_MULTIPLE) { MSG_INFO(msg_module, "Switching Output Manager to multiple manager mode"); } else { /* Unknown mode */ } if (conf->running) { /* Restart thread */ int retval; MSG_DEBUG(msg_module, "Restarting Output Manager thread"); retval = pthread_create(&(conf->thread_id), NULL, &output_manager_plugin_thread, (void *) conf); if (retval != 0) { MSG_ERROR(msg_module, "Unable to create Output Manager thread"); free(conf); return -1; } } return 0; }
int DMR_DEMIRBAS_KARTI::CHECK_EMPTY () { if ( m_ui->searchedit_muh_hesap_kodu->GET_TEXT().isEmpty() EQ true ) { MSG_INFO( tr( "Muhasebe hesap kodunu boş bırakamazsınız!.." ), m_ui->searchedit_muh_hesap_kodu ); return ADAK_FAIL; } if ( m_ui->searchedit_amor_gdr_hesap_kodu->GET_TEXT().isEmpty() EQ true ) { MSG_INFO( tr( "Amortisman Giderleri hesap kodunu boş bırakamazsınız!.." ), m_ui->searchedit_amor_gdr_hesap_kodu ); return ADAK_FAIL; } if ( m_ui->searchedit_bir_amortisman_hesap_kodu->GET_TEXT().isEmpty() EQ true ) { MSG_INFO( tr( "Birikmiş Amortismanlar hesap kodunu boş bırakamazsınız!.." ), m_ui->searchedit_bir_amortisman_hesap_kodu ); return ADAK_FAIL; } if ( m_ui->searchedit_dmr_satis_kar_hesap_kodu->GET_TEXT().isEmpty() EQ true ) { MSG_INFO( tr( "Sabit Kıymet Satış Karı hesap kodunu boş bırakamazsınız!.." ), m_ui->searchedit_dmr_satis_kar_hesap_kodu ); return ADAK_FAIL; } if ( m_ui->lineedit_demirbas_kodu->text().isEmpty() EQ true ) { MSG_WARNING( tr ( "Demirbaş kodunu boş bırakamazsınız!.." ), m_ui->lineedit_demirbas_kodu ); return ADAK_FAIL; } if ( m_ui->lineedit_demirbas_adi->text().isEmpty() EQ true ) { MSG_WARNING( tr ( "Demirbaş adını boş bırakamazsınız!.." ), m_ui->lineedit_demirbas_adi ); return ADAK_FAIL; } if ( m_ui->commaEdit_alis_fiyati->GET_DOUBLE() EQ 0.0 ) { MSG_WARNING( tr ( "Alış Fiyatını girmelisiniz!.." ), m_ui->commaEdit_alis_fiyati ); return ADAK_FAIL; } if ( m_ui->lineedit_amortisman_suresi->text().isEmpty() EQ true OR m_ui->lineedit_amortisman_suresi->text().toInt() EQ 0 ) { MSG_WARNING( tr ( "Amortisman süresini girmelisiniz!.." ),m_ui->lineedit_amortisman_suresi ); return ADAK_FAIL; } if ( m_ui->comboBox_amortisman_yontemi->currentIndex() EQ -1 ) { MSG_WARNING( tr ( "Amortisman Yöntemini Boş Bırakamazsınız!.." ), m_ui->comboBox_amortisman_yontemi ); return ADAK_FAIL; } return ADAK_OK; }
int BNK_VIRMAN_FORMU::CHECK_EMPTY () { if ( m_ui->lineEdit_fis_no->text().isEmpty() EQ true ) { MSG_INFO( tr("Yeni Banka Fişi kaydı için (*) girmelisiniz"), m_ui->lineEdit_fis_no ); return ADAK_FAIL; } if ( m_gonderen_hesap_no_id EQ 0 ) { MSG_WARNING( tr( "Gönderen Banka hesabını girmek zorundasınız." ), m_ui->comboBox_gonderen_hesap ); return ADAK_FAIL; } if ( m_alici_hesap_no_id EQ 0 ) { MSG_WARNING( tr( "Alıcı Banka hesabını girmek zorundasınız." ), m_ui->comboBox_gonderen_hesap ); return ADAK_FAIL; } if ( m_ui->commaEdit_gonderen_tutar->GET_DOUBLE() EQ 0.00 ) { MSG_WARNING( tr( "Tutarı girmek zorundasınız." ), m_ui->commaEdit_gonderen_tutar ); return ADAK_FAIL; } if ( m_gon_hesabi_doviz_id NE m_alici_hesabi_doviz_id ) { if ( m_ui->commaEdit_alan_tutar->GET_DOUBLE() EQ 0.00 ) { MSG_WARNING( tr( "Tutarı girmek zorundasınız." ), m_ui->commaEdit_alan_tutar ); return ADAK_FAIL; } } return ADAK_OK; }
static int __b_update_buf2(batt_info_t *info, int raw, int modifier) { int idx = info->buf.head; int sum, cnt, i; if (info->buf.cnt < BATTERY_BUF_MAX) (info->buf.cnt)++; /* save ADC-value + modifier */ info->buf.raw[idx] = raw; info->buf.mod[idx] = modifier; /* A_n = (SUM(A_m, 0 ~ n-3) + R_(n-2) + R_(n-1) + R_n)/n */ for(sum = 0, cnt = 0, i = info->buf.head - 1; cnt < info->buf.cnt - 1; cnt++, i--) { if (i < 0) i = BATTERY_BUF_MAX - 1; if (cnt < 2) sum += info->buf.raw[i] + info->buf.mod[i]; else sum += info->buf.adc[i]; } info->buf.adc[idx] = (sum + raw + modifier) / info->buf.cnt; /* save modified-data */ info->buf.dat[idx] = battery_get_step(info->buf.adc[idx]); MSG_INFO(1, " buf(%d %d)", info->buf.dat[idx], info->buf.adc[idx]); b_buf_inc(info); return info->buf.dat[idx]; }
static int __b_update_buf(batt_info_t *info, int raw) { int sum, i, j, k; if (info->buf.cnt < BATTERY_BUF_MAX) (info->buf.cnt)++; /* save ADC-value + modifier */ info->buf.adc[info->buf.head] = raw; sum = 0; j = info->buf.head - 1; for(i=0, k=0; i < info->buf.cnt - 1; i++, j--, k++) { if (j < 0) j = BATTERY_BUF_MAX - 1; if (k < 2) sum += info->buf.adc[j]; else sum += info->buf.raw[j]; } raw = (sum + raw) / info->buf.cnt; /* save modified-data */ info->buf.raw[info->buf.head] = raw; info->buf.dat[info->buf.head] = raw = battery_get_step(raw); MSG_INFO(1, " buf(%d %d)", info->buf.dat[info->buf.head], info->buf.raw[info->buf.head]); b_buf_inc(info); return raw; }
static int __init amd_peer_bridge_init(void) { int result; MSG_INFO("init\n"); result = amdkfd_query_rdma_interface(&rdma_interface); if (result < 0) { MSG_ERR("Can not get RDMA Interface (result = %d)\n", result); return result; } strcpy(amd_mem_client.name, AMD_PEER_BRIDGE_DRIVER_NAME); strcpy(amd_mem_client.version, AMD_PEER_BRIDGE_DRIVER_VERSION); ib_reg_handle = ib_register_peer_memory_client(&amd_mem_client, &ib_invalidate_callback); if (!ib_reg_handle) { MSG_ERR("Can not register peer memory client"); return -EINVAL; } return 0; }
// Convert a XSI file into an OBJ file bool CXsiObjConverter::Convert(CFile* pOtherFile, CFile* pObjFile) { // Initialize XSI -> OBJ m_pXsiFile = InitConversion<CXsiFile>(pOtherFile, pObjFile); OBJ_ASSERT(m_pXsiFile && m_pOptions); if(!m_pXsiFile || !m_pOptions) return false; MSG_INFO("Converting XSI file format into OBJ file format..."); ::CSLScene* pScene = m_pXsiFile->GetScene(); OBJ_ASSERT(pScene); if(!pScene) return false; // Look at the scene file informations DotXSILoadFileInfo(pScene); // Load material library CXsiFtkMaterialUtil::DotXSILoadMaterialLibrary(m_pObjFile, pScene); // Start the recursion from the scene's root model DotXSILoadMeshes(pScene->Root()); return true; }
int IMPORT_KERNEL::CHECK_VAR ( QObject * object ) { if ( object EQ m_ui->push_button_dosya_sec ) { QString file_name = ""; file_name = QFileDialog::getOpenFileName(this,tr("Select File"), "", tr("ODS File(*.ods)")); if ( file_name.isEmpty() EQ false ) { ADAK_CURSOR_BUSY(); unzFile hArchive; if( ( hArchive = unzOpen(file_name.toUtf8().data()) ) EQ NULL ){ MSG_INFO(tr("The selected file format is not appropriate!") , this ) ;//Seçilen dosya Formatı uygun değil! ADAK_CURSOR_NORMAL(); return ADAK_FAIL; } ADAK_IMPORT * adak_import = new ADAK_IMPORT(); CHECK_MAX_SIZE_KONTROL( adak_import->IMPORT( file_name , m_ui->comboBox_dosya_encoding->currentText(), m_zorunlu_alanlar.size())); if( m_import_rows.size() EQ 0 ){ m_ui->table_widget_onizleme->clear(); m_kayitlar_onaylandi_mi = false; MSG_INFO(tr("The selected file is empty.") ,this);//Seçilen dosyanın içi boştur ADAK_CURSOR_NORMAL(); return ADAK_FAIL; } m_import_rows.removeFirst(); // ilk satir title m_ui->line_edit_dosya_path->setText( file_name ); if ( ROW_DATA_KONTROL() EQ false ) { m_kayitlar_onaylandi_mi = false; return ADAK_FAIL; } m_kayitlar_onaylandi_mi = true; ONIZLEMEYI_GOSTER(); ADAK_CURSOR_NORMAL(); } } else if ( object EQ m_ui->push_button_gruplar ) { OPEN_GRUP_SECIM(m_program_id,m_modul_id,&m_grup_idleri,DB,this,false); m_ui->text_edit_gruplar->setText(GRP_GRUP_ADLARINI_BUL(&m_grup_idleri,new QStringList(),new QStringList())); } return ADAK_OK; }
/** * \brief Remove storage plugin. * * This function is called when we don't want to use this storage plugin * anymore. All it does is that it cleans up after the storage plugin. * * \param[in] config the plugin specific configuration structure * \return 0 on success, negative value otherwise */ int storage_close(void **config) { MSG_INFO(msg_module, "storage_close called\n"); free(*config); *config = NULL; return 0; }
/** * \brief Main loop */ void PipeListener::loop() { prctl(PR_SET_NAME, "fbitexp:PipeList\0", 0, 0, 0); MSG_DEBUG(msg_module, "started"); while (!_done) { reopenPipe(); while (std::getline(_pipe, _buff)) { MSG_DEBUG(msg_module, "read '%s'", _buff.c_str()); if (!_buff.empty()) { switch(_buff[0]) { case 'r': /* rescan folder */ MSG_INFO(msg_module, "triggered rescan of %s", _buff.substr(1).c_str()); _buff = _buff.substr(1); _scanner->rescan(_buff); break; case 'k': /* Stop daemon */ MSG_INFO(msg_module, "triggered daemon termination"); _done = true; break; case 's': MSG_INFO(msg_module, "setting max. directory size (%s)", _buff.substr(1).c_str()); _scanner->setMaxSize(_buff.substr(1), true); break; case 'w': MSG_INFO(msg_module, "setting lower limit (%s)", _buff.substr(1).c_str()); _scanner->setWatermark(_buff.substr(1)); break; } } if (_done) { break; } } } stopAll(); MSG_DEBUG(msg_module, "closing thread"); _cv->notify_one(); }
int storage_close(void **config) { struct fastbit_config *conf = (struct fastbit_config *) (*config); std::map<std::string, std::map<uint32_t, od_info>*> *od_infos = conf->od_infos; std::map<std::string, std::map<uint32_t, od_info>*>::iterator exporter_it; std::map<uint32_t, od_info>::iterator odid_it; std::map<uint16_t, template_table*> *templates; std::map<uint16_t, template_table*>::iterator table; /* Iterate over all exporters and ODIDs, flush data and release templates */ for (exporter_it = od_infos->begin(); exporter_it != od_infos->end(); ++exporter_it) { for (odid_it = exporter_it->second->begin(); odid_it != exporter_it->second->end(); ++odid_it) { templates = &(odid_it->second.template_info); flush_data(conf, exporter_it->first, odid_it->first, templates); /* Free templates */ for (table = templates->begin(); table != templates->end(); table++) { delete (*table).second; } } delete (*exporter_it).second; } /* Tell index thread to terminate */ terminate = true; pthread_cond_signal(&conf->mutex_cond); MSG_INFO(msg_module, "Waiting for the index thread to finish"); if (pthread_join(conf->index_thread, NULL) != 0) { MSG_ERROR(msg_module, "pthread_join"); } MSG_INFO(msg_module, "Index thread finished"); /* Free config structure */ delete od_infos; delete conf->index_en_id; delete conf->dirs; delete conf; return 0; }
void HATA_ISTEK_BATCH::RUN_BATCH () { QString from = m_ui->line_edit_email->text(); QString subject = QObject::tr ("Bug/Request notification( ") + ADAK_PROGRAM_LONGNAME(ADAK_DISPLAY_ID()) + " " + ADAK_PROGRAM_VERSION(ADAK_DISPLAY_ID()) + " )"; EMAIL_SET_EMAIL_SERVER ("smtp.gmail.com", 587, STARTTLS ); EMAIL_SET_USER_EMAIL_INFO ( "adakerror", "qaz123XSW", "Adak Error Sender", true ); SEND_MAIL ( "*****@*****.**", from, ADAK_PROGRAM_EMAIL(ADAK_DISPLAY_ID()), subject, QString(m_ui->text_edit_hata_istek->toPlainText()), -1 , -1 , "", false); MSG_INFO("Bug / Request form sent.", NULL);//Hata / İstek bilgisi gönderildi. }
// Convert an OBJ file into a W3D file bool CObjW3dConverter::Convert(CFile* pObjFile, CFile* pOtherFile) { // Initialize OBJ -> W3D m_pW3dFile = InitConversion<CW3dFile>(pObjFile, pOtherFile); OBJ_ASSERT(m_pW3dFile && m_pOptions); if(!m_pW3dFile || !m_pOptions) return false; MSG_INFO("Converting OBJ file format into W3D file format..."); return true; }
void GRUP_KERNEL::ADD_ITEM (QObject *button, QStringList column_datas ) { int item_id = -1; if ( button EQ m_ui->push_button_add_alt_grup OR button->metaObject()->className() EQ QAction::staticMetaObject.className()) { if (m_ui->tree_widget->topLevelItemCount() EQ 0) { MSG_INFO(tr("There are not opened main group. Firstly, you must open a group.") , NULL);//Açılmış olan ana grup bulunmamaktadır.Önce ana grup açmalısınız. return; } if (m_ui->tree_widget->currentItem() EQ NULL) { MSG_INFO(tr("You must select a main group for adding sub-group.") , NULL);//Alt grup ekleyebilmek için önce ana grup seçmelisiniz. return; } if ( column_datas.size() EQ 0 ) { return; } item_id = column_datas.at( m_grp_id_column ).toInt(); F_GRUP_KERNEL_GRUP_FISI ( item_id, ENUM_ALT_GRUP, static_cast< BASE_GRUP_KERNEL *>(this) ,this , m_db ); if ( m_grup_satir_guncellendi_mi EQ true ) { RESET_GUI_UPDATE_VALUES(); } REFRESH_TREE_WIDGET(); } else { F_GRUP_KERNEL_GRUP_FISI ( item_id, ENUM_ANA_GRUP, static_cast< BASE_GRUP_KERNEL *>(this) ,this , m_db ); if ( m_grup_satir_eklendi_mi EQ true ) { ADD_PARENT_ITEM ( m_grup_eklenen_kayit, 0 ); RESET_GUI_UPDATE_VALUES(); } REFRESH_TREE_WIDGET(); } }
void ADRES_RAPOR_FILTRESI_BATCH::RUN_BATCH() { switch ( m_adres_rapor_turu ) { case ADRES_ILETISIM_RAPORU : default : if ( RAPOR_VERILERINI_OLUSTUR() EQ false ) { return; } OPEN_REPORT_SHOWER ( OPEN_ADRES_KAYITLARI_RAPORU ( ADRES_ILETISIM_RAPORU, m_adres_kayit_turu, M_ADRES_KAYIT_RAPORU_BILGILERI), nativeParentWidget() ); break; case ADRES_BILGILERI_RAPORU: if ( RAPOR_VERILERINI_OLUSTUR() EQ false ) { return; } OPEN_REPORT_SHOWER ( OPEN_ADRES_KAYITLARI_RAPORU ( ADRES_BILGILERI_RAPORU,m_adres_kayit_turu, M_ADRES_ETIKET_BILGILERI ), nativeParentWidget() ); break; case ADRES_ETIKETLERI_RAPORU : if ( RAPOR_VERILERINI_OLUSTUR() EQ false ) { return; } OPEN_ADRES_ETIKETLERI_BATCH ( M_ADRES_ETIKET_BILGILERI, this ); break; case TOPLU_MAIL_GONDERIMI : if ( RAPOR_VERILERINI_OLUSTUR() EQ false ) { return; } if ( M_TOPLU_MAIL_BILGILERI.isEmpty() EQ true ) { MSG_ERROR ( "E-Posta gönderilebilecek kayıt bulunamadı." , NULL ); return; } OPEN_ADRES_TOPLU_MAIL_GONDERIMI_BATCH ( M_TOPLU_MAIL_BILGILERI, this ); break; case TOPLU_SMS_GONDERIMI: if ( RAPOR_VERILERINI_OLUSTUR() EQ false ) { return; } if ( M_SMS_BILGILERI.isEmpty() EQ true ) { MSG_ERROR ( "SMS gönderilebilecek kayıtlı bir cep telefon bulunamadı." , NULL ); return; } else { MSG_INFO (QString("SMS Gönderilecek Numaralar:\n%1").arg(M_SMS_BILGILERI),NULL); } SHOW_SMS_GUI("",M_SMS_BILGILERI,"",this); break; } }
int CARI_ODEME_CEKSENET_BATCH::CHECK_VAR ( QObject * object ) { if ( object EQ m_ui->pushButton_duzenle ) { if ( m_cek_senet_durumu EQ ENUM_SATICIYA_VERILDI OR m_cek_senet_durumu EQ ENUM_PORTFOYDE ) { OPEN_CEK_SENET_FORMU( m_cek_senet_turu , m_cek_senet_id , this); CEK_SENET_BILGILERINI_GOSTER(); *m_kayit_degisti_mi = true; } else { MSG_INFO(QObject::tr("Çek - Senedin son durumu müşteriye verildi olmadığı için çek-senet bilgilerinde değişiklik yapamazsınız."),NULL); } } return ADAK_OK; }
/** * \brief Load IPFIX elements * * \warning When function fails to load all elements, content of ipfix_group * will not be defined and should be destroyed using elements_destroy(). * \param[in] file_descriptor Opened file with XML specification of IPFIX elems. * \param[out] ipfix_groups Structure with elements description * \return 0 on success. Otherwise returns non-zero value. */ int elements_load(int file_descriptor, struct elem_groups *ipfix_groups) { // Create an iterator over IPFIX elements in XML document struct elem_xml_iter *iter = elem_iter_init(file_descriptor); if (!iter) { // Failed to init iterator return 1; } unsigned int count = 0; bool failed = false; xmlNodePtr node; // Iterate over all elements and fill structures while((node = elem_iter_next(iter)) != NULL) { ipfix_element_t *new_item = parse_element(node); if (!new_item) { // Failed to create new element description failed = true; break; } if (elem_add_element(ipfix_groups, new_item) != 0) { failed = true; break; } ++count; } elem_iter_destroy(iter); if (failed) { return 1; } elem_sort(ipfix_groups); if (elem_make_name_indexes(ipfix_groups)) { return 1; } if (elem_duplication_check(ipfix_groups)) { // Duplication found return 1; } // All elements successfully loaded MSG_INFO(msg_module, "Description of %u IPFIX elements loaded.", count); return 0; }
/** * \brief Creates new Output Manager * * @param[in] plugins_config plugins configurator * @param[in] stat_interval statistics printing interval * @param[in] odid_merge enable single output manager permanently * @param[out] config configuration structure * @return 0 on success, negative value otherwise */ int output_manager_create(configurator *plugins_config, int stat_interval, bool odid_merge, void **config) { conf = calloc(1, sizeof(struct output_manager_config)); if (!conf) { MSG_ERROR(msg_module, "Memory allocation failed (%s:%d)", __FILE__, __LINE__); return -1; } conf->manager_mode = odid_merge ? OM_SINGLE : OM_MULTIPLE; conf->stat_interval = stat_interval; conf->plugins_config = plugins_config; conf->perman_odid_merge = odid_merge; if (conf->manager_mode == OM_SINGLE) { MSG_INFO(msg_module, "Configuring Output Manager in single manager mode"); } else if (conf->manager_mode == OM_MULTIPLE) { MSG_INFO(msg_module, "Configuring Output Manager in multiple manager mode"); } else { /* Unknown mode */ } *config = conf; return 0; }
int FAT_FATURA_LISTESI_BATCH::CHECK_RUN () { if ( E9_MALI_YIL_TARIH_ARALIGI_KONTROLU( m_ui->adakDate_bas_tarihi, m_ui->adakDate_bts_tarihi ) NE ADAK_OK ) { return ADAK_FAIL; } if ( m_ui->checkBox_cari_hesap->isChecked() EQ true ) { if ( m_ui->searchEdit_cari_hesap_kodu->GET_TEXT().isEmpty() EQ true ) { MSG_WARNING( tr("Cari hesap kodunu boş bırakamazsınız."), m_ui->searchEdit_cari_hesap_kodu ); return ADAK_FAIL; } } if ( m_ui->checkBox_fatura_durumu->isChecked() EQ true ) { if ( m_ui->comboBox_irsaliye_durumu->currentIndex() EQ -1 ) { MSG_WARNING( tr("İrsaliye durumunu seçmelisiniz."), m_ui->comboBox_irsaliye_durumu ); return ADAK_FAIL; } } if ( m_ui->checkBox_tutar_araligi->isChecked() EQ true ) { if ( m_ui->commaEdit_min_tutar->GET_TEXT().isEmpty() EQ true OR m_ui->commaEdit_max_tutar->GET_TEXT().isEmpty() EQ true ) { MSG_INFO( tr( "Tutarlar boş bırakılamaz!!!" ), m_ui->commaEdit_min_tutar ); return ADAK_FAIL; } } if ( m_ui->checkBox_fatura_alis_satis_turu->isChecked() EQ true ) { if ( m_ui->comboBox_fatura_alis_satis_turu->currentIndex() EQ -1 ) { MSG_INFO( tr( "Fatura alış / satış türünü seçmelisiniz." ), m_ui->comboBox_fatura_alis_satis_turu ); return ADAK_FAIL; } } return ADAK_OK; }
void IMPORT_KERNEL::RUN_BATCH () { ADAK_CURSOR_BUSY(); M_DB->START_TRANSACTION(); for ( int i = 0 ; i < m_import_rows.size(); i++ ) { IMPORT_ROW( m_import_rows.at(i) ); } M_DB->COMMIT_TRANSACTION(); ADAK_CURSOR_NORMAL(); MSG_INFO(tr("All information transferred. "),NULL);//Tüm bilgiler aktarıldı. }
void FAT_TOPLU_FATURALASTIR_ARAMA::SAVER_BUTTON_CLICKED( QAbstractButton *p_button ) { if ( p_button EQ m_ui->toolButton_faturalastir ) { int secim = MSG_YES_NO( "Faturalandırma İşlemi Başlasın mı ?", NULL ); if ( secim NE ADAK_YES ) { return; } for (int i = 0; i < m_irsaliye_fis_id_list.size(); ++i) { // Irsaliye faturastiriliyor FATURALASTIR( m_irsaliye_fis_id_list.at( i ) ); } MSG_INFO( tr ( "Verilen tarih aralığındaki irsaliyeler toplu olarak faturalaştırıldı."), NULL ); } }
int IMPORT_KERNEL::CHECK_RUN () { if ( m_import_rows.size() EQ 0) { MSG_INFO( tr("No data will be saved") , NULL);//Kaydedilecek veri yok return ADAK_FAIL; } else if( m_kayitlar_onaylandi_mi EQ false ){ MSG_WARNING( tr( "Required fields are left empty ") , this ) ;//Zorunlu Alanlar boş bırakılmış return ADAK_FAIL ; } else { ADAK_MSG_ENUM msg_enum = MSG_YES_NO(tr("All information will be transferred to E9.Continue? "),NULL);//Tüm bilgiler E9 a aktarılacaktır. Devam edilsin mi? if ( msg_enum NE ADAK_YES ) { return ADAK_FAIL; } } return ADAK_OK; }
/** * \brief Input plugin "destructor". * * \param[in,out] config plugin_info structure * \return 0 on success and config is changed to NULL, nonzero else. */ int input_close(void **config) { int ret; struct plugin_conf *conf = (struct plugin_conf*) *config; struct input_info_list *info_list; /* close socket */ int sock = ((struct plugin_conf*) *config)->socket; if ((ret = close(sock)) == -1) { MSG_ERROR(msg_module, "Cannot close socket: %s", strerror(errno)); } /* free input_info list */ while (conf->info_list) { info_list = conf->info_list->next; free(conf->info_list); conf->info_list = info_list; } /* free configuration strings */ if (conf->info.template_life_time != NULL) { free(conf->info.template_life_time); } if (conf->info.template_life_packet != NULL) { free(conf->info.template_life_packet); } if (conf->info.options_template_life_time != NULL) { free(conf->info.options_template_life_time); } if (conf->info.options_template_life_packet != NULL) { free(conf->info.options_template_life_packet); } /* free allocated structures */ free(*config); convert_close(); MSG_INFO(msg_module, "All allocated resources have been freed"); return 0; }
bool CStlReader::Read() { OBJ_ASSERT(m_pStlFile); if(!m_pStlFile) return false; std::string fileName(m_fileName.string()); // Extract native file path string //const int maxline = 1000; //char line[maxline]; MSG_INFO("Reading .STL file '" << fileName << "'."); m_ifs.open(fileName.c_str()); if( !m_ifs.is_open() ) { MSG_ERROR("Couldn't open .STL file '" << fileName << "'"); return true; // There is not stl file } return true; }
int KULLANICILAR_FORMU::LISTEYE_VERITABANI_EKLE() { m_secilen_veritabani_id = VERITABANI_SEC ( -1, NULL, NULL, this ); if ( m_secilen_veritabani_id < 1 ) { return ADAK_RECORD_UNCHANGED; } for ( int i = 0; i < m_ui->table_widget_veritabanlari->rowCount(); i++ ) { int current_veritabani_id = m_ui->table_widget_veritabanlari->item( i, VERITABANI_ID_COLUMN )->text().toInt(); if ( current_veritabani_id NE m_secilen_veritabani_id ) { continue; } MSG_INFO(tr ( "The selected database are already available on line no %n.", "", i + 1 ) , NULL);//Seçilen veritabanı %n nolu satırda zaten mevcut. return ADAK_RECORD_UNCHANGED; } SQL_QUERY sql_query ( G_YONETIM_DB ); sql_query.PREPARE_SELECT ( "ynt_veritabanlari","veritabani_id, veritabani_ismi, veritabani_tanimi","veritabani_id = :veritabani_id ",""); sql_query.SET_VALUE ( ":veritabani_id", m_secilen_veritabani_id ); if ( sql_query.SELECT() EQ 0 ) { return ADAK_RECORD_UNCHANGED; } sql_query.NEXT(); int new_row_num = m_ui->table_widget_veritabanlari->rowCount(); m_ui->table_widget_veritabanlari->insertRow ( new_row_num ); m_ui->table_widget_veritabanlari->setItem ( new_row_num, VERITABANI_ID_COLUMN , new QTableWidgetItem ( QVariant(m_secilen_veritabani_id).toString() ) ); m_ui->table_widget_veritabanlari->setItem ( new_row_num, VERITABANI_COLUMN , new QTableWidgetItem ( sql_query.VALUE(1).toString() ) ); m_ui->table_widget_veritabanlari->setItem ( new_row_num, VERITABANI_TANIMI_COLUMN , new QTableWidgetItem ( sql_query.VALUE(2).toString() ) ); return ADAK_RECORD_CHANGED; }
void SQL_TABLOLAR_FISI::SAVER_BUTTON_CLICKED( QAbstractButton * p_button, int p_tablo_id ) { if ( p_button EQ m_ui->button_indexler ) { if ( p_tablo_id < 1 ) { return; } OPEN_INDEX_BATCH ( p_tablo_id, this ); } else if ( p_button EQ m_ui->button_header_olustur ) { SQL_QUERY sql_query ( DB ); sql_query.PREPARE_SELECT( "sql_tablolar","tablo_id"); if ( sql_query.SELECT() EQ 0 ) { MSG_ERROR(tr("Header file hasn't been created, because no registered table."),m_ui->lineEdit_tablo_adi);//Kayıtlı tablo olmadığından herhangi bir header dosyası yaratılmadı return; } if ( HEADER_DOSYASI_YARAT(this) EQ true ) { MSG_INFO(tr ("Header file has been successfully created."),m_ui->lineEdit_tablo_adi);//Header dosyası başarıyla yaratıldı return; } MSG_ERROR(tr ("File has not been created."),m_ui->lineEdit_tablo_adi);//Dosya yaratılmadı. } }
int KULLANICILAR_FORMU::CHECK_DELETE ( int kullanici_id ) { if ( kullanici_id EQ 1 ) { MSG_INFO(tr("Admin user can not be deleted!"),m_ui->limitedTextEdit_not);//Yönetici kullanıcısı silinemez! return ADAK_FAIL; } if ( m_ui->lineEdit_kullanici_kodu->text() EQ KULLANICI_KODU() ) { MSG_WARNING( tr("You can not delete that login is made!"), NULL );//Giriş yapmış olduğunuz kullanıcıyı silemezsiniz. return ADAK_FAIL; } SQL_QUERY query( G_YONETIM_DB ); query.PREPARE_SELECT( "ynt_kullanicilar", "kullanici_id", ""); int kullanici_sayisi = query.SELECT(); if ( kullanici_sayisi EQ 2 ) { MSG_WARNING( tr("The remaining single-user the system, you can not delete!"), NULL );//Sistemde Kalan Tek Kullanıcı, Silemezsiniz. return ADAK_FAIL; } return ADAK_OK; }