27 lines
519 B
C
27 lines
519 B
C
//
|
|
// Created by cfif on 13.10.22.
|
|
//
|
|
|
|
#include <string.h>
|
|
#include "BaseTypes.h"
|
|
|
|
uint8_t getStrLen(char *str) {
|
|
uint8_t len = 0;
|
|
while (str[len]) {
|
|
++len;
|
|
}
|
|
return len;
|
|
}
|
|
|
|
void vInitString(tString *tstr, void *str, uint8_t length, uint8_t max_length, uint8_t readonly) {
|
|
|
|
tstr->length = length;
|
|
tstr->max_length = max_length;
|
|
tstr->readonly = readonly;
|
|
memcpy(tstr->str, str, length);
|
|
|
|
}
|
|
|
|
void vInitStringOnlyLength(tString *tstr, uint8_t length) {
|
|
tstr->length = length;
|
|
} |