MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ng_string_parse

Function ng_string_parse

freebsd/netgraph/ng_parse.c:717–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715 ************************************************************************/
716
717static int
718ng_string_parse(const struct ng_parse_type *type,
719 const char *s, int *off, const u_char *const start,
720 u_char *const buf, int *buflen)
721{
722 char *sval;
723 int len;
724 int slen;
725
726 if ((sval = ng_get_string_token(s, off, &len, &slen)) == NULL)
727 return (EINVAL);
728 *off += len;
729 bcopy(sval, buf, slen + 1);
730 free(sval, M_NETGRAPH_PARSE);
731 *buflen = slen + 1;
732 return (0);
733}
734
735static int
736ng_string_unparse(const struct ng_parse_type *type,

Callers

nothing calls this directly

Calls 2

ng_get_string_tokenFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected