diff --git a/helper.h b/helper.h new file mode 100644 index 0000000..add3d95 --- /dev/null +++ b/helper.h @@ -0,0 +1,25 @@ +/* -------------------------------------------------------------- +* File : helper.h +* Authors : Aoran Zeng +* Created on : <2023-08-28> +* Last modified : <2023-08-28> +* +* helper: +* +* helper functions and macros +* -------------------------------------------------------------*/ + +#include +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) + +char* +xy_strjoin(const char* str1, const char* str2) +{ + size_t len = strlen(str1) + strlen(str2) + 1; + char* ret = malloc(len); + strcat(ret, str1); + strcat(ret, str2); + return ret; +}