pike.git / lib / modules / Array.pmod

version» Context lines:

pike.git/lib/modules/Array.pmod:461: Inside #if 0
  // }   // else if (prev != i - 1) {   // int joined = 0;   // if (!sizeof (a[i])) {   // if (!sizeof (a[prev])) b[prev] +=   // }   // }   }   #endif    - //! Sort without respect to number formatting (most notably leading - //! zeroes). + //! Sort strings containing numbers with respect to their values + //! rather than according to their formatting (this most notably + //! causes leading zeroes to be ignored/unnecessary). + //! + //! @example + //! "foo7" will be sorted before "foo27", which will be before + //! "foo100".   int(-1..1) dwim_sort_func(string a, string b)   {    if( a==b ) return 0;       string a_int,b_int;    string a_str,b_str;    while(1)    {    sscanf(a, "%[0-9]%[^0-9]%s", a_int,a_str,a);    sscanf(b, "%[0-9]%[^0-9]%s", b_int,b_str,b);