File: util.h

package info (click to toggle)
libmems 1.6.0%2B4725-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,148 kB
  • sloc: cpp: 21,579; ansic: 4,313; xml: 115; makefile: 107; sh: 26
file content (28 lines) | stat: -rw-r--r-- 731 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _util_h_
#define _util_h_

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdarg.h>

// these just let you get a temporary string -- don't hang onto it for very
// long though -- it will get overwritten at some point.  This is useful for
// passing as parms and such.
const char * Fmt( const char * fmt, ... );
const char * VFmt( const char * fmt, va_list args );


/// shifts a 64-bit value (in two 32 bit parts) either right or left.
/// amt negative -> left, positive -> right
void Shift64( int amt, int * hi, int * lo );


void AddTo64( unsigned int amt, unsigned int *hi, unsigned int *lo );

/** cross-platform file deletion */
int removeFile( const char* filename, int verbose );


#endif /* _util_h_ */