Branch: Tag:

2007-05-26

2007-05-26 18:38:39 by Martin Stjernholm <mast@lysator.liu.se>

Improved the doc for glob() somewhat.

Rev: src/builtin_functions.c:1.638

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin_functions.c,v 1.637 2007/04/21 20:08:25 grubba Exp $ + || $Id: builtin_functions.c,v 1.638 2007/05/26 18:38:39 mast Exp $   */      #include "global.h"
5643:   }      /*! @decl int(0..1) glob(string glob, string str) -  *! @decl array(string) glob(string glob, array(string) arr) +  *! @decl array(string) glob(string glob, array(string) str)    *! -  *! Match strings against globs. +  *! Match strings against a glob pattern.    *! -  *! In a glob string a question sign matches any character and -  *! an asterisk matches any string. +  *! @param glob +  *! The glob pattern. A question sign ('?') matches any character +  *! and an asterisk ('*') matches a string of arbitrary length. All +  *! other characters only match themselves.    *! -  *! When the second argument is a string and @[str] matches -  *! the glob @[glob] @expr{1@} will be returned, @expr{0@} (zero) otherwise. +  *! @param str +  *! @mixed +  *! @type string +  *! @expr{1@} is returned if the string @[str] matches @[glob], +  *! @expr{0@} (zero) otherwise.    *! -  *! When the second argument is an array then an array is returned -  *! that only contains the strings in it that match @[glob]. The -  *! order among the returned strings is the same as in the input -  *! array. +  *! @type array(string) +  *! All strings in the array @[str] are matched against @[glob], +  *! and those that match are returned in an array (in the same +  *! order). +  *! @endmixed    *!    *! @seealso    *! @[sscanf()], @[Regexp]