Lines Matching refs:pglob

50 	glob_s_t *pglob = (glob_s_t *)stream->abstract;  in _php_glob_stream_get_path()  local
52 if (pglob && pglob->path) { in _php_glob_stream_get_path()
54 *plen = pglob->path_len; in _php_glob_stream_get_path()
57 return estrndup(pglob->path, pglob->path_len); in _php_glob_stream_get_path()
59 return pglob->path; in _php_glob_stream_get_path()
72 glob_s_t *pglob = (glob_s_t *)stream->abstract; in _php_glob_stream_get_pattern() local
74 if (pglob && pglob->pattern) { in _php_glob_stream_get_pattern()
76 *plen = pglob->pattern_len; in _php_glob_stream_get_pattern()
79 return estrndup(pglob->pattern, pglob->pattern_len); in _php_glob_stream_get_pattern()
81 return pglob->pattern; in _php_glob_stream_get_pattern()
94 glob_s_t *pglob = (glob_s_t *)stream->abstract; in _php_glob_stream_get_count() local
96 if (pglob) { in _php_glob_stream_get_count()
98 *pflags = pglob->flags; in _php_glob_stream_get_count()
100 return pglob->glob.gl_pathc; in _php_glob_stream_get_count()
110 static void php_glob_stream_path_split(glob_s_t *pglob, const char *path, int get_path, const char … in php_glob_stream_path_split() argument
126 if (pglob->path) { in php_glob_stream_path_split()
127 efree(pglob->path); in php_glob_stream_path_split()
132 pglob->path_len = path - gpath; in php_glob_stream_path_split()
133 pglob->path = estrndup(gpath, pglob->path_len); in php_glob_stream_path_split()
140 glob_s_t *pglob = (glob_s_t *)stream->abstract; in php_glob_stream_read() local
145 if (count == sizeof(php_stream_dirent) && pglob) { in php_glob_stream_read()
146 if (pglob->index < (size_t)pglob->glob.gl_pathc) { in php_glob_stream_read()
147 …php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[pglob->index++], pglob->flags & GLOB_APPEND… in php_glob_stream_read()
151 pglob->index = pglob->glob.gl_pathc; in php_glob_stream_read()
152 if (pglob->path) { in php_glob_stream_read()
153 efree(pglob->path); in php_glob_stream_read()
154 pglob->path = NULL; in php_glob_stream_read()
164 glob_s_t *pglob = (glob_s_t *)stream->abstract; in php_glob_stream_close() local
166 if (pglob) { in php_glob_stream_close()
167 pglob->index = 0; in php_glob_stream_close()
168 globfree(&pglob->glob); in php_glob_stream_close()
169 if (pglob->path) { in php_glob_stream_close()
170 efree(pglob->path); in php_glob_stream_close()
172 if (pglob->pattern) { in php_glob_stream_close()
173 efree(pglob->pattern); in php_glob_stream_close()
183 glob_s_t *pglob = (glob_s_t *)stream->abstract; in php_glob_stream_rewind() local
185 if (pglob) { in php_glob_stream_rewind()
186 pglob->index = 0; in php_glob_stream_rewind()
187 if (pglob->path) { in php_glob_stream_rewind()
188 efree(pglob->path); in php_glob_stream_rewind()
189 pglob->path = NULL; in php_glob_stream_rewind()
210 glob_s_t *pglob; in php_glob_stream_opener() local
225 pglob = ecalloc(sizeof(*pglob), 1); in php_glob_stream_opener()
227 if (0 != (ret = glob(path, pglob->flags & GLOB_FLAGMASK, NULL, &pglob->glob))) { in php_glob_stream_opener()
232 efree(pglob); in php_glob_stream_opener()
247 pglob->pattern_len = strlen(pos); in php_glob_stream_opener()
248 pglob->pattern = estrndup(pos, pglob->pattern_len); in php_glob_stream_opener()
250 pglob->flags |= GLOB_APPEND; in php_glob_stream_opener()
252 if (pglob->glob.gl_pathc) { in php_glob_stream_opener()
253 php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[0], 1, &tmp); in php_glob_stream_opener()
255 php_glob_stream_path_split(pglob, path, 1, &tmp); in php_glob_stream_opener()
258 return php_stream_alloc(&php_glob_stream_ops, pglob, 0, mode); in php_glob_stream_opener()