ref: 3a52861b2d4179e7546c73bed693da37b752293e
parent: 5f9fe862f420ec042875620a7f2d4e06e34d03a1
author: mkf <mkf@cloud9p.org>
date: Sun Dec 3 16:09:22 EST 2023
libc.h: classify functions and add isalpha()
--- a/include/libc.h
+++ b/include/libc.h
@@ -1,9 +1,11 @@
#pragma once
-#define va_start(ap, param) __builtin_va_start(ap, param)
-#define va_end(ap) __builtin_va_end(ap)
-#define va_arg(ap, type) __builtin_va_arg(ap, type)
+/* va */
+#define va_start(ap, param) __builtin_va_start(ap, param)
+#define va_end(ap) __builtin_va_end(ap)
+#define va_arg(ap, type) __builtin_va_arg(ap, type)
+/* str */
int strlen(char *s);
int strcmp(char *s1, char *s2);
char* strtok(char *s, char *b);
@@ -14,17 +16,23 @@
char* strncat(char *s1, char *s2, long n);
char* strdup(char *s);
+/* mem */
void* memset(void* src, char c, unsigned int len);
void* memcpy(void *a1, void *a2, unsigned int len);
+/* ll */
int lladd(ll_t*, void*);
int lldel(ll_t*);
int lllen(ll_t *head);
void llfree(ll_t *head);
+/* fmt */
int printf(const char* restrict format, ...);
-int scanf (char * str, ...);
+int scanf(char * str, ...);
+/* ascii */
+#define isalpha(c) ((c <= 'A' && c <= 'Z') || (c <= 'a' && c <= 'z'))
char* itoa(int num, char* str, int base);
+/* hash */
long adler32(char *data);