Sha256: bde0c5e8ef8bdab377ad730d860c20e6547c285ae73d7ef181579df7217c19bb

Contents?: true

Size: 744 Bytes

Versions: 50

Compression:

Stored size: 744 Bytes

Contents

#include "headers.h"

bool strequal(const char* const restrict string1, const char* const restrict string2) {
	u64 i;
	
	for (i = 0 ;; ++i) {
		if (!ARRAY_INDEX(string1, i)) {
			return !ARRAY_INDEX(string2, i);
		}
		if (!ARRAY_INDEX(string2, i)) {
			return !ARRAY_INDEX(string1, i);
		}
		if (ARRAY_INDEX(string1, i) != ARRAY_INDEX(string2, i)) return false;
	}
}

bool strnequal(const char* const restrict string1, const char* const restrict string2, const u64 length1, const u64 length2) {
	u64 i;
	
	assert_comparison(string1, !=, NULL);
	assert_comparison(string2, !=, NULL);
	
	if (length1 != length2) return false;
	i = length1;
	while (i--) {
		if (ARRAY_INDEX(string1, i) != ARRAY_INDEX(string2, i)) return false;
	}
	return true;
}

Version data entries

50 entries across 49 versions & 6 rubygems

Version Path
freespeech-1.0.88 ./other/old_compiler/shiltium7 (2)/string_comparison.c
elonmusk-1.0.88 ./other/old_compiler/shiltium7 (2)/string_comparison.c
politics-1.0.88 ./other/old_compiler/shiltium7 (2)/string_comparison.c
democracy-1.0.86 ./other/old_compiler/shiltium7 (2)/string_comparison.c
politics-1.0.82 ./other/old_compiler/shiltium7 (2)/string_comparison.c
freespeech-1.0.82 ./other/old_compiler/shiltium7 (2)/string_comparison.c
elonmusk-1.0.82 ./other/old_compiler/shiltium7 (2)/string_comparison.c
ufos-1.0.82 ./other/old_compiler/shiltium7 (2)/string_comparison.c
aliens-1.0.82 ./other/old_compiler/shiltium7 (2)/string_comparison.c
politics-1.0.81 ./other/old_compiler/shiltium7 (2)/string_comparison.c
ufos-1.0.79 ./other/old_compiler/shiltium7 (2)/string_comparison.c
aliens-1.0.79 ./other/old_compiler/shiltium7 (2)/string_comparison.c
freespeech-1.0.79 ./other/old_compiler/shiltium7 (2)/string_comparison.c
elonmusk-1.0.79 ./other/old_compiler/shiltium7 (2)/string_comparison.c
elonmusk-1.0.77 ./other/old_compiler/shiltium7 (2)/string_comparison.c
ufos-1.0.77 ./other/old_compiler/shiltium7 (2)/string_comparison.c
aliens-1.0.77 ./other/old_compiler/shiltium7 (2)/string_comparison.c
freespeech-1.0.77 ./other/old_compiler/shiltium7 (2)/string_comparison.c
elonmusk-1.0.72 ./other/old_compiler/shiltium7 (2)/string_comparison.c
ufos-1.0.72 ./other/old_compiler/shiltium7 (2)/string_comparison.c