MCPcopy Create free account
hub / github.com/git/git / __attribute

Function __attribute

compat/regex/regexec.c:1034–1065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1032
1033/* Acquire an initial state and return it.
1034 We must select appropriate initial state depending on the context,
1035 since initial states may have constraints like "\<", "^", etc.. */
1036
1037static inline re_dfastate_t *
1038__attribute ((always_inline)) internal_function
1039acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx,
1040 int idx)
1041{
1042 const re_dfa_t *const dfa = mctx->dfa;
1043 if (dfa->init_state->has_constraint)
1044 {
1045 unsigned int context;
1046 context = re_string_context_at (&mctx->input, idx - 1, mctx->eflags);
1047 if (IS_WORD_CONTEXT (context))
1048 return dfa->init_state_word;
1049 else if (IS_ORDINARY_CONTEXT (context))
1050 return dfa->init_state;
1051 else if (IS_BEGBUF_CONTEXT (context) && IS_NEWLINE_CONTEXT (context))
1052 return dfa->init_state_begbuf;
1053 else if (IS_NEWLINE_CONTEXT (context))
1054 return dfa->init_state_nl;
1055 else if (IS_BEGBUF_CONTEXT (context))
1056 {
1057 /* It is relatively rare case, then calculate on demand. */
1058 return re_acquire_state_context (err, dfa,
1059 dfa->init_state->entrance_nodes,
1060 context);
1061 }
1062 else
1063 /* Must not happen? */
1064 return dfa->init_state;
1065 }
1066 else
1067 return dfa->init_state;
1068}

Callers

nothing calls this directly

Calls 2

re_string_context_atFunction · 0.85
re_acquire_state_contextFunction · 0.85

Tested by

no test coverage detected