You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

51 lines
989 B

#ifndef _UTIL_H
#define _UTIL_H
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
extern "C" {
#include <env.h>
#include <fs.h>
}
#define ULONG unsigned long
#define BADFILE 0
#define TEXT 1
#define BINARY 2
#define CHKBYTES 512
const char *getName();
const char *getLocalName(char *);
char *unCRLF(char *, unsigned long);
long writeFile(const char *, void *, unsigned long);
void *readFile(const char *, unsigned long *);
const char *basename(const char *);
int fileType(const char *);
void mdebug(char *, ...);
//////////////////////////////////////////////////////////////////////////////
// Some useful inline functions
//////////////////////////////////////////////////////////////////////////////
inline char *getHostName()
{
return mylocalhost();
}
inline char *getHomeDir()
{
return myhomedir();
}
extern char *sysinbox();
inline char *getDefaultInbox()
{
return sysinbox();
}
#endif