Functions
GKlib/io.c File Reference
#include <GKlib.h>
Include dependency graph for GKlib/io.c:

Go to the source code of this file.

Functions

double * gk_dreadfilebin (char *fname, ssize_t *r_nelmnts)
 
void gk_fclose (FILE *fp)
 
FILE * gk_fopen (char *fname, char *mode, const char *msg)
 
float * gk_freadfilebin (char *fname, ssize_t *r_nelmnts)
 
size_t gk_fwritefilebin (char *fname, size_t n, float *a)
 
gk_idx_t gk_getline (char **lineptr, size_t *n, FILE *stream)
 
int32_tgk_i32readfile (char *fname, gk_idx_t *r_nlines)
 
int32_tgk_i32readfilebin (char *fname, ssize_t *r_nelmnts)
 
int64_tgk_i64readfile (char *fname, gk_idx_t *r_nlines)
 
int64_tgk_i64readfilebin (char *fname, ssize_t *r_nelmnts)
 
char ** gk_readfile (char *fname, gk_idx_t *r_nlines)
 

Function Documentation

double* gk_dreadfilebin ( char *  fname,
ssize_t r_nelmnts 
)

This function reads the contents of a binary file and returns it in the form of an array of double.

Parameters
fnameis the name of the file
r_nlinesis the number of lines in the file. If it is NULL, this information is not returned.

Definition at line 354 of file GKlib/io.c.

void gk_fclose ( FILE *  fp)

Definition at line 44 of file GKlib/io.c.

FILE* gk_fopen ( char *  fname,
char *  mode,
const char *  msg 
)

Definition at line 24 of file GKlib/io.c.

float* gk_freadfilebin ( char *  fname,
ssize_t r_nelmnts 
)

This function reads the contents of a binary file and returns it in the form of an array of float.

Parameters
fnameis the name of the file
r_nlinesis the number of lines in the file. If it is NULL, this information is not returned.

Definition at line 292 of file GKlib/io.c.

size_t gk_fwritefilebin ( char *  fname,
size_t  n,
float *  a 
)

This function writes the contents of an array into a binary file.

Parameters
fnameis the name of the file
nthe number of elements in the array.
athe array to be written out.

Definition at line 331 of file GKlib/io.c.

gk_idx_t gk_getline ( char **  lineptr,
size_t n,
FILE *  stream 
)

This function is the GKlib implementation of glibc's getline() function.

Returns
-1 if the EOF has been reached, otherwise it returns the number of bytes read.

Definition at line 57 of file GKlib/io.c.

int32_t* gk_i32readfile ( char *  fname,
gk_idx_t r_nlines 
)

This function reads the contents of a file and returns it in the form of an array of int32_t.

Parameters
fnameis the name of the file
r_nlinesis the number of lines in the file. If it is NULL, this information is not returned.

Definition at line 139 of file GKlib/io.c.

int32_t* gk_i32readfilebin ( char *  fname,
ssize_t r_nelmnts 
)

This function reads the contents of a binary file and returns it in the form of an array of int32_t.

Parameters
fnameis the name of the file
r_nlinesis the number of lines in the file. If it is NULL, this information is not returned.

Definition at line 214 of file GKlib/io.c.

int64_t* gk_i64readfile ( char *  fname,
gk_idx_t r_nlines 
)

This function reads the contents of a file and returns it in the form of an array of int64_t.

Parameters
fnameis the name of the file
r_nlinesis the number of lines in the file. If it is NULL, this information is not returned.

Definition at line 177 of file GKlib/io.c.

int64_t* gk_i64readfilebin ( char *  fname,
ssize_t r_nelmnts 
)

This function reads the contents of a binary file and returns it in the form of an array of int64_t.

Parameters
fnameis the name of the file
r_nlinesis the number of lines in the file. If it is NULL, this information is not returned.

Definition at line 253 of file GKlib/io.c.

char** gk_readfile ( char *  fname,
gk_idx_t r_nlines 
)

This function reads the contents of a text file and returns it in the form of an array of strings.

Parameters
fnameis the name of the file
r_nlinesis the number of lines in the file. If it is NULL, this information is not returned.

Definition at line 103 of file GKlib/io.c.



gtsam
Author(s):
autogenerated on Sat May 8 2021 02:51:30