PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
strsep.c File Reference
#include "c.h"
Include dependency graph for strsep.c:

Go to the source code of this file.

Functions

char * strsep (char **stringp, const char *delim)
 

Function Documentation

◆ strsep()

char * strsep ( char **  stringp,
const char *  delim 
)

Definition at line 49 of file strsep.c.

50{
51 char *s;
52 const char *spanp;
53 int c,
54 sc;
55 char *tok;
56
57 if ((s = *stringp) == NULL)
58 return (NULL);
59 for (tok = s;;)
60 {
61 c = *s++;
62 spanp = delim;
63 do
64 {
65 if ((sc = *spanp++) == c)
66 {
67 if (c == 0)
68 s = NULL;
69 else
70 s[-1] = 0;
71 *stringp = s;
72 return (tok);
73 }
74 } while (sc != 0);
75 }
76 /* NOTREACHED */
77}
char * c

Referenced by parse_scram_secret(), pg_logging_init(), and split_to_stringlist().