rsLQR
0.1
|
Provides basic functions like powers of 2 and reading files to a string. More...
#include <stdbool.h>
Go to the source code of this file.
Functions | |
bool | IsPowerOfTwo (int x) |
Determines if the input integer is a power of 2. | |
void | ndlqr_LinAlgTimeStart () |
void | ndlqr_LinAlgTimeStop () |
int | LogOfTwo (int x) |
Efficient computation of log2(x) for integers. | |
int | ReadFile (const char *filename, char **out, int *len) |
Read the contents of a file into a heap-allocated char array. More... | |
Provides basic functions like powers of 2 and reading files to a string.
int ReadFile | ( | const char * | filename, |
char ** | out, | ||
int * | len | ||
) |
Read the contents of a file into a heap-allocated char
array.
It is the user's responsibility to call free
on out
after the string data is allocated.
The following example reads
filename | Name of the file to read. |
out | Pointer to the array (pointer) to the heap-allocated string data. |
len | Length of the string data. |