cmp man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

COMPARE(3)		     C Programmer's Manual		    COMPARE(3)

NAME
       cmp_set_offset,	cmp_struct,  cmp_char,	cmp_short,  cmp_int, cmp_long,
       cmp_float,   cmp_double,	  cmp_long_double,    cmp_schar,    cmp_uchar,
       cmp_ushort,  cmp_uint, cmp_ulong, cmp_charptr, cmp_chararr - comparison
       functions for qsort, bsearch, and others

SYNOPSIS
       #include <cmp.h>
       void cmp_set_offset(size_t offset, int (*)(const void *, const void *));
       int cmp_struct(const void *, const void *);

       int cmp_char(const void *, const void *);
       int cmp_short(const void *, const void *);
       int cmp_int(const void *, const void *);
       int cmp_long(const void *, const void *);
       int cmp_float(const void *, const void *);
       int cmp_double(const void *, const void *);
       int cmp_long_double(const void *, const void *);

       int cmp_schar(const void *, const void *);

       int cmp_uchar(const void *, const void *);
       int cmp_ushort(const void *, const void *);
       int cmp_uint(const void *, const void *);
       int cmp_ulong(const void *, const void *);

       int cmp_charptr(const void *, const void *);
       int cmp_chararr(const void *, const void *);

DESCRIPTION
       The functions declared above, with  the	exception  of  cmp_set_offset,
       compare two array elements of the indicated type when given pointers to
       them.  The functions are designed to work  with	qsort(3),  bsearch(3),
       and a number of other library functions which all need the same type of
       comparison function.  They all return negative if the  value  indicated
       by  the first argument is less than the second, 0 if they are the same,
       and positive otherwise.

       cmp_struct compares elements of a structure.  It needs to know the off‐
       set  of the element, and a comparison function suitable for the type of
       the element.  These are set with cmp_set_offset, which should be called
       before qsort(3).	 The settings stay in effect until changed.

SEE ALSO
       publib(3), qsort(3), bsearch(3), isort(3), lsearch(3), lfind(3)

AUTHOR
       Lars Wirzenius (lars.wirzenius@helsinki.fi)

Publib			     C Programmer's Manual		    COMPARE(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net