Main Page | Namespace List | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

yepp_utils.h File Reference

More...

Go to the source code of this file.

Defines

#define DIR_SEPARATOR   '/'
#define DIR_SEPARATOR_S   "//"
#define prbytes(m, b, l)
#define li_to_4_byte(a, i)
#define li_to_4_byte_le(a, i)
#define debug_printf(F,)
#define GET_BITS(var, bit, bits)   (((var) >> (bit)) & ((1UL << (bits)) - 1))
 Ritorna una variabile dello stesso tipo del parametro var con tutti i bit messi a 0 tranne quelli specificati.

#define SET_BITS(var, bit, bits, x)   (var) = ((var) & ~(((1UL << (bits)) - 1) << (bit))) | (((x) & ((1UL << (bits)) - 1)) << (bit));
 Setta nella variabile specificata dal parametro var alcuni bit copiandoli dal parametro x.


Functions

int chars2uint (unsigned char *buf, int len)
 Convert a buffer of unsigned chars to unsigned int (BIG ENDIAN).

int chars2int (char *buf, int len)
 Buffer of chars to int.

int chars2int_le (char *buf, int len)
 Integer in little_endian.

void prbytes_x (char *message, char *buffer, int blen)
void debug_printf_x (const char *file, int line, const char *format,...)
void debug_printf_msc (const char *file, int line, const char *debugstring)


Detailed Description

Author:
Giuseppe "Cowo" Corbelli
Date:
Date
2005/05/25 18:58:46

Bug:
Endianness, probably Some utility functions.

Definition in file yepp_utils.h.


Define Documentation

#define DIR_SEPARATOR   '/'
 

Definition at line 41 of file yepp_utils.h.

#define DIR_SEPARATOR_S   "//"
 

Definition at line 42 of file yepp_utils.h.

#define prbytes m,
b,
 ) 
 

Definition at line 65 of file yepp_utils.h.

#define li_to_4_byte a,
 ) 
 

Value:

(((unsigned char *)(a))[3] = ((i) >> 24)& 0xFF,\ ((unsigned char *)(a))[2] = ((i) >> 16)& 0xFF,\ ((unsigned char *)(a))[1] = ((i) >> 8) & 0xFF,\ ((unsigned char *)(a))[0] = (i) & 0xFF)

Definition at line 70 of file yepp_utils.h.

#define li_to_4_byte_le a,
 ) 
 

Value:

(((unsigned char *)(a))[0] = ((i) >> 24)& 0xFF,\ ((unsigned char *)(a))[1] = ((i) >> 16)& 0xFF,\ ((unsigned char *)(a))[2] = ((i) >> 8) & 0xFF,\ ((unsigned char *)(a))[3] = (i) & 0xFF)

Definition at line 74 of file yepp_utils.h.

#define debug_printf  ) 
 

Definition at line 92 of file yepp_utils.h.

#define GET_BITS var,
bit,
bits   )     (((var) >> (bit)) & ((1UL << (bits)) - 1))
 

Ritorna una variabile dello stesso tipo del parametro var con tutti i bit messi a 0 tranne quelli specificati.

Parameters:
var Variabile da cui prendere i bit
bit Mantieni i bit a partire dal bit di questo indice (0 indice di partenza)
bits Mantieni questo numero di bit

Definition at line 105 of file yepp_utils.h.

#define SET_BITS var,
bit,
bits,
 )     (var) = ((var) & ~(((1UL << (bits)) - 1) << (bit))) | (((x) & ((1UL << (bits)) - 1)) << (bit));
 

Setta nella variabile specificata dal parametro var alcuni bit copiandoli dal parametro x.

Parameters:
var Variabile in cui settare i bit
bit Inizia a settare i bit da questo indice (0 indice di partenza)
bits Setta questo numero di bits
x Variabile sorgente da cui copiare i bit (dallo stesso range specificato con i parametri di cui sopra)

Definition at line 113 of file yepp_utils.h.


Function Documentation

int chars2uint unsigned char *  buf,
int  len
 

Convert a buffer of unsigned chars to unsigned int (BIG ENDIAN).

Parameters:
buf Buffer of unsigned chars
len Length of the buffer
Returns:
Buffer converted to integer, big endian

int chars2int char *  buf,
int  len
 

Buffer of chars to int.

int chars2int_le char *  buf,
int  len
 

Integer in little_endian.

void prbytes_x char *  message,
char *  buffer,
int  blen
 

void debug_printf_x const char *  file,
int  line,
const char *  format,
  ...
 

void debug_printf_msc const char *  file,
int  line,
const char *  debugstring
 


Generated on Sun May 29 16:13:38 2005 for yex by doxygen 1.3.7