builtin.h File Reference

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

Include dependency graph for builtin.h:

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

Go to the source code of this file.

Defines

#define __attribute__(x)
#define _builtin_h   1

Typedefs

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

Functions

short abs (short arg)
void clearbit (long &x, long b)
void default_one_arg_error_handler (const char *) __attribute__((noreturn))
void default_two_arg_error_handler (const char *, const char *) __attribute__((noreturn))
char * dtoa (double x, char cvt= 'g', int width=0, int prec=6)
int even (long arg)
unsigned int foldhash (double)
long gcd (long, long)
unsigned int hashpjw (const char *)
long lcm (long x, long y)
long lg (unsigned long)
unsigned int multiplicativehash (int)
int odd (long arg)
long pow (long, long)
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)
void() setbit (long &x, long b)
int sign (double arg)
int sign (long arg)
double sqr (double arg)
long sqr (long arg)
double start_timer ()
int testbit (long x, long b)

Variables

two_arg_error_handler_t lib_error_handler


Define Documentation

#define __attribute__  ) 
 

Definition at line 59 of file builtin.h.

#define _builtin_h   1
 

Definition at line 51 of file builtin.h.


Typedef Documentation

typedef void(* one_arg_error_handler_t)(const char *)
 

Definition at line 62 of file builtin.h.

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

Definition at line 63 of file builtin.h.


Function Documentation

short abs short  arg  )  [inline]
 

Definition at line 90 of file builtin.h.

Referenced by BTree::delay(), Line::delay(), and SctpAgent::RttUpdate().

00091 {
00092   return (arg < 0)? -arg : arg;
00093 }

void clearbit long &  x,
long  b
[inline]
 

Definition at line 137 of file builtin.h.

00138 {
00139   x &= ~(1 << b);
00140 }

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 117 of file builtin.h.

00118 {
00119   return !(arg & 1);
00120 }

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 127 of file builtin.h.

References gcd().

00128 {
00129   return x / gcd(x, y) * y;
00130 }

Here is the call graph for this function:

long lg unsigned  long  ) 
 

unsigned int multiplicativehash int   ) 
 

int odd long  arg  )  [inline]
 

Definition at line 122 of file builtin.h.

00123 {
00124   return (arg & 1);
00125 }

long pow long  ,
long 
 

double pow double  ,
long 
 

Referenced by LandmarkAgent::aggregate_tags(), QA::bufOptScen1(), QA::bufOptScen2(), CMUTrace::calculate_broadcast_parameters(), DiffusionProb::CalGradient(), ErrorModel::ComputeBitErrProb(), ErrorModel::CorruptByte(), REDQueue::drop_early(), PromotionTimer::expire(), SensorQueryAgent::generate_query(), asim::Lq(), TcpAgent::opencwnd(), RNG::pareto(), RNG::paretoII(), LandmarkAgent::periodic_callback(), asim::Pk(), asim::Po(), Power_law_no_hops(), Shadowing::Pr(), LandmarkAgent::radius(), hdr_qs::rate_to_Bps(), REMQueue::run_updaterule(), and TcpAgent::slowdown().

double return_elapsed_time double  last_time = 0.0  ) 
 

two_arg_error_handler_t set_lib_error_handler two_arg_error_handler_t  f  ) 
 

void() setbit long &  x,
long  b
[inline]
 

Definition at line 132 of file builtin.h.

00133 {
00134   x |= (1 << b);
00135 }

int sign double  arg  )  [inline]
 

Definition at line 100 of file builtin.h.

00101 {
00102   return (arg == 0.0) ? 0 : ( (arg > 0.0) ? 1 : -1 );
00103 }

int sign long  arg  )  [inline]
 

Definition at line 95 of file builtin.h.

00096 {
00097   return (arg == 0) ? 0 : ( (arg > 0) ? 1 : -1 );
00098 }

double sqr double  arg  )  [inline]
 

Definition at line 111 of file builtin.h.

00112 {
00113   return arg * arg;
00114 }

long sqr long  arg  )  [inline]
 

Definition at line 105 of file builtin.h.

00106 {
00107   return arg * arg;
00108 }

double start_timer  ) 
 

int testbit long  x,
long  b
[inline]
 

Definition at line 142 of file builtin.h.

00143 {
00144   return ((x & (1 << b)) != 0);
00145 }


Variable Documentation

two_arg_error_handler_t lib_error_handler
 


Generated on Tue Mar 6 16:49:44 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6