<commit_before>#ifndef SSTRING_H_INCLUDED
#define SSTRING_H_INCLUDED

#include <stdlib.h>
#include <stdint.h>

#define restrict __restrict__

typedef struct SString {
	size_t length;
	size_t size;
	char * string;
} SString;


// Static allocation of a SString
#define SSTRING(str) (SString){ sizeof(str)-1 , sizeof(str) , str }


/* Creates a SString with characters from a C-string either fully or up to
 * size - 1 if it's smaller than the whole string and allocates size amount of
 * characters for SString's string.
 *     If string is NULL, then it just allocates memory as long as size isn't 0.
 * Otherwise it just sets the variables members of the struct. If string isn't
 * NULL and size is 0, then it will only allocate as much memory as it needs to
 * hold the string including '/0'.
 *     Returns pointer to the initialized SString or NULL on failure.
 */
SString *
new_sstring(const char * restrict string,
            size_t size) ;


/* Empties a SString, but doesn't free any memory.
 */
void
empty_sstring(SString * restrict str) ;

void
empty_sstring(SString * str) ;

/* Frees the memory allocated for SString.
 */
void
free_sstring(SString * restrict str) ;


/* Makes num bytes in memory 0.
 *     memory is the memory that is going to get edited, num is the amount of
 * bytes that will be changed.
 *     Returns pointer to the start of the edited memory.
 */
void *
s_memnull(void * restrict memory,
          size_t num) ;

void *
s_memnull2(void *memory,
           size_t num) ;

void *
s_memnull3(void * restrict memory,
           size_t num) ;

void *
s_memnull4(void * memory,<commit_msg>Forgot to add 2 for some reason.<commit_after>#ifndef SSTRING_H_INCLUDED
#define SSTRING_H_INCLUDED

#include <stdlib.h>
#include <stdint.h>

#define restrict __restrict__

typedef struct SString {
	size_t length;
	size_t size;
	char * string;
} SString;


// Static allocation of a SString
#define SSTRING(str) (SString){ sizeof(str)-1 , sizeof(str) , str }


/* Creates a SString with characters from a C-string either fully or up to
 * size - 1 if it's smaller than the whole string and allocates size amount of
 * characters for SString's string.
 *     If string is NULL, then it just allocates memory as long as size isn't 0.
 * Otherwise it just sets the variables members of the struct. If string isn't
 * NULL and size is 0, then it will only allocate as much memory as it needs to
 * hold the string including '/0'.
 *     Returns pointer to the initialized SString or NULL on failure.
 */
SString *
new_sstring(const char * restrict string,
            size_t size) ;


/* Empties a SString, but doesn't free any memory.
 */
void
empty_sstring(SString * restrict str) ;

void
empty_sstring2(SString * str) ;

/* Frees the memory allocated for SString.
 */
void
free_sstring(SString * restrict str) ;


/* Makes num bytes in memory 0.
 *     memory is the memory that is going to get edited, num is the amount of
 * bytes that will be changed.
 *     Returns pointer to the start of the edited memory.
 */
void *
s_memnull(void * restrict memory,
          size_t num) ;

void *
s_memnull2(void *memory,
           size_t num) ;

void *
s_memnull3(void * restrict memory,
           size_t num) ;

void *
s_memnull4(void * memory,
{'fraction_non_alphanumeric': 0.07822085889570553, 'fraction_numerical': 0.006134969325153374, 'mean_word_length': 3.3249336870026527, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '439215', 'n_tokens_mistral': 1031, 'n_tokens_neox': 992, 'n_words': 425}