• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ qeo_log_e函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: object_add_member

static qeo_retcode_t object_add_member(const qeo_factory_t *factory, qeocore_type_t *type, const char *member_name, json_t *member)
{
    qeo_retcode_t       result        = QEO_EFAIL;
    qeocore_type_t      *qeoType      = NULL;
    qeocore_member_id_t qeo_member_id = QEOCORE_MEMBER_ID_DEFAULT;
    json_t              *member_key   = json_object_get(member, KEY_KEY); // optional  => BOOLEAN
    json_t              *member_id    = json_object_get(member, KEY_ID);  // optional  => INTxx

    assert(factory != NULL);

    if (((NULL != member_key) && !json_is_boolean(member_key)) ||
        ((NULL != member_id) && !json_is_integer(member_id)) ||
        (NULL == member_name)) {
        // syntax error
        return QEO_EINVAL;
    }

    qeo_log_d("Processing %s", member_name);
    qeoType = build_member_type(factory, member);
    if (NULL == qeoType) {
        qeo_log_e("Could not build member_type");
        return result;
    }

    bool is_key = (member_key && json_is_true(member_key));
    do {
        result = qeocore_type_struct_add(type,                            // container
                qeoType,                         // new member to add
                member_name,                     // name of member
                &qeo_member_id,                  // member id
                is_key ? QEOCORE_FLAG_KEY : 0);  // flag
        if (QEO_OK != result) {
            qeo_log_e("qeocore_type_struct_add failed for member %s", member_name);
            break;
        }

        qeocore_type_free(qeoType);

        // Modify the json member to add/update the qeo member id
        json_object_set_new(member, KEY_ID, json_integer(qeo_member_id));
    } while (0);


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


示例17: fwd_get_list

static qeo_retcode_t fwd_get_list(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;

        do {
            if ((rc = qeo_security_get_mgmt_client_ctx(qeo_sec, &mgmt_client_ctx)) != QEO_OK) {
                qeo_log_e("get_forwarders get security mgmt client failed (rc=%d)", rc);
                break;
            }
            /* Factory is already locked when calling this function. */
            if (true == factory->fwd.rqst_pending) {
                /* Just break, we will retry later. */
                qeo_log_i("no need to send request (previous fwd request still ongoing)");
                break;
            }

            /* Now get the list of forwarders. */
            factory->fwd.rqst_pending = true;
            mgmt_rc = qeo_mgmt_client_get_forwarders(mgmt_client_ctx, factory->qeo_id.url, forwarder_cb, result_cb,
                                                     factory, ssl_ctx_cb, qeo_sec);
            if (mgmt_rc == QMGMTCLIENT_OK) {
                qeo_log_d("get_forwarders succeeded");
            } else {
                factory->fwd.rqst_pending = false; /* result callback will not be called. */
                if ((mgmt_rc == QMGMTCLIENT_ESSL) || (mgmt_rc == QMGMTCLIENT_ENOTALLOWED)) {
                    qeo_log_e("get_forwarders failed (rc=%d), aborting", mgmt_rc);
                    rc = QEO_EFAIL;
                    break;
                }
                else {
                    qeo_log_e("get_forwarders failed (rc=%d), ignoring", mgmt_rc);
                }
            }

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


示例18: qeo_get_device_uuid

static qeo_platform_device_id qeo_get_device_uuid(const char* platform_storage_filepath, const char* generator_path)
{
    FILE* file = NULL;
    char* result_uuid = NULL;

    do {
        file = fopen(platform_storage_filepath, "r");
        if (file != NULL ) {
            fclose(file);
            qeo_log_i("Fetching the existing UUID");
            result_uuid = get_uuid(platform_storage_filepath);
            break;
        }

        qeo_log_i("Creating a new UUID, because %s not found", platform_storage_filepath);

        result_uuid = get_uuid(generator_path);
        if (NULL == result_uuid) {
            qeo_log_e("Failed to get UUID");
            break;
        }

        FILE* fp = fopen(platform_storage_filepath, "w");

        if (fp != NULL ) {
            qeo_log_i("Writing the new UUID");
            fprintf(fp, "%s", result_uuid);
            fclose(fp);
        }
        else {
            qeo_log_e("Failed to open %s", platform_storage_filepath);
        }
    } while (0);

    qeo_platform_device_id res = char_to_struct(result_uuid);

    free(result_uuid);

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


示例19: qeo_strdup_ret

char* qeo_strdup_ret(const char* ret_str)
{
    char *ret = NULL;

    if (ret_str) {

        if ((ret = strdup(ret_str)) == NULL ) {
            qeo_log_e("Failed to duplicate string");
        }
    }

    return ret;
}
开发者ID:roelcoomans,项目名称:qeo-core,代码行数:13,代码来源:common.c


示例20: object_to_data

static qeo_retcode_t object_to_data(const json_t *typedesc, json_t *json_data, qeocore_data_t *data)
{
    qeo_retcode_t result = QEO_OK;

    json_t *properties = json_object_get(typedesc, KEY_PROPERTIES);

    if ((NULL != properties) && (json_is_object(properties))) {
        const char  *prop_name  = NULL;
        json_t      *prop_value = NULL;
        void        *iter       = json_object_iter(properties);
        while (iter) {
            // Get type name and value
            prop_name   = json_object_iter_key(iter);
            prop_value  = json_object_iter_value(iter);

            if ((NULL == prop_value) || (!json_is_object(prop_value))) {
                result = QEO_EFAIL;
                break;
            }

            // Get the corresponding value from the json_data
            json_t *value = json_object_get(json_data, prop_name);
            if (NULL == value) {
                qeo_log_e("json_object_get failed for property: %s", prop_name);
                result = QEO_EFAIL;
                break;
            }

            if (QEO_OK != member_to_data(prop_value, value, data)) {
                qeo_log_e("member_to_data failed for property: %s", prop_name);
                result = QEO_EFAIL;
                break;
            }

            iter = json_object_iter_next(properties, iter);
        }
    }
    return result;
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:39,代码来源:json_types_util.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ qfu函数代码示例发布时间:2022-05-30
下一篇:
C++ qemu_vfree函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap