Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

builtin.h File Reference

#include <stddef.h>
#include <stdio.h>

Include dependency graph for builtin.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define _builtin_h   1
#define __attribute__(x)

Typedefs

typedef void(* one_arg_error_handler_t )(const char *)
typedef void(* two_arg_error_handler_t )(const char *, const char *)

Functions

long gcd (long, long)
long lg (unsigned long)
double pow (double, long)
long pow (long, long)
double start_timer ()
double return_elapsed_time (double last_time=0.0)
char * dtoa (double x, char cvt= 'g', int width=0, int prec=6)
unsigned int hashpjw (const char *)
unsigned int multiplicativehash (int)
unsigned int foldhash (double)
void default_one_arg_error_handler (const char *) __attribute__((noreturn))
void default_two_arg_error_handler (const char *, const char *) __attribute__((noreturn))
two_arg_error_handler_t set_lib_error_handler (two_arg_error_handler_t f)
short abs (short arg)
int sign (long arg)
int sign (double arg)
long sqr (long arg)
double sqr (double arg)
int even (long arg)
int odd (long arg)
long lcm (long x, long y)
void clearbit (long &x, long b)
int testbit (long x, long b)

Variables

two_arg_error_handler_t lib_error_handler
void( setbit )(long &x, long b)


Define Documentation

#define __attribute__  ) 
 

Definition at line 37 of file builtin.h.

#define _builtin_h   1
 

Definition at line 29 of file builtin.h.


Typedef Documentation

typedef void(* one_arg_error_handler_t)(const char*)
 

Definition at line 40 of file builtin.h.

Referenced by set_intVec_error_handler().

typedef void(* two_arg_error_handler_t)(const char*, const char*)
 

Definition at line 41 of file builtin.h.


Function Documentation

short abs short  arg  )  [inline]
 

Definition at line 68 of file builtin.h.

00069 {
00070   return (arg < 0)? -arg : arg;
00071 }

void clearbit long &  x,
long  b
[inline]
 

Definition at line 115 of file builtin.h.

00116 {
00117   x &= ~(1 << b);
00118 }

void default_one_arg_error_handler const char *   ) 
 

void default_two_arg_error_handler const char *  ,
const char * 
 

char* dtoa double  x,
char  cvt = 'g',
int  width = 0,
int  prec = 6
 

int even long  arg  )  [inline]
 

Definition at line 95 of file builtin.h.

00096 {
00097   return !(arg & 1);
00098 }

unsigned int foldhash double   ) 
 

long gcd long  ,
long 
 

Referenced by lcm().

unsigned int hashpjw const char *   ) 
 

long lcm long  x,
long  y
[inline]
 

Definition at line 105 of file builtin.h.

References gcd().

00106 {
00107   return x / gcd(x, y) * y;
00108 }

Here is the call graph for this function:

long lg unsigned  long  ) 
 

unsigned int multiplicativehash int   ) 
 

int odd long  arg  )  [inline]
 

Definition at line 100 of file builtin.h.

00101 {
00102   return (arg & 1);
00103 }

long pow long  ,
long 
 

Referenced by JoBS::adjustRatesRDC(), LandmarkAgent::aggregate_tags(), QA::bufOptScen1(), QA::bufOptScen2(), CMUTrace::calculate_broadcast_parameters(), DiffusionProb::CalGradient(), ErrorModel::ComputeBitErrProb(), ErrorModel::CorruptByte(), tags_database::create_tags_database(), REDQueue::drop_early(), PromotionTimer::expire(), SensorQueryAgent::generate_query(), asim::Lq(), main(), TcpAgent::opencwnd(), RNG::pareto(), RNG::paretoII(), LandmarkAgent::periodic_callback(), asim::Pk(), asim::Po(), Shadowing::Pr(), LandmarkAgent::ProcessHierUpdate(), LandmarkAgent::radius(), REMQueue::run_updaterule(), WirelessPhy::sendUp(), and TcpAgent::slowdown().

double pow double  ,
long 
 

double return_elapsed_time double  last_time = 0.0  ) 
 

two_arg_error_handler_t set_lib_error_handler two_arg_error_handler_t  f  ) 
 

int sign double  arg  )  [inline]
 

Definition at line 78 of file builtin.h.

00079 {
00080   return (arg == 0.0) ? 0 : ( (arg > 0.0) ? 1 : -1 );
00081 }

int sign long  arg  )  [inline]
 

Definition at line 73 of file builtin.h.

00074 {
00075   return (arg == 0) ? 0 : ( (arg > 0) ? 1 : -1 );
00076 }

double sqr double  arg  )  [inline]
 

Definition at line 89 of file builtin.h.

00090 {
00091   return arg * arg;
00092 }

long sqr long  arg  )  [inline]
 

Definition at line 83 of file builtin.h.

00084 {
00085   return arg * arg;
00086 }

double start_timer  ) 
 

int testbit long  x,
long  b
[inline]
 

Definition at line 120 of file builtin.h.

00121 {
00122   return ((x & (1 << b)) != 0);
00123 }


Variable Documentation

two_arg_error_handler_t lib_error_handler
 

Definition at line 60 of file builtin.h.

void( setbit)(long& x, long b)
 

Definition at line 110 of file builtin.h.

00111 {
00112   x |= (1 << b);
00113 }


Generated on Tue Apr 20 12:16:29 2004 for NS2.26SourcesOriginal by doxygen 1.3.3