PandA-2024.02
Macros | Functions
support.c File Reference
#include "support.h"
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
Include dependency graph for support.c:

Go to the source code of this file.

Macros

#define SUFFICIENT_SPRINTF_SPACE   256
 
#define generate_parse_TYPE_array(TYPE, STRTOTYPE)
 
#define strtol_10(a, b)   strtol(a,b,10)
 
#define generate_write_TYPE_array(TYPE, FORMAT)
 

Functions

static int fd_printf (int fd, const char *format,...)
 
char * readfile (int fd)
 
char * find_section_start (char *s, int n)
 
int parse_string (char *s, char *arr, int n)
 
 generate_parse_TYPE_array (uint8_t, strtol_10)
 
 generate_write_TYPE_array (uint8_t, PRIu8)
 

Macro Definition Documentation

◆ generate_parse_TYPE_array

#define generate_parse_TYPE_array (   TYPE,
  STRTOTYPE 
)

Definition at line 98 of file support.c.

◆ generate_write_TYPE_array

#define generate_write_TYPE_array (   TYPE,
  FORMAT 
)
Value:
int write_##TYPE##_array(int fd, TYPE *arr, int n) { \
int i; \
assert(fd>1 && "Invalid file descriptor"); \
for( i=0; i<n; i++ ) { \
fd_printf(fd, "%" FORMAT "\n", arr[i]); \
} \
return 0; \
}
#define TYPE
Definition: backprop.h:21

Definition at line 167 of file support.c.

◆ strtol_10

#define strtol_10 (   a,
 
)    strtol(a,b,10)

Definition at line 131 of file support.c.

◆ SUFFICIENT_SPRINTF_SPACE

#define SUFFICIENT_SPRINTF_SPACE   256

Definition at line 13 of file support.c.

Referenced by fd_printf().

Function Documentation

◆ fd_printf()

static int fd_printf ( int  fd,
const char *  format,
  ... 
)
inlinestatic

Definition at line 15 of file support.c.

References test_panda::args, and SUFFICIENT_SPRINTF_SPACE.

Referenced by generate_write_TYPE_array().

Here is the caller graph for this function:

◆ find_section_start()

char* find_section_start ( char *  s,
int  n 
)

Definition at line 56 of file support.c.

Referenced by generate_test_TYPE_array(), input_to_data(), and output_to_data().

Here is the caller graph for this function:

◆ generate_parse_TYPE_array()

generate_parse_TYPE_array ( uint8_t  ,
strtol_10   
)

Definition at line 132 of file support.c.

◆ generate_write_TYPE_array()

generate_write_TYPE_array ( uint8_t  ,
PRIu8   
)

Definition at line 177 of file support.c.

References fd_printf().

Here is the call graph for this function:

◆ parse_string()

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

Definition at line 77 of file support.c.

Referenced by input_to_data(), output_to_data(), and test_strings().

Here is the caller graph for this function:

◆ readfile()

char* readfile ( int  fd)

Definition at line 34 of file support.c.

Referenced by generate_test_TYPE_array(), input_to_data(), output_to_data(), and test_strings().

Here is the caller graph for this function:

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