BFLibC 0.1
C Library
Loading...
Searching...
No Matches
coreutils.h File Reference
#include <stdbool.h>
Include dependency graph for coreutils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define kBFByteKiloByte   1000
 
#define kBFByteMegaByte   (long long) (kBFByteKiloByte * kBFByteKiloByte)
 
#define kBFByteGigaByte   (long long) (kBFByteMegaByte * kBFByteKiloByte)
 
#define kBFByteTeraByte   (long long) (kBFByteGigaByte * kBFByteKiloByte)
 
#define kBFByteKibiByte   1024
 
#define kBFByteMebiByte   (long long) (kBFByteKibiByte * kBFByteKibiByte)
 
#define kBFByteGibiByte   (long long) (kBFByteMebiByte * kBFByteKibiByte)
 
#define kBFByteTebiByte   (long long) (kBFByteGibiByte * kBFByteKibiByte)
 

Functions

void BFErrorPrint (const char *format,...)
 
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 size, int *err)
 

Macro Definition Documentation

◆ kBFByteGibiByte

#define kBFByteGibiByte   (long long) (kBFByteMebiByte * kBFByteKibiByte)

◆ kBFByteGigaByte

#define kBFByteGigaByte   (long long) (kBFByteMegaByte * kBFByteKiloByte)

◆ kBFByteKibiByte

#define kBFByteKibiByte   1024

◆ kBFByteKiloByte

#define kBFByteKiloByte   1000

author: Brando date: 6/2/22

◆ kBFByteMebiByte

#define kBFByteMebiByte   (long long) (kBFByteKibiByte * kBFByteKibiByte)

◆ kBFByteMegaByte

#define kBFByteMegaByte   (long long) (kBFByteKiloByte * kBFByteKiloByte)

◆ kBFByteTebiByte

#define kBFByteTebiByte   (long long) (kBFByteGibiByte * kBFByteKibiByte)

◆ kBFByteTeraByte

#define kBFByteTeraByte   (long long) (kBFByteGigaByte * kBFByteKiloByte)

Function Documentation

◆ BFArrayStringContainsString()

bool BFArrayStringContainsString ( char ** strArr,
int arrSize,
const char * element )

Sweeps the array to see of it contains the string specified by element

◆ BFArrayStringGetIndexForString()

int BFArrayStringGetIndexForString ( char ** strArr,
int arrSize,
const char * element )

returns -1 if string could not be found

◆ BFByteGetString()

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

Here is the call graph for this function:

◆ BFErrorPrint()

void BFErrorPrint ( const char * format,
... )

Prints std error

author: Brando date: 6/2/22

◆ BFNetGetIPForHostname()

int BFNetGetIPForHostname ( const char * hostname,
char * ip )

returns the ip address for the hostname

◆ BFStringCreateBinaryStringForNumber()

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