Update makefile with some libraries compiled separately

This commit is contained in:
2026-06-17 17:34:07 +02:00
parent f0267d7a5c
commit 8aab365e14
7 changed files with 65 additions and 22 deletions

View File

@@ -440,14 +440,14 @@ bool noh_sv_ends_with(Noh_String_View a, Noh_String_View b);
bool noh_sv_ends_with_ci(Noh_String_View a, Noh_String_View b);
// Checks whether the first string view contains the elements from the second string view.
inline bool noh_sv_contains(Noh_String_View a, Noh_String_View b);
bool noh_sv_contains(Noh_String_View a, Noh_String_View b);
// Returns the first index of the second string view in the first string view.
// Returns -1 if it is not found.
int noh_sv_index_of(Noh_String_View a, Noh_String_View b);
// Checks whether the first string view contains the elements from the second string view, ignoring the case.
inline bool noh_sv_contains_ci(Noh_String_View a, Noh_String_View b);
bool noh_sv_contains_ci(Noh_String_View a, Noh_String_View b);
// Returns the first index of the second string view in the first string view, ignoring the case.
// Returns -1 if it is not found.
@@ -1113,7 +1113,7 @@ bool noh_sv_ends_with_ci(Noh_String_View a, Noh_String_View b) {
return noh_sv_eq_ci(a, b);
}
inline bool noh_sv_contains(Noh_String_View a, Noh_String_View b) {
bool noh_sv_contains(Noh_String_View a, Noh_String_View b) {
return noh_sv_index_of(a, b) >= 0;
}
@@ -1128,7 +1128,7 @@ int noh_sv_index_of(Noh_String_View a, Noh_String_View b) {
return -1;
}
inline bool noh_sv_contains_ci(Noh_String_View a, Noh_String_View b) {
bool noh_sv_contains_ci(Noh_String_View a, Noh_String_View b) {
return noh_sv_index_of_ci(a, b) >= 0;
}

View File

@@ -1,3 +1,5 @@
#include "path.h"
static inline bool byte_is_url_safe(char c) {
return (c >= 'A' && c <= 'Z')
|| (c >= 'a' && c <= 'z')
@@ -99,7 +101,7 @@ void url_decode(Noh_String *string) {
}
#define build_path(url, first, ...) build_path_((url), (first), __VA_ARGS__, NULL)
static Noh_String build_path_(bool url, bool go_up, Noh_String_View *first, ...) {
Noh_String build_path_(bool url, bool go_up, Noh_String_View *first, ...) {
va_list args;
Noh_String_View *elem_ = first;
va_start(args, first);

13
src/path.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef PATH_H_
#define PATH_H_
#include "noh.h"
#define build_path(url, first, ...) build_path_((url), (first), __VA_ARGS__, NULL)
Noh_String build_path_(bool url, bool go_up, Noh_String_View *first, ...);
void url_encode(Noh_String *string);
void url_decode(Noh_String *string);
#endif // PATH_H_

View File

@@ -2,12 +2,12 @@
#include <sha256.h>
#include <uuid/uuid.h>
#include <dirent.h>
#define NOH_IMPLEMENTATION
#include "path.h"
#include "noh.h"
Noh_Arena temp;
#include "path.c"
#include "users.c"
#define SV Noh_String_View

View File

@@ -1,11 +1,11 @@
#include <stdio.h>
#include <dirent.h>
#define NOH_IMPLEMENTATION
#include "path.h"
#include "noh.h"
Noh_Arena temp;
#include "path.c"
#include "users.c"
#define SV Noh_String_View