/*
 * Author:
 *         Kendy Kutzner <kutzner@ira.uka.de>
 *
 * (c) 2005 Research Group Dr. Fuhrmann, University of Karlsruhe, Germany
 * All rights reserved.
 *
 * $Id: utils.h,v 1.7 2005/11/21 10:46:57 kutzner Exp $
 *
 */

#ifndef _UTILS_H_
#define _UTILS_H_

#include <string>
#include <map>
using namespace std;

#include "time.h"

string makeavpair(string attr, string val);
string makeavpair(string attr, int val);

std::pair<string,string> splitavpair(string l);
	
string extractfrommap(map<string,string> * m, string s);

string itos(int i);
char * itoa(int i);

#define PERRORANDEXIT {perror(""); exit(-1);}
// int min(int a, int b){return a<b?a:b;};
#define MIN(a,b) (((a)<(b))?(a):(b))

double tv2double(timeval*);
void double2tv(timeval*, double);
double dbltime();

#endif
