|
BFLibC 0.1
C Library
|
#include "coreutils.h"#include <stdio.h>#include <string.h>#include <stdarg.h>#include <libgen.h>#include <stdbool.h>#include <sys/stat.h>#include <sys/statvfs.h>#include <dirent.h>#include <sys/types.h>#include <stdlib.h>#include <netdb.h>#include <arpa/inet.h>
Functions | |
| void | BFErrorPrint (const char *format,...) |
| double | ConvertValueToScale (unsigned long long value, long long scale) |
| int | BFByteGetString (unsigned long long byteSize, unsigned char options, char *outStr) |
| bool | BFArrayStringContainsString (char **strArr, int arrSize, const char *element) |
| int | BFArrayStringGetIndexForString (char **strArr, int arrSize, const char *element) |
| int | BFNetGetIPForHostname (const char *hostname, char *ip) |
| char * | BFStringCreateBinaryStringForNumber (long long num, int byteSize, int *err) |
| bool BFArrayStringContainsString | ( | char ** | strArr, |
| int | arrSize, | ||
| const char * | element ) |
Sweeps the array to see of it contains the string specified by element
| int BFArrayStringGetIndexForString | ( | char ** | strArr, |
| int | arrSize, | ||
| const char * | element ) |
returns -1 if string could not be found
| int BFByteGetString | ( | unsigned long long | byteSize, |
| unsigned char | options, | ||
| char * | outStr ) |
Creates a string that represents the byteSize
outStr needs to be a valid string buffer that can accept at least 10 bytes of data options : ||||||||0=KiloByte, 1=KibiByte|
returns 0 on success, anything else is an error

| void BFErrorPrint | ( | const char * | format, |
| ... ) |
author: Brando date: 6/2/22
| int BFNetGetIPForHostname | ( | const char * | hostname, |
| char * | ip ) |
returns the ip address for the hostname
| char * BFStringCreateBinaryStringForNumber | ( | long long | num, |
| int | size, | ||
| int * | err ) |
Creates binary string representation of the num variable (you know since printf() can't print in binary format
size: byte size of num
Caller must free
| double ConvertValueToScale | ( | unsigned long long | value, |
| long long | scale ) |
Converts the value to the level specified by scale