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
long_cmp(3) FreeBSD Library Functions Manual long_cmp(3)

#include <xtend/math.h>
-lxtend

int     long_cmp(const long *n1, const long *n2)

n1, n2  Pointers to two long values

This is a function that compares two longs as a service to polymorphic functions such as qsort(3), bsearch(3), etc. The address of long_cmp() is passed as an argument to perform the data type specific comparison on behalf of the sort of search function.

A value > 0 if *n1 is greater than *n2 A value < 0 if *n1 is less than *n2 0 if the values are equal

long  list[LIST_SIZE];
// sizeof(*list) will continue to work if we change the data type
// We'll still need to change the cmp function, though
qsort(list, LIST_SIZE, sizeof(*list),
      (int (*)(const void *, const void *))long_cmp);

qsort(3), heapsort(3), mergesort(3), bsearch(3)


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

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