Distributed Hash Table File System for Linux

utils.h File Reference

#include "magma_setup.h"
#include <endian.h>


#define MAGMA_ROOT_DIR   "/.magma_root_dir"
#define MAGMA_CONTENTS   "/contents"
#define MAGMA_METADATA   "/metadata"
#define xwritestring(fd, string)   xwrite(fd,string,strlen(string)+1);
#define more_groups(groups, index)   (index <= NGROUPS_MAX && (groups[index] || groups[index+1]))


void chomp (char *in, size_t len)
char * stat_report (const char *name, const struct stat *st)
int timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y)
int xwrite (int fd, const void *buf, size_t size)
int catpath (char **buffer,...)
char * get_regerror (int errcode, regex_t *compiled)
uint64_t magma_htonll (uint64_t from_host)
uint64_t magma_ntohll (uint64_t from_net)
gid_t * get_user_groups (uid_t uid)
void clean_group_cache ()

Define Documentation

#define MAGMA_CONTENTS   "/contents"

#define MAGMA_METADATA   "/metadata"

#define MAGMA_ROOT_DIR   "/.magma_root_dir"

#define more_groups ( groups,
index   )     (index <= NGROUPS_MAX && (groups[index] || groups[index+1]))

#define xwritestring ( fd,
string   )     xwrite(fd,string,strlen(string)+1);

Function Documentation

int catpath ( char **  buffer,

concatenate path components passed as variable length NULL terminated list...

void chomp ( char *  in,
size_t  len 

void clean_group_cache (  ) 

char* get_regerror ( int  errcode,
regex_t *  compiled 

gid_t* get_user_groups ( uid_t  uid  ) 

return a list of group id for userid uid

@uid the UID of the user

uint64_t magma_htonll ( uint64_t  from_host  ) 

uint64_t magma_ntohll ( uint64_t  from_net  ) 

char* stat_report ( const char *  name,
const struct stat *  st 

int timeval_subtract ( struct timeval *  result,
struct timeval *  x,
struct timeval *  y 

int xwrite ( int  fd,
const void *  buf,
size_t  size 

guarantee that all provided buffer will be written on filedescriptor

@fd the filedescriptor
@buf the buffer to be written
@size buffer size to be written

This file last modified Wednesday, 09-Jan-2008 20:04:02 CET