ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbString.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <ngc/core/ngcb.h>

Macros

#define _GNU_SOURCE
 
#define _REENTRANT
 

Functions

void ngcbToLower (char *s)
 
void ngcbToUpper (char *s)
 
void ngcbCleanSpace (char *s)
 
void ngcbTrimSpace (char *s)
 
void ngcbStrPut (char *s1, const char *s2)
 
int ngcbReplaceEnv (char *string, char *erms)
 
int ngcbIsFloat (const char *s)
 
void ngcbStr2Arg (char *s, int *argc, char **argv)
 
char * ngcbStr2Str (char *s1, const char *s2, size_t n)
 
int ngcbStr2Int (const char *s, int *value)
 
int ngcbStr2UInt (const char *s, unsigned int *value)
 
int ngcbHex2Int (const char *s, int *value)
 
int ngcbHex2UInt (const char *s, unsigned int *value)
 
int ngcbFmt2Int (const char *s, int *value)
 
int ngcbFmt2UInt (const char *s, unsigned int *value)
 
int ngcbStr2Int16 (const char *s, short *value)
 
int ngcbStr2UInt16 (const char *s, unsigned short *value)
 
int ngcbHex2Int16 (const char *s, short *value)
 
int ngcbHex2UInt16 (const char *s, unsigned short *value)
 
int ngcbStr2Float (const char *s, float *value)
 
int ngcbStr2Double (const char *s, double *value)
 
int ngcbF2S (const char *s, const char *filter, char *v)
 
int ngcbF2Int (const char *s, const char *filter)
 
unsigned int ngcbF2UInt (const char *s, const char *filter)
 
int ngcbF2Double (const char *s, const char *filter, double *v)
 
int ngcbStr2Frac (const char *value, unsigned int n, uint64_t *v1, uint64_t *v2)
 

Detailed Description

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ _REENTRANT

#define _REENTRANT

Function Documentation

◆ ngcbCleanSpace()

void ngcbCleanSpace ( char * s)

Remove all extra spaces in string.

◆ ngcbF2Double()

int ngcbF2Double ( const char * s,
const char * filter,
double * v )

Get filtered string option (double precision floating point).

◆ ngcbF2Int()

int ngcbF2Int ( const char * s,
const char * filter )

Get filtered string option (32-bit signed integer).

◆ ngcbF2S()

int ngcbF2S ( const char * s,
const char * filter,
char * v )

Get filtered string option.

◆ ngcbF2UInt()

unsigned int ngcbF2UInt ( const char * s,
const char * filter )

Get filtered string option (32-bit unsigned integer).

◆ ngcbFmt2Int()

int ngcbFmt2Int ( const char * s,
int * value )

Get 32-bit signed integer value from string, using 0x and 0b as format indicator.

◆ ngcbFmt2UInt()

int ngcbFmt2UInt ( const char * s,
unsigned int * value )

Get 32-bit unsigned signed integer value from string, using "0x" and "0b" as format indicator.

◆ ngcbHex2Int()

int ngcbHex2Int ( const char * s,
int * value )

Get 32-bit signed integer value from hexadecimal keyword string.

◆ ngcbHex2Int16()

int ngcbHex2Int16 ( const char * s,
short * value )

Get 16-bit signed integer value from hexadecimal keyword string.

◆ ngcbHex2UInt()

int ngcbHex2UInt ( const char * s,
unsigned int * value )

Get 32-bit unsigned integer value from hexadecimal keyword string.

◆ ngcbHex2UInt16()

int ngcbHex2UInt16 ( const char * s,
unsigned short * value )

Get 16-bit unsigned integer value from hexadecimal keyword string.

◆ ngcbIsFloat()

int ngcbIsFloat ( const char * s)

Return 1, if the string represents a floating point number, otherwise zero is returned.

◆ ngcbReplaceEnv()

int ngcbReplaceEnv ( char * string,
char * erms )

Replace the environment variables in the given string.

◆ ngcbStr2Arg()

void ngcbStr2Arg ( char * s,
int * argc,
char ** argv )

Convert a string to command line arguments.

◆ ngcbStr2Double()

int ngcbStr2Double ( const char * s,
double * value )

Get double precision floating point value from keyword string.

◆ ngcbStr2Float()

int ngcbStr2Float ( const char * s,
float * value )

Get single precision floating point value from string.

◆ ngcbStr2Frac()

int ngcbStr2Frac ( const char * value,
unsigned int n,
uint64_t * v1,
uint64_t * v2 )

Fraction with binary fixed-point after n digits

◆ ngcbStr2Int()

int ngcbStr2Int ( const char * s,
int * value )

Get 32-bit signed integer value from decimal string.

◆ ngcbStr2Int16()

int ngcbStr2Int16 ( const char * s,
short * value )

Get 16-bit signed integer value from decimal string.

◆ ngcbStr2Str()

char * ngcbStr2Str ( char * s1,
const char * s2,
size_t n )

Copy n characters of one string to another (null terminated).

◆ ngcbStr2UInt()

int ngcbStr2UInt ( const char * s,
unsigned int * value )

Get 32-bit unsigned integer value from decimal keyword string.

◆ ngcbStr2UInt16()

int ngcbStr2UInt16 ( const char * s,
unsigned short * value )

Get 16-bit unsigned integer value from decimal keyword string.

◆ ngcbStrPut()

void ngcbStrPut ( char * s1,
const char * s2 )

Put string s2 ahead of string s1.

◆ ngcbToLower()

void ngcbToLower ( char * s)

Convert all characters in string to lower case.

◆ ngcbToUpper()

void ngcbToUpper ( char * s)

Convert all characters in string to upper case.

◆ ngcbTrimSpace()

void ngcbTrimSpace ( char * s)

Remove leading and trailing spaces in string.