grblHAL core  20250225
strutils.c File Reference
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include "strutils.h"

Macros

#define CAPS(c)   ((c >= 'a' && c <= 'z') ? c & 0x5F : c)
 

Functions

char * stristr (const char *s1, const char *s2)
 Case insensitive search for first occurrence of a string inside another. More...
 
char * strnistr (const char *s1, const char *s2, size_t len)
 Case insensitive search for first occurrence of a string inside another. More...
 
char * strappend (char *buf, int argc,...)
 
uint32_t strnumentries (const char *s, const char delimiter)
 
char * strgetentry (char *res, const char *s, uint32_t entry, const char delimiter)
 
int32_t strlookup (const char *s1, const char *s2, const char delimiter)
 
bool strtotime (char *s, struct tm *time)
 
char * strtoisodt (struct tm *dt)
 
char * strtointernetdt (struct tm *dt)
 

Macro Definition Documentation

◆ CAPS

#define CAPS (   c)    ((c >= 'a' && c <= 'z') ? c & 0x5F : c)

Function Documentation

◆ strappend()

char* strappend ( char *  buf,
int  argc,
  ... 
)

◆ strgetentry()

char* strgetentry ( char *  res,
const char *  s,
uint32_t  entry,
const char  delimiter 
)

◆ stristr()

char* stristr ( const char *  s1,
const char *  s2 
)

Case insensitive search for first occurrence of a string inside another.

Parameters
s1pointer to string to search.
s2pointer to string to search for.
Returns
pointer to found string or NULL if not found.

◆ strlookup()

int32_t strlookup ( const char *  s1,
const char *  s2,
const char  delimiter 
)

◆ strnistr()

char* strnistr ( const char *  s1,
const char *  s2,
size_t  len 
)

Case insensitive search for first occurrence of a string inside another.

Parameters
s1pointer to string to search.
s2pointer to string to search for.
lenmax. number of characters to compare.
Returns
pointer to found string or NULL if not found.

◆ strnumentries()

uint32_t strnumentries ( const char *  s,
const char  delimiter 
)

◆ strtointernetdt()

char* strtointernetdt ( struct tm dt)

◆ strtoisodt()

char* strtoisodt ( struct tm dt)

◆ strtotime()

bool strtotime ( char *  s,
struct tm time 
)