
sort_array(3)          C LIBRARY FUNCTIONS          sort_array(3)

NAME
     sort_array() - sort an array

SYNOPSIS
     mixed *sort_array( mixed *arr, string fun, object ob );

DESCRIPTION
     Returns an array with the same elements as `arr', but quick-
     sorted  in  descending  order according to the rules in `ob-
     >fun()'.  `ob->fun()' will be passed two arguments for  each
     call.   It should return -1, 0, or 1, depending on the rela-
     tionship of the two arguments  (lesser,  equal  to,  greater
     than).

     Here are two common forms for the compare function to take:

          int compare(string one, two) {
              return strcmp(one, two);
          }

          int compare(int one, two) {
              return (one - two);
          }

Sun Release 4.1           Last change:                          1

