PandA-2024.02
Data Structures | Macros | Functions | Variables
support.h File Reference
#include <stdlib.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdint.h>
Include dependency graph for support.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  prng_rand_t
 

Macros

#define SECTION_TERMINATED   -1
 
#define __STAC_EXPANDED(f_pfx, t, f_sfx)   f_pfx##t##f_sfx
 
#define STAC(f_pfx, t, f_sfx)   __STAC_EXPANDED(f_pfx,t,f_sfx)
 
#define __PRNG_H__
 
#define LAG1   (UINT16_C(24))
 
#define LAG2   (UINT16_C(55))
 
#define RAND_SSIZE   ((UINT16_C(1))<<6)
 
#define RAND_SMASK   (RAND_SSIZE-1)
 
#define RAND_EXHAUST_LIMIT   LAG2
 
#define RAND_REFILL_COUNT   ((LAG2*10)-RAND_EXHAUST_LIMIT)
 
#define PRNG_RAND_MAX   UINT64_MAX
 

Functions

char * readfile (int fd)
 
char * find_section_start (char *s, int n)
 
int parse_string (char *s, char *arr, int n)
 
int parse_uint8_t_array (char *s, uint8_t *arr, int n)
 
int parse_uint16_t_array (char *s, uint16_t *arr, int n)
 
int parse_uint32_t_array (char *s, uint32_t *arr, int n)
 
int parse_uint64_t_array (char *s, uint64_t *arr, int n)
 
int parse_int8_t_array (char *s, int8_t *arr, int n)
 
int parse_int16_t_array (char *s, int16_t *arr, int n)
 
int parse_int32_t_array (char *s, int32_t *arr, int n)
 
int parse_int64_t_array (char *s, int64_t *arr, int n)
 
int parse_float_array (char *s, float *arr, int n)
 
int parse_double_array (char *s, double *arr, int n)
 
int write_string (int fd, char *arr, int n)
 
int write_uint8_t_array (int fd, uint8_t *arr, int n)
 
int write_uint16_t_array (int fd, uint16_t *arr, int n)
 
int write_uint32_t_array (int fd, uint32_t *arr, int n)
 
int write_uint64_t_array (int fd, uint64_t *arr, int n)
 
int write_int8_t_array (int fd, int8_t *arr, int n)
 
int write_int16_t_array (int fd, int16_t *arr, int n)
 
int write_int32_t_array (int fd, int32_t *arr, int n)
 
int write_int64_t_array (int fd, int64_t *arr, int n)
 
int write_float_array (int fd, float *arr, int n)
 
int write_double_array (int fd, double *arr, int n)
 
int write_section_header (int fd)
 
void run_benchmark (void *vargs)
 
void input_to_data (int fd, void *vdata)
 
void data_to_input (int fd, void *vdata)
 
void output_to_data (int fd, void *vdata)
 
void data_to_output (int fd, void *vdata)
 
int check_data (void *vdata, void *vref)
 
static uint64_t prng_rand (struct prng_rand_t *state)
 
static void prng_srand (uint64_t seed, struct prng_rand_t *state)
 

Variables

int INPUT_SIZE
 

Macro Definition Documentation

◆ __PRNG_H__

#define __PRNG_H__

Definition at line 62 of file support.h.

◆ __STAC_EXPANDED

#define __STAC_EXPANDED (   f_pfx,
  t,
  f_sfx 
)    f_pfx##t##f_sfx

Definition at line 50 of file support.h.

◆ LAG1

#define LAG1   (UINT16_C(24))

Definition at line 69 of file support.h.

Referenced by prng_rand().

◆ LAG2

#define LAG2   (UINT16_C(55))

Definition at line 70 of file support.h.

Referenced by prng_rand().

◆ PRNG_RAND_MAX

#define PRNG_RAND_MAX   UINT64_MAX

Definition at line 82 of file support.h.

Referenced by main().

◆ RAND_EXHAUST_LIMIT

#define RAND_EXHAUST_LIMIT   LAG2

Definition at line 73 of file support.h.

Referenced by prng_rand(), and prng_srand().

◆ RAND_REFILL_COUNT

#define RAND_REFILL_COUNT   ((LAG2*10)-RAND_EXHAUST_LIMIT)

Definition at line 75 of file support.h.

Referenced by prng_rand().

◆ RAND_SMASK

#define RAND_SMASK   (RAND_SSIZE-1)

Definition at line 72 of file support.h.

Referenced by prng_rand().

◆ RAND_SSIZE

#define RAND_SSIZE   ((UINT16_C(1))<<6)

Definition at line 71 of file support.h.

Referenced by prng_rand(), and prng_srand().

◆ SECTION_TERMINATED

#define SECTION_TERMINATED   -1

Definition at line 9 of file support.h.

Referenced by test_strings().

◆ STAC

#define STAC (   f_pfx,
  t,
  f_sfx 
)    __STAC_EXPANDED(f_pfx,t,f_sfx)

Definition at line 51 of file support.h.

Referenced by data_to_input(), data_to_output(), input_to_data(), and output_to_data().

Function Documentation

◆ check_data()

int check_data ( void *  vdata,
void *  vref 
)

◆ data_to_input()

void data_to_input ( int  fd,
void *  vdata 
)

Definition at line 34 of file local_support.c.

◆ data_to_output()

void data_to_output ( int  fd,
void *  vdata 
)

Definition at line 63 of file local_support.c.

◆ find_section_start()

char* find_section_start ( char *  s,
int  n 
)

Definition at line 56 of file support.c.

◆ input_to_data()

void input_to_data ( int  fd,
void *  vdata 
)

Definition at line 18 of file local_support.c.

◆ output_to_data()

void output_to_data ( int  fd,
void *  vdata 
)

Definition at line 49 of file local_support.c.

◆ parse_double_array()

int parse_double_array ( char *  s,
double *  arr,
int  n 
)

Referenced by input_to_data(), and output_to_data().

Here is the caller graph for this function:

◆ parse_float_array()

int parse_float_array ( char *  s,
float *  arr,
int  n 
)

◆ parse_int16_t_array()

int parse_int16_t_array ( char *  s,
int16_t *  arr,
int  n 
)

◆ parse_int32_t_array()

int parse_int32_t_array ( char *  s,
int32_t *  arr,
int  n 
)

Referenced by input_to_data(), and output_to_data().

Here is the caller graph for this function:

◆ parse_int64_t_array()

int parse_int64_t_array ( char *  s,
int64_t *  arr,
int  n 
)

◆ parse_int8_t_array()

int parse_int8_t_array ( char *  s,
int8_t *  arr,
int  n 
)

◆ parse_string()

int parse_string ( char *  s,
char *  arr,
int  n 
)

Definition at line 77 of file support.c.

◆ parse_uint16_t_array()

int parse_uint16_t_array ( char *  s,
uint16_t *  arr,
int  n 
)

◆ parse_uint32_t_array()

int parse_uint32_t_array ( char *  s,
uint32_t *  arr,
int  n 
)

◆ parse_uint64_t_array()

int parse_uint64_t_array ( char *  s,
uint64_t *  arr,
int  n 
)

Referenced by input_to_data(), and output_to_data().

Here is the caller graph for this function:

◆ parse_uint8_t_array()

int parse_uint8_t_array ( char *  s,
uint8_t *  arr,
int  n 
)

Referenced by input_to_data(), and output_to_data().

Here is the caller graph for this function:

◆ prng_rand()

static uint64_t prng_rand ( struct prng_rand_t state)
inlinestatic

Definition at line 85 of file support.h.

References prng_rand_t::c, prng_rand_t::i, LAG1, LAG2, RAND_EXHAUST_LIMIT, RAND_REFILL_COUNT, RAND_SMASK, RAND_SSIZE, and prng_rand_t::s.

Referenced by main(), prng_srand(), and test_prng().

Here is the caller graph for this function:

◆ prng_srand()

static void prng_srand ( uint64_t  seed,
struct prng_rand_t state 
)
inlinestatic

Definition at line 106 of file support.h.

References prng_rand_t::c, prng_rand_t::i, prng_rand(), RAND_EXHAUST_LIMIT, RAND_SSIZE, and prng_rand_t::s.

Referenced by main(), and test_prng().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readfile()

char* readfile ( int  fd)

Definition at line 34 of file support.c.

◆ run_benchmark()

void run_benchmark ( void *  vargs)

Definition at line 6 of file local_support.c.

◆ write_double_array()

int write_double_array ( int  fd,
double *  arr,
int  n 
)

Referenced by data_to_input(), and data_to_output().

Here is the caller graph for this function:

◆ write_float_array()

int write_float_array ( int  fd,
float *  arr,
int  n 
)

◆ write_int16_t_array()

int write_int16_t_array ( int  fd,
int16_t *  arr,
int  n 
)

◆ write_int32_t_array()

int write_int32_t_array ( int  fd,
int32_t *  arr,
int  n 
)

Referenced by data_to_input(), and data_to_output().

Here is the caller graph for this function:

◆ write_int64_t_array()

int write_int64_t_array ( int  fd,
int64_t *  arr,
int  n 
)

◆ write_int8_t_array()

int write_int8_t_array ( int  fd,
int8_t *  arr,
int  n 
)

◆ write_section_header()

int write_section_header ( int  fd)

Referenced by data_to_input(), data_to_output(), and test_strings().

Here is the caller graph for this function:

◆ write_string()

int write_string ( int  fd,
char *  arr,
int  n 
)

Referenced by data_to_input(), data_to_output(), and test_strings().

Here is the caller graph for this function:

◆ write_uint16_t_array()

int write_uint16_t_array ( int  fd,
uint16_t *  arr,
int  n 
)

◆ write_uint32_t_array()

int write_uint32_t_array ( int  fd,
uint32_t *  arr,
int  n 
)

◆ write_uint64_t_array()

int write_uint64_t_array ( int  fd,
uint64_t *  arr,
int  n 
)

Referenced by data_to_input(), and data_to_output().

Here is the caller graph for this function:

◆ write_uint8_t_array()

int write_uint8_t_array ( int  fd,
uint8_t *  arr,
int  n 
)

Referenced by data_to_input(), and data_to_output().

Here is the caller graph for this function:

Variable Documentation

◆ INPUT_SIZE

int INPUT_SIZE

Definition at line 4 of file local_support.c.


Generated on Mon Feb 12 2024 13:03:10 for PandA-2024.02 by doxygen 1.8.13