Functions

ut.c File Reference

various general purpose/utility functions. More...

#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <stdlib.h>
#include <time.h>
#include <sys/utsname.h>
#include <libgen.h>
#include "ut.h"
#include "mem/mem.h"
#include "globals.h"
Include dependency graph for ut.c:

Go to the source code of this file.

Functions


Detailed Description

Module: core

Definition in file ut.c.


Function Documentation

char* get_abs_pathname ( str base,
str file 
)

Converts relative pathnames to absolute pathnames.

Parameters:
base - base file, used to extract the absolute path prefix. Might be NULL, in which case the path of the ser.cfg is used.
file - file path to be transformed. If it's already absolute (starts with '/') is left alone. If not the result will be `dirname base`/file.
Returns:
pkg allocated asciiz string or 0 on error.

Definition at line 218 of file ut.c.

References _str::len, _str::s, and STR_FMT.

Referenced by cfg_parser_init(), fix_initial_pathname(), fix_rel_pathname(), and fix_shm_pathname().

Here is the caller graph for this function:

char* str_search ( str text,
str needle 
)

search for needle in text

Returns:
pointer to start of needle in text or NULL if the needle is not found

Definition at line 284 of file ut.c.

References _str::len, and _str::s.