~jaypipes/drizzle/subscriber-plugin

« back to all changes in this revision

Viewing changes to regex/split.c

  • Committer: Brian Aker
  • Date: 2008-07-05 19:32:59 UTC
  • mfrom: (53.2.28 codestyle)
  • Revision ID: brian@tangent.org-20080705193259-opqzfb0oprfcg8dm
Merge from Monty's tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <stdio.h>
2
2
#include <string.h>
3
3
 
 
4
int split(char *string, char *fields[], int nfields, char *sep);
 
5
 
4
6
/*
5
7
 - split - divide a string into fields, like awk split()
6
8
 = int split(char *string, char *fields[], int nfields, char *sep);
7
9
 */
8
 
int                             /* number of fields, including overflow */
9
 
split(string, fields, nfields, sep)
10
 
char *string;
11
 
char *fields[];                 /* list is not NULL-terminated */
12
 
int nfields;                    /* number of entries available in fields[] */
13
 
char *sep;                      /* "" white, "c" single char, "ab" [ab]+ */
 
10
int                     /* number of fields, including overflow */
 
11
split(char *string,
 
12
      char *fields[],   /* list is not NULL-terminated */
 
13
      int nfields,      /* number of entries available in fields[] */
 
14
      char *sep)        /* "" white, "c" single char, "ab" [ab]+ */
14
15
{
15
16
        register char *p = string;
16
17
        register char c;                        /* latest character */