Lines Matching defs:state

994 /* Reusable lookup state object. It is easy to pass to functions and
1025 lookup_state_t *state = apr_pcalloc(result_pool, sizeof(*state));
1027 state->next = apr_array_make(result_pool, 4, sizeof(node_t *));
1028 state->current = apr_array_make(result_pool, 4, sizeof(node_t *));
1036 state->scratch_pad = svn_stringbuf_create_ensure(200, result_pool);
1040 state->parent_path = svn_stringbuf_create_ensure(200, result_pool);
1042 return state;
1050 init_lockup_state(lookup_state_t *state,
1055 if ( (len > state->parent_path->len)
1056 && state->parent_path->len
1057 && (path[state->parent_path->len] == '/')
1058 && !memcmp(path, state->parent_path->data, state->parent_path->len))
1063 state->rights = state->parent_rights;
1066 return path + state->parent_path->len;
1070 state->rights = root->rights;
1071 state->parent_rights = root->rights;
1073 apr_array_clear(state->next);
1074 apr_array_clear(state->current);
1075 APR_ARRAY_PUSH(state->current, node_t *) = root;
1083 combine_access(&state->rights, &node->rights);
1084 combine_right_limits(&state->rights, &node->rights);
1085 APR_ARRAY_PUSH(state->current, node_t *) = node;
1088 svn_stringbuf_setempty(state->parent_path);
1089 svn_stringbuf_setempty(state->scratch_pad);
1099 add_next_node(lookup_state_t *state,
1109 combine_access(&state->rights, &node->rights);
1115 combine_right_limits(&state->rights, &node->rights);
1118 APR_ARRAY_PUSH(state->next, node_t *) = node;
1127 combine_access(&state->rights, &node->rights);
1128 combine_right_limits(&state->rights, &node->rights);
1129 APR_ARRAY_PUSH(state->next, node_t *) = node;
1137 add_if_prefix_matches(lookup_state_t *state,
1144 add_next_node(state, node);
1150 add_prefix_matches(lookup_state_t *state,
1162 add_if_prefix_matches(state,
1176 add_if_prefix_matches(state, pattern, segment);
1185 add_complex_matches(lookup_state_t *state,
1194 add_next_node(state, node);
1257 lookup(lookup_state_t *state,
1265 svn_stringbuf_ensure(state->scratch_pad, path_len);
1284 while (state->current->nelts && path)
1288 svn_stringbuf_t *segment = state->scratch_pad;
1291 if ((state->rights.max_rights & required) != required)
1295 if ((state->rights.min_rights & required) == required)
1301 /* Initial state for this segment. */
1302 apr_array_clear(state->next);
1303 state->rights.access.sequence_number = NO_SEQUENCE_NUMBER;
1304 state->rights.access.rights = authz_access_none;
1308 * state->access.sequence_number remains unchanged and we will use
1310 state->rights.min_rights = authz_access_write;
1311 state->rights.max_rights = authz_access_none;
1318 svn_stringbuf_appendbyte(state->parent_path, '/');
1319 svn_stringbuf_appendbytes(state->parent_path, segment->data,
1324 for (i = 0; i < state->current->nelts; ++i)
1326 node_t *node = APR_ARRAY_IDX(state->current, i, node_t *);
1328 add_next_node(state, apr_hash_get(node->sub_nodes, segment->data,
1334 add_next_node(state, node->pattern_sub_nodes->any);
1339 add_next_node(state, node);
1343 add_prefix_matches(state, segment,
1347 add_complex_matches(state, segment,
1356 add_prefix_matches(state, segment,
1365 if (!has_local_rule(&state->rights))
1367 state->rights.access = state->parent_rights.access;
1368 state->rights.min_rights &= state->parent_rights.access.rights;
1369 state->rights.max_rights |= state->parent_rights.access.rights;
1380 temp = state->current;
1381 state->current = state->next;
1382 state->next = temp;
1385 state->parent_rights = state->rights;
1394 return (state->rights.min_rights & required) == required;
1397 return (state->rights.access.rights & required) == required;
1426 /* Reusable lookup state instance. */