/* $Id$ */
/* --- START LICENSE --- */
/* -------------------------------------------------------------------------- */
-/* Mandshurica - Build Automation */
+/* Mandshurica - Build Automation */
/* -------------------------------------------------------------------------- */
/* Copyright (c) 2024 Nishi. */
/* Redistribution and use in source and binary forms, with or without modific */
/* $Id$ */
/* --- START LICENSE --- */
/* -------------------------------------------------------------------------- */
-/* Mandshurica - Build Automation */
+/* Mandshurica - Build Automation */
/* -------------------------------------------------------------------------- */
/* Copyright (c) 2024 Nishi. */
/* Redistribution and use in source and binary forms, with or without modific */
/* $Id$ */
/* --- START LICENSE --- */
/* -------------------------------------------------------------------------- */
-/* Mandshurica - Build Automation */
+/* Mandshurica - Build Automation */
/* -------------------------------------------------------------------------- */
/* Copyright (c) 2024 Nishi. */
/* Redistribution and use in source and binary forms, with or without modific */
/* $Id$ */
/* --- START LICENSE --- */
/* -------------------------------------------------------------------------- */
-/* Mandshurica - Build Automation */
+/* Mandshurica - Build Automation */
/* -------------------------------------------------------------------------- */
/* Copyright (c) 2024 Nishi. */
/* Redistribution and use in source and binary forms, with or without modific */
/* $Id$ */
/* --- START LICENSE --- */
/* -------------------------------------------------------------------------- */
-/* Mandshurica - Build Automation */
+/* Mandshurica - Build Automation */
/* -------------------------------------------------------------------------- */
/* Copyright (c) 2024 Nishi. */
/* Redistribution and use in source and binary forms, with or without modific */
/* $Id$ */
/* --- START LICENSE --- */
/* -------------------------------------------------------------------------- */
-/* Mandshurica - Build Automation */
+/* Mandshurica - Build Automation */
/* -------------------------------------------------------------------------- */
/* Copyright (c) 2024 Nishi. */
/* Redistribution and use in source and binary forms, with or without modific */
/* $Id$ */
/* --- START LICENSE --- */
/* -------------------------------------------------------------------------- */
-/* Mandshurica - Build Automation */
+/* Mandshurica - Build Automation */
/* -------------------------------------------------------------------------- */
/* Copyright (c) 2024 Nishi. */
/* Redistribution and use in source and binary forms, with or without modific */
/* $Id$ */
/* --- START LICENSE --- */
/* -------------------------------------------------------------------------- */
-/* Mandshurica - Build Automation */
+/* Mandshurica - Build Automation */
/* -------------------------------------------------------------------------- */
/* Copyright (c) 2024 Nishi. */
/* Redistribution and use in source and binary forms, with or without modific */
#include "ms_util.h"
+#include <ctype.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
char* mandshurica_strcat(const char* str1, const char* str2) {
char* str = malloc(strlen(str1) + strlen(str2) + 1);
bool mandshurica_strequ(const char* str1, const char* str2) {
if(strlen(str1) != strlen(str2)) return false;
int i;
- for(i = 0; str1[i] != 0; i++){
+ for(i = 0; str1[i] != 0; i++) {
if(str1[i] != str2[i]) return false;
}
return true;
bool mandshurica_strcaseequ(const char* str1, const char* str2) {
if(strlen(str1) != strlen(str2)) return false;
int i;
- for(i = 0; str1[i] != 0; i++){
+ for(i = 0; str1[i] != 0; i++) {
if(tolower(str1[i]) != tolower(str2[i])) return false;
}
return true;
/* $Id$ */
/* --- START LICENSE --- */
/* -------------------------------------------------------------------------- */
-/* Mandshurica - Build Automation */
+/* Mandshurica - Build Automation */
/* -------------------------------------------------------------------------- */
/* Copyright (c) 2024 Nishi. */
/* Redistribution and use in source and binary forms, with or without modific */
if(header[j] != 0) {
char* key = header;
char* value = header + j;
- if(headers == NULL){
+ if(headers == NULL) {
headers = malloc(sizeof(*headers));
headers[0] = NULL;
}
char** old_headers = headers;
int k;
- for(k = 0; headers[k] != NULL; k++);
+ for(k = 0; headers[k] != NULL; k++)
+ ;
headers = malloc(sizeof(*headers) * (k + 3));
- for(k = 0; old_headers[k] != NULL; k++){
+ for(k = 0; old_headers[k] != NULL; k++) {
headers[k] = old_headers[k];
}
headers[k] = mandshurica_strdup(key);
/* $Id$ */
/* --- START LICENSE --- */
/* -------------------------------------------------------------------------- */
-/* Mandshurica - Build Automation */
+/* Mandshurica - Build Automation */
/* -------------------------------------------------------------------------- */
/* Copyright (c) 2024 Nishi. */
/* Redistribution and use in source and binary forms, with or without modific */
/* $Id$ */
/* --- START LICENSE --- */
/* -------------------------------------------------------------------------- */
-/* Mandshurica - Build Automation */
+/* Mandshurica - Build Automation */
/* -------------------------------------------------------------------------- */
/* Copyright (c) 2024 Nishi. */
/* Redistribution and use in source and binary forms, with or without modific */