当前位置: 首页>>代码示例>>C++>>正文


C++ qeo_log_e函数代码示例

本文整理汇总了C++中qeo_log_e函数的典型用法代码示例。如果您正苦于以下问题:C++ qeo_log_e函数的具体用法?C++ qeo_log_e怎么用?C++ qeo_log_e使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了qeo_log_e函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fwd_server_register

static qeo_retcode_t fwd_server_register(qeo_factory_t *factory)
{
    qeo_retcode_t             rc = QEO_OK;

    if (!qeocore_parameter_get_number("FWD_DISABLE_LOCATION_SERVICE")) {
        qeo_security_hndl         qeo_sec = factory->qeo_sec;
        qeo_mgmt_client_retcode_t mgmt_rc = QMGMTCLIENT_EFAIL;
        qeo_mgmt_client_ctx_t     *mgmt_client_ctx = NULL;
        qeo_mgmt_client_locator_t locator={QMGMT_LOCATORTYPE_TCPV4, factory->fwd.locator->address, factory->fwd.locator->port};
        int                       nrOfLocators = 1;

        do {
            if ((rc = qeo_security_get_mgmt_client_ctx(qeo_sec, &mgmt_client_ctx)) != QEO_OK) {
                qeo_log_e("register_forwarder get security mgmt client failed (rc=%d)", rc);
                break;
            }
            /* Now register the forwarder. */
            qeo_log_i("register the forwarder with locator address %s:port %d\n", locator.address, locator.port);
            if ((mgmt_rc = qeo_mgmt_client_register_forwarder(mgmt_client_ctx,
                                                              factory->qeo_id.url,
                                                              &locator,
                                                              nrOfLocators,
                                                              ssl_ctx_cb,
                                                              qeo_sec)) != QMGMTCLIENT_OK) {
                qeo_log_e("register forwarder failed (rc=%d)", mgmt_rc);
                rc = QEO_EFAIL;
                break;
            }

        } while (0);
    }
    return rc;
}
开发者ID:FlavioFalcao,项目名称:tinq-core,代码行数:33,代码来源:forwarder.c

示例2: on_qeocore_on_factory_init_done

static void on_qeocore_on_factory_init_done(qeo_factory_t *factory, bool success)
{
    uintptr_t                   puserdata = 0;
    factory_dispatcher_cookie   *dc       = NULL;
    qeo_json_factory_listener_t *listener = NULL;

    do {
        if ((qeocore_factory_get_user_data(factory, &puserdata)) != QEO_OK) {
            qeo_log_e("qeocore_factory_get_user_data failed");
            return;
        }

        dc = (factory_dispatcher_cookie *)puserdata;
        if (dc == NULL) {
            qeo_log_e("dc == NULL");
            return;
        }

        listener = (qeo_json_factory_listener_t *)dc->listener;
        if (listener == NULL) {
            qeo_log_e("listener == NULL");
            return;
        }

        if (success) {
            listener->on_factory_init_done(factory, dc->userdata);
        }
        else {
            listener->on_factory_init_done(NULL, dc->userdata);
            qeocore_factory_close(factory);
            free(dc);
        }
    } while (0);
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:34,代码来源:qeo_json.c

示例3: get_qeo_dir

static char* get_qeo_dir(void)
{
    char *qeo_dir = NULL;
    const struct passwd *pwd;

    do {
        qeo_dir = qeo_strdup_ret(getenv("QEO_STORAGE_DIR"));
        if (qeo_dir != NULL){
            break;
        }
        
        pwd = getpwuid(getuid());
        if (pwd == NULL || pwd->pw_dir == NULL) {
            qeo_log_e("Failed in getting the home directory");
            break;
        }

        if (asprintf(&qeo_dir, "%s/%s", pwd->pw_dir, LINUX_STORAGE_DIR) == -1){
            qeo_log_e("No mem");
            break;
        }

    } while(0);

    qeo_log_i("Qeo directory is %s", qeo_dir);

    return (char*)qeo_dir;
}
开发者ID:GerardoPardo,项目名称:tinq-core,代码行数:28,代码来源:linux_default_device.c

示例4: remote_registration

static qeo_util_retcode_t remote_registration(qeo_platform_security_context_t context,
                                                                    const char *rrf){
    qeo_util_retcode_t ret = QEO_UTIL_EFAIL;
    FILE *f = NULL;

    do {
        char suggested_username[64];
        unsigned long registration_window;
        /* file/fifo should be created in advance */
        if ((f = fopen(rrf, "r")) == NULL){
            qeo_log_e("Could not open remote registration file for reading");
            break;
        }

        if (fscanf(f, "%63s %lu", suggested_username, &registration_window) != 2){
            qeo_log_e("Could not read from remote_registration file");
            break;
        }
    
        ret = qeo_platform_set_remote_registration_params(context, suggested_username, registration_window);

    } while (0);

    if (f != NULL){
        fclose(f);
    }

    return ret;
}
开发者ID:GerardoPardo,项目名称:tinq-core,代码行数:29,代码来源:default_impl.c

示例5: fwd_server_unregister

static qeo_retcode_t fwd_server_unregister(qeo_factory_t *factory)
{
    qeo_retcode_t             rc = QEO_OK;

    if (!qeocore_parameter_get_number("FWD_DISABLE_LOCATION_SERVICE")) {
        qeo_security_hndl         qeo_sec = factory->qeo_sec;
        qeo_mgmt_client_retcode_t mgmt_rc = QMGMTCLIENT_EFAIL;
        qeo_mgmt_client_ctx_t     *mgmt_client_ctx = NULL;
        int                       nrOfLocators = 0;


        do {
            if (QEO_OK != (rc = qeo_security_get_mgmt_client_ctx(qeo_sec, &mgmt_client_ctx))) {
                qeo_log_e("unregister_forwarder get security mgmt client failed (rc=%d)", rc);
                break;
            }

            /* Now register the forwarder. */
            qeo_log_i("unregister the forwarder");
            if ((mgmt_rc = qeo_mgmt_client_register_forwarder(mgmt_client_ctx,
                                                              factory->qeo_id.url,
                                                              NULL,
                                                              nrOfLocators,
                                                              ssl_ctx_cb,
                                                              qeo_sec)) != QMGMTCLIENT_OK) {
                qeo_log_e("unregister forwarder failed (rc=%d)", mgmt_rc);
                rc = QEO_EFAIL;
                break;
            }

        } while (0);
    }
    return rc;
}
开发者ID:FlavioFalcao,项目名称:tinq-core,代码行数:34,代码来源:forwarder.c

示例6: get_uuid

static char* get_uuid(const char* path)
{
    if (path == NULL )
        return strdup("");
    FILE* file = NULL;

    char temp[128]; /* e9cabebc-923b-4932-a534-9578a6904bf8 */
    char* result = NULL;

    file = fopen(path, "rb");
    if (file == NULL ) {
        qeo_log_e("Could not open file: %s", path);
        return strdup("");
    }

    if (fgets(temp, sizeof(temp), file) == NULL){
        fclose(file);
        qeo_log_e("Could not get UUID");
        return strdup("");
    }
    fclose(file);
    result = strdup(temp);
    if (result == NULL ) {
        qeo_log_e("Could not allocate memory..");
        return strdup("");
    }

    return result;
}
开发者ID:GerardoPardo,项目名称:tinq-core,代码行数:29,代码来源:linux_default_device.c

示例7: dump_openssl_error_stack

void dump_openssl_error_stack(const char *msg)
{
    unsigned long err;
    const char    *file, *data;
    int           line, flags;
    char          buf[256];

    qeo_log_e("%s", msg);
    while ((err = ERR_get_error_line_data(&file, &line, &data, &flags))) {
        qeo_log_e("err %lu @ %s:%d -- %s\n", err, file, line, ERR_error_string(err, buf));
    }

    ERR_clear_error();
}
开发者ID:FlavioFalcao,项目名称:tinq-core,代码行数:14,代码来源:security_util.c

示例8: qeojson_writer_open

qeo_json_state_writer_t *qeo_json_factory_create_state_writer(const qeo_factory_t                     *factory,
                                                              const char                              *json_type,
                                                              const qeo_json_state_writer_listener_t  *listener,
                                                              uintptr_t                               userdata)
{
    qeo_json_state_writer_t *writer     = NULL;
    qeojson_writer_t        *jsonwriter = NULL;

    if ((NULL == factory) || (json_type == NULL)) {
        return NULL;
    }

    do {
        jsonwriter = qeojson_writer_open(
            factory,
            QEOJSON_WRITER_TYPE_STATE_WRITER,
            (void *) listener,
            json_type,
            userdata);

        if (jsonwriter == NULL) {
            qeo_log_e("qeojson_writer_open failed");
            break;
        }

        writer = (qeo_json_state_writer_t *) jsonwriter;
    } while (0);

    return writer;
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:30,代码来源:qeo_json.c

示例9: qeo_json_state_change_reader_policy_update

qeo_retcode_t qeo_json_state_change_reader_policy_update(const qeo_json_state_change_reader_t *reader, const char *json_policy)
{
    qeo_retcode_t     rc          = QEO_EINVAL;
    qeojson_reader_t  *jsonreader = (qeojson_reader_t *) reader;

    if (NULL == reader) {
        return rc;
    }

    do {
        if (NULL != json_policy) {
            qeojson_policy_lock(&jsonreader->policy_mutex);
            rc = qeojson_policy_update(jsonreader->policy_cache, json_policy);
            qeojson_policy_unlock(&jsonreader->policy_mutex);
            if (rc != QEO_OK) {
                qeo_log_e("qeojson_policy_update failed");
                break;
            }
        }

        rc = qeocore_reader_policy_update(jsonreader->reader);
    } while (0);

    return rc;
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:25,代码来源:qeo_json.c

示例10: qeojson_reader_open

qeo_json_state_change_reader_t *qeo_json_factory_create_state_change_reader(const qeo_factory_t                           *factory,
                                                                            const char                                    *json_type,
                                                                            const qeo_json_state_change_reader_listener_t *listener,
                                                                            uintptr_t                                     userdata)
{
    qeo_json_state_change_reader_t  *reader     = NULL;
    qeojson_reader_t                *jsonreader = NULL;

    if ((NULL == json_type) || (NULL == factory) || (NULL == listener) ||
        ((NULL == listener->on_data) && (NULL == listener->on_remove))) {
        return NULL;
    }

    do {
        jsonreader = qeojson_reader_open(
            factory,
            QEOJSON_READER_TYPE_STATE_CHANGE_READER,
            (void *) listener,
            json_type,
            userdata);

        if (jsonreader == NULL) {
            qeo_log_e("qeojson_reader_open failed");
            break;
        }

        reader = (qeo_json_state_change_reader_t *) jsonreader;
    } while (0);

    return reader;
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:31,代码来源:qeo_json.c

示例11: on_di_data_available

static void on_di_data_available(const qeocore_reader_t *reader,
                                            const qeocore_data_t *data,
                                            uintptr_t userdata){

    
    qeo_retcode_t ret = QEO_OK;
    switch (qeocore_data_get_status(data)) {
        case QEOCORE_NOTIFY:
            qeo_log_d("Notify received");
            break;
        case QEOCORE_DATA:
            qeo_log_d("Data received");
            ret = qeo_walk_tsm_for_unmarshal(_types, org_qeo_system_DeviceInfo_type, data, (uintptr_t)&_rcvd_di, QEO_T2D_FLAGS_ALL, &_di_ucbs);
            break;
        case QEOCORE_NO_MORE_DATA:
            qeo_log_d("No more data received");
            break;
        case QEOCORE_REMOVE:
            qeo_log_d("remove received");
            break;
        case QEOCORE_ERROR:
            qeo_log_e("no callback called due to prior error");
            break;
    }
    ck_assert_int_eq(ret, QEO_OK);

}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:27,代码来源:test.c

示例12: simplechat_ChatMessage_get_val_cb

static bool simplechat_ChatMessage_get_val_cb(uintptr_t in_data, const char *name, CDR_TypeCode_t type, qeo_t2d_types_t *value){

    const org_qeo_sample_simplechat_ChatMessage_t *chat_msg = (const org_qeo_sample_simplechat_ChatMessage_t *)in_data;
    if (strcmp(name, "from") == 0){
        value->string_val = chat_msg->from;
    } else if (strcmp(name, "fromExtra") == 0){
        value->typeref.ref = (uintptr_t)&chat_msg->fromExtra;
        value->typeref.mcbs = &_uuid_mcbs;
    } else if (strcmp(name, "message") == 0){
        value->string_val = chat_msg->message;
    } else if (strcmp(name, "extraInfo") == 0){
        value->seq.seq_ref = (uintptr_t)&chat_msg->extraInfo;
        value->seq.seq_size = DDS_SEQ_LENGTH(chat_msg->extraInfo);
        value->seq.mcbs = &_sc_extraInfo_mcbs;
    } else if (strcmp(name, "list") == 0){
        value->seq.seq_ref = (uintptr_t)&chat_msg->list;
        value->seq.seq_size = DDS_SEQ_LENGTH(chat_msg->list);
        value->seq.mcbs = &_sc_list_mcbs;
    } else if (strcmp(name, "maincolor") == 0){
        ck_assert_int_eq(type, CDR_TYPECODE_ENUM);
        value->enum_val = chat_msg->maincolor;
    } else if (strcmp(name, "colorlist") == 0){
        ck_assert_int_eq(type, CDR_TYPECODE_SEQUENCE);
        value->seq.seq_ref = (uintptr_t)&chat_msg->colorlist;
        value->seq.seq_size = DDS_SEQ_LENGTH(chat_msg->colorlist);
        value->seq.mcbs = &_sc_colorlist_mcbs;

    } else {
        qeo_log_e("unknown field %s", name);
        return false;
    }

    return true;
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:34,代码来源:test.c

示例13: qeo_log_e

/**
 * This function assigns to each of the passed in qeo_platform_device_info struct constituents the respective
 * information fetched somehow, mainly with qeo_get_linux_dev_prop.
 * */
const qeo_platform_device_info *get_default_device_info(void)
{
    char* path = NULL;

    if (_init == true) {
        return &_default_device_info;
    }

    if ((asprintf(&path, "%s/%s", get_default_device_storage_path(), LINUX_UUID_STORAGE_FILE) < 0)
            || (path == NULL )) {

        qeo_log_e("Failed to allocate memory for the UUID storage path string !");

        return NULL;

    }
    _default_device_info.qeoDeviceId = qeo_get_device_uuid(path, UUID_GENERATOR);

    _default_device_info.manufacturer = qeo_get_linux_dev_prop(LINUX_MANUFACTURER);
    _default_device_info.modelName = qeo_get_linux_dev_prop(LINUX_MODEL_NAME);
    _default_device_info.productClass = qeo_get_linux_dev_prop(LINUX_PRODUCT_CLASS);
    _default_device_info.hardwareVersion = qeo_get_linux_dev_prop(LINUX_HW_VERSION);
    _default_device_info.softwareVersion = qeo_get_linux_dev_prop(LINUX_SW_VERSION);
    _default_device_info.userFriendlyName = qeo_get_linux_dev_prop(LINUX_USER_FRIENDLY_NAME);
    _default_device_info.serialNumber = qeo_get_linux_dev_prop(LINUX_SERIAL_NUMBER);
    _default_device_info.configURL = qeo_get_linux_dev_prop(LINUX_CONFIG_URL);

    _init = true;

    free(path);

    return &_default_device_info;
}
开发者ID:GerardoPardo,项目名称:tinq-core,代码行数:37,代码来源:linux_default_device.c

示例14: deviceinfo_get_val_cb

/*#######################################################################
 # DeviceInfo
 ########################################################################*/
static bool deviceinfo_get_val_cb(uintptr_t in_data, const char *name, CDR_TypeCode_t type, qeo_t2d_types_t *value){

    const org_qeo_system_DeviceInfo_t *di = (const org_qeo_system_DeviceInfo_t *)in_data;
    if (strcmp(name, "deviceId") == 0){
        value->typeref.ref = (uintptr_t)&di->deviceId;
        value->typeref.mcbs = &_deviceid_mcbs;
    } else if (strcmp(name, "manufacturer") == 0){
        value->string_val = di->manufacturer;
    } else if (strcmp(name, "modelName") == 0){
        value->string_val = di->modelName;
    } else if (strcmp(name, "productClass") == 0){
        value->string_val = di->productClass;
    }
     else if (strcmp(name, "serialNumber") == 0){
        value->string_val = di->serialNumber;
    }
     else if (strcmp(name, "hardwareVersion") == 0){
        value->string_val = di->hardwareVersion;
    }
     else if (strcmp(name, "softwareVersion") == 0){
        value->string_val = di->softwareVersion;
    }
     else if (strcmp(name, "userFriendlyName") == 0){
        value->string_val = di->userFriendlyName;
    } else if (strcmp(name, "configURL") == 0){
        value->string_val = di->configURL;
    } else {
        qeo_log_e("unknown field %s", name);
        return false;
    }

    return true;
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:36,代码来源:test.c

示例15: fwd_destroy

void fwd_destroy(qeo_factory_t *factory)
{
    lock(&factory->mutex);
    if (true == factory->fwd.rqst_pending) {
        /* Wait untill the fwd request is finished before continuing. */
        qeo_log_i("waiting for the fwd request to finish.");
        pthread_cond_wait(&factory->fwd.wait_rqst_finished, &factory->mutex);
    }
    unlock(&factory->mutex);
    if (factory->flags.is_forwarder) {
        fwd_server_unregister(factory);
        if (FWD_STATE_ENABLED == factory->fwd.u.server.state) {
            if (QEO_OK != fwd_server_instance_remove(factory)) {
                qeo_log_e("failed to remove instance from forwarder topic");
            }
        }
        if (NULL != factory->fwd.u.server.writer) {
            qeocore_writer_close(factory->fwd.u.server.writer);
        }
    }
    if (NULL != factory->fwd.reader) {
        qeocore_reader_close(factory->fwd.reader);
    }
    if (NULL != factory->fwd.timer) {
        DDS_Timer_delete(factory->fwd.timer);
    }
    pthread_cond_destroy(&factory->fwd.wait_rqst_finished);
    fwd_locator_destroy(factory);
}
开发者ID:GerardoPardo,项目名称:tinq-core,代码行数:29,代码来源:forwarder.c


注:本文中的qeo_log_e函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。