33 lines
689 B
C
33 lines
689 B
C
|
|
/* This software is licensed by the MIT License, see LICENSE file */
|
||
|
|
/* Copyright © 2022 Gregory Lirent */
|
||
|
|
|
||
|
|
#include "../../modules/libunic/include.h"
|
||
|
|
#include "../../include/extra/string.h"
|
||
|
|
#include "../__internal/include.h"
|
||
|
|
|
||
|
|
#ifndef LIBCDSB_SRC_STRING_INCLUDE_H
|
||
|
|
#define LIBCDSB_SRC_STRING_INCLUDE_H
|
||
|
|
|
||
|
|
ainline(char* next_char(char* s)) {
|
||
|
|
int cs = charsize(s);
|
||
|
|
|
||
|
|
if (cs) return s + cs;
|
||
|
|
return ++s;
|
||
|
|
}
|
||
|
|
|
||
|
|
ainline(char* prev_char(char* s)) {
|
||
|
|
|
||
|
|
if (*(--s)&0x80) {
|
||
|
|
char* p = s;
|
||
|
|
|
||
|
|
while ((*(--p)&0xc0) == 0x80) {}
|
||
|
|
|
||
|
|
if (charsize(p) == s - p)
|
||
|
|
return p;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s;
|
||
|
|
}
|
||
|
|
|
||
|
|
#endif /* LIBCDSB_SRC_STRING_INCLUDE_H */
|