GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  EZ_SSHEETSORTREGION (3)

NAME

EZ_SSheetSortRegion - sort the specified spread sheet region

CONTENTS

Synopsis
Arguments
Description

SYNOPSIS


#include <EZ.h> 

void EZ_SSheetSortRegion( EZ_Widget *ssheet, int r1, int c1, int r2, int c2 int col, int (*cmp)(CONSTvoid*,CONSTvoid*))

void EZ_SSheetSortRegionR( EZ_Widget *ssheet, int r1, int c1, int r2, int c2 int row, int (*cmp)(CONSTvoid*,CONSTvoid*))

void EZ_SSheetSortColumns( EZ_Widget *ssheet, int r1, int c1, int r2, int c2 int (*cmp)(CONSTvoid*,CONSTvoid*))

void EZ_SSheetSortRows( EZ_Widget *ssheet, int r1, int c1, int r2, int c2 int (*cmp)(CONSTvoid*,CONSTvoid*))

ARGUMENTS

ssheet Specifies a spread sheet widget.

r1,c1,r2,c2 Specify the upper left and lower right corner of a rectangular region.

col Specifies a key column.

row Specifies a key row.

cmp Specify a comparision function.

DESCRIPTION

EZ_SSheetSortRegion uses qsort to sort the specified region using the cells in the key column. cmp is used to compare two strings. See the manual page of qsort for details. If cmp is NULL, this function will use an internal comparision function to sort the contents of the region in lexical order. The internal comparision is listed below.

EZ_SSheetSortRegionR sort the specified region using the cells in the key row.

EZ_SSheetSortColumns sort each column individually in the specified region.

EZ_SSheetSortColumns sort each row individually in the specified region.

The internal comparision function.

int EZ_CompareStr(CONST void *vaptr, CONST void *vbptr)
{
  char **aptr = (char **)vaptr;
  char **bptr = (char **)vbptr;
  char *a = *aptr, *b = *bptr;
  if(a == NULL) return(1);
  else if( b == NULL) return(-1);
  while(*a && *b && *a == *b) {a++; b++;}
  if(*a == 0) return(-1);
  else if(*b == 0) return(1);
  return( (*a > *b)? 1: -1);
}

SEE ALSO

EZ_SSheetFindCell(3), EZ_SSheetSetTabChar(3)

Search for    or go to Top of page |  Section 3 |  Main Index


EZWGL EZ_SSHEETSORTREGION (3)

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.