Esempio n. 1
0
/* Push a binary property to stack.  */
int col_push_binary_property(struct collection_item *stack,
                             const char *property,
                             void *binary_data,
                             int length)
{
    int error = EOK;

    TRACE_FLOW_STRING("col_push_binary_property", "Entry point.");

    /* Check that stack is not empty */
    if (stack == NULL) {
        TRACE_ERROR_STRING("Stack can't be NULL", "");
        return EINVAL;
    }

    /* Make sure it is a stack */
    if (!col_is_of_class(stack, COL_CLASS_STACK)) {
        TRACE_ERROR_STRING("Wrong class", "");
        return EINVAL;
    }

    error = col_add_binary_property(stack, NULL, property, binary_data, length);

    TRACE_FLOW_STRING("col_push_binary_property", "Exit.");
    return error;
}
Esempio n. 2
0
static int save_error(struct collection_item *el,
                      unsigned line,
                      int inerr,
                      const char *err_txt)
{
    int error = EOK;
    struct ini_parse_error pe;

    TRACE_FLOW_ENTRY();

    /* Clear the warning bit */
    pe.error = inerr;
    pe.line = line;
    error = col_add_binary_property(el, NULL,
                                    err_txt, &pe, sizeof(pe));
    TRACE_FLOW_RETURN(error);
    return error;
}