MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / implicit_name

Function implicit_name

src/common/utils.cpp:214–230  ·  view source on GitHub ↗

i m p l i c i t _ n a m e Determines if a name is of the form prefix [ ] where prefix has a fixed known length.

Source from the content-addressed store, hash-verified

212// Determines if a name is of the form prefix<n[...n]>[<spaces>]
213// where prefix has a fixed known length.
214bool implicit_name(const char* name, const char* prefix, int prefix_len)
215{
216 if (strncmp(name, prefix, prefix_len) != 0)
217 return false;
218
219 int i = prefix_len;
220 while (name[i] >= '0' && name[i] <= '9')
221 ++i;
222
223 if (i == prefix_len) // 'prefix' alone isn't valid
224 return false;
225
226 while (name[i] == ' ')
227 ++i;
228
229 return !name[i]; // we reached null term
230}
231
232
233int name_length(const TEXT* const name)

Callers 3

implicit_domainFunction · 0.85
implicit_integrityFunction · 0.85
implicit_pkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected