7 /****v* ROBODoc/fold_start_markers
11 * Strings for fold start.
14 fold_mark_t fold_start_markers[] =
16 {"/*{{{", "*/"}, /* C, C++ */
17 {"--{{{", "\n"}, /* Occam, line ends with newline */
18 {"#{{{", "\n"}, /* Various scripts, line ends with newline */
25 /****v* ROBODoc/fold_end_markers
29 * Strings for fold end.
32 fold_mark_t fold_end_markers[] =
48 * Fold counter - true global.
58 /****f* ROBODoc/RB_Check_Fold_End [3.0h]
64 * See if a fold end is found.
66 * 1 if end mark is found
71 RB_Check_Fold_End (char *cur_char)
73 fold_mark_t *t = fold_end_markers;
76 while (found == 0 && t->start != NULL)
78 if (strncmp (t->start, cur_char, strlen (t->start)) == 0)
83 t++; /* try the next fold mark string */
90 /****f* ROBODoc/RB_Check_Fold_Start
96 * Check if a fold start is found.
98 * Pointer to the item body, fold mark and name skipped.
100 * *found = 1 if fold mark is found. Fold name is copied to *foldname.
105 RB_Check_Fold_Start (char *cur_char, char *foldname, char *found)
108 fold_mark_t *t = fold_start_markers;
111 while (*found == 0 && t->start != NULL)
113 if (strncmp (t->start, cur_char, strlen (t->start)) == 0)
118 t++; /* try the next fold mark string */
122 return cur_char; /* not found, get out of here */
124 cur_char += strlen (t->start); /* skip fold mark */
125 /* get the fold name */
126 while (strncmp (t->end, cur_char, strlen (t->end)) != 0)
128 foldname[n++] = *cur_char++;
130 /* if fold mark does not end with newline, skip chars... */
131 if (t->end[0] != '\n')
133 cur_char += strlen (t->end);
136 while (*cur_char != '\n')
138 cur_char++; /* not so sure about this */