pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1:   /*   || 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"   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/builtin_functions.c:5636:    default:    if(j>=s->len ||    index_shared_string(m,i)!=index_shared_string(s,j)) return 0;    j++;    }    }    return j==s->len;   }      /*! @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]    */   PMOD_EXPORT void f_glob(INT32 args)   {    INT32 i,matches;    struct array *a;    struct pike_string *glob;