src/handler/lib/policy.c
/**
 * Pushes a node onto the stack. Returns 0 on success, -1 if the stack is exhausted.
 */
Pushes a node onto the stack. Returns 0 on success, -1 if the stack is exhausted.
Pushes a node onto the stack . Returns 0 on success - 1 if the stack is exhausted .
static int state_stack_push(policy_parser_state_t *state, policy_node_t *policy_node) {
    ++state->node_stack_eos;
    if (state->node_stack_eos >= MAX_POLICY_DEPTH) {
        return -1;
    }
    policy_parser_node_state_t *node = &state->nodes[state->node_stack_eos];
    cx_sha256_init(&state->hash_context);
    node->policy_node = policy_node;
    node->step = 0;
    node->mode = MODE_OUT_HASH;
    node->hash_context = &state->hash_context;
    return 0;
}
static int state_stack_push ( policy_parser_state_t * state , policy_node_t * policy_node ) { ++ state -> node_stack_eos ; if ( state -> node_stack_eos >= MAX_POLICY_DEPTH ) { return -1 ; } policy_parser_node_state_t * node = & state -> nodes [ state -> node_stack_eos ] ; cx_sha256_init ( & state -> hash_context ) ; node -> policy_node = policy_node ; node -> step = 0 ; node -> mode = MODE_OUT_HASH ; node -> hash_context = & state -> hash_context ; return 0 ; }
Pushes a node onto the stack.
Pushes a node onto the stack .