GNU PROLOG with UTF8 support
Macros | Functions | Variables
machine.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "gp_config.h"
#include <process.h>
#include <direct.h>
#include "engine_pl.h"
Include dependency graph for machine.c:

Macros

#define INET_MANAGEMENT
 
#define M_MAGIC1   0x12345678
 
#define M_MAGIC2   0xdeadbeef
 
#define UNKNOWN_SYS_ERRNO   "Unknown error (%d)"
 
#define ERR_STACKS_ALLOCATION   "Memory allocation fault"
 
#define ERR_CANNOT_OPEN_DEV0   "Cannot open /dev/zero : %s"
 
#define ERR_CANNOT_UNMAP   "unmap failed : %s"
 
#define ERR_CANNOT_FREE   "VirtualFree failed : %" PL_FMT_u
 
#define ERR_CANNOT_PROTECT   "VirtualProtect failed : %" PL_FMT_u
 
#define ERR_CANNOT_EXEC_GETCWD   "cannot execute getcwd"
 
#define ERR_STACK_OVERFLOW_ENV   "%s stack overflow (size: %d Kb, reached: %d Kb, environment variable used: %s)"
 
#define ERR_STACK_OVERFLOW_NO_ENV   "%s stack overflow (size: %d Kb, reached: %d Kb - fixed size)"
 
#define Round_Up(x, y)   (((x) + (y) - 1) / (y) * (y))
 
#define Round_Down(x, y)   ((x) / (y) * (y))
 
#define RAND_MAX   (((unsigned) -1) >> 1)
 
#define MIN_PREFIX   1 /* unix minimal path / */
 

Functions

static char * Host_Name_From_Alias (struct hostent *host_entry)
 
void Pl_Init_Machine (void)
 
char * Pl_M_Sys_Err_String (int ret_val)
 
PlLong Pl_M_User_Time (void)
 
PlLong Pl_M_System_Time (void)
 
PlLong Pl_M_Real_Time (void)
 
void Pl_M_Randomize (void)
 
void Pl_M_Set_Seed (int n)
 
int Pl_M_Get_Seed (void)
 
int Pl_M_Random_Integer (int n)
 
double Pl_M_Random_Float (double n)
 
char * Pl_M_Host_Name_From_Name (char *host_name)
 
char * Pl_M_Host_Name_From_Adr (char *host_address)
 
Bool Pl_M_Set_Working_Dir (char *path)
 
char * Pl_M_Get_Working_Dir (void)
 
char * Pl_M_Absolute_Path_Name (char *src)
 
Bool Pl_M_Is_Absolute_File_Name (char *path)
 
char * Pl_M_Decompose_File_Name (char *path, Bool del_trail_slashes, char **base, char **suffix)
 

Variables

static PlLong start_user_time = 0
 
static PlLong start_system_time = 0
 
static PlLong start_real_time = 0
 
static int cur_seed = 1
 

Macro Definition Documentation

#define ERR_CANNOT_EXEC_GETCWD   "cannot execute getcwd"
#define ERR_CANNOT_FREE   "VirtualFree failed : %" PL_FMT_u
#define ERR_CANNOT_OPEN_DEV0   "Cannot open /dev/zero : %s"
#define ERR_CANNOT_PROTECT   "VirtualProtect failed : %" PL_FMT_u
#define ERR_CANNOT_UNMAP   "unmap failed : %s"
#define ERR_STACK_OVERFLOW_ENV   "%s stack overflow (size: %d Kb, reached: %d Kb, environment variable used: %s)"
#define ERR_STACK_OVERFLOW_NO_ENV   "%s stack overflow (size: %d Kb, reached: %d Kb - fixed size)"
#define ERR_STACKS_ALLOCATION   "Memory allocation fault"
#define INET_MANAGEMENT
#define M_MAGIC1   0x12345678
#define M_MAGIC2   0xdeadbeef
#define MIN_PREFIX   1 /* unix minimal path / */
#define RAND_MAX   (((unsigned) -1) >> 1)
#define Round_Down (   x,
  y 
)    ((x) / (y) * (y))
#define Round_Up (   x,
  y 
)    (((x) + (y) - 1) / (y) * (y))
#define UNKNOWN_SYS_ERRNO   "Unknown error (%d)"

Function Documentation

static char * Host_Name_From_Alias ( struct hostent *  host_entry)
static

Here is the caller graph for this function:

void Pl_Init_Machine ( void  )

Here is the caller graph for this function:

char* Pl_M_Absolute_Path_Name ( char *  src)

Here is the call graph for this function:

Here is the caller graph for this function:

char* Pl_M_Decompose_File_Name ( char *  path,
Bool  del_trail_slashes,
char **  base,
char **  suffix 
)

Here is the caller graph for this function:

int Pl_M_Get_Seed ( void  )

Here is the caller graph for this function:

char* Pl_M_Get_Working_Dir ( void  )

Here is the caller graph for this function:

char* Pl_M_Host_Name_From_Adr ( char *  host_address)

Here is the call graph for this function:

Here is the caller graph for this function:

char* Pl_M_Host_Name_From_Name ( char *  host_name)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_M_Is_Absolute_File_Name ( char *  path)

Here is the caller graph for this function:

double Pl_M_Random_Float ( double  n)

Here is the caller graph for this function:

int Pl_M_Random_Integer ( int  n)

Here is the caller graph for this function:

void Pl_M_Randomize ( void  )

Here is the call graph for this function:

PlLong Pl_M_Real_Time ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void Pl_M_Set_Seed ( int  n)

Here is the caller graph for this function:

Bool Pl_M_Set_Working_Dir ( char *  path)

Here is the call graph for this function:

Here is the caller graph for this function:

char* Pl_M_Sys_Err_String ( int  ret_val)

Here is the caller graph for this function:

PlLong Pl_M_System_Time ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

PlLong Pl_M_User_Time ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int cur_seed = 1
static
PlLong start_real_time = 0
static
PlLong start_system_time = 0
static
PlLong start_user_time = 0
static