<commit_before>#include <cpp3ds/Config.hpp>
#include <cpp3ds/System/Service.hpp>
#include <3ds.h>
#include <malloc.h>

namespace cpp3ds {

Uint16 Service::m_enabledServices = 0x0;
u32* Service::socBuffer = NULL;


bool Service::enable(ServiceName service) {
	if (isEnabled(service))
		return true;

	bool success = false;

	switch (service) {
		case ALL:
			return enable(NETWORK) && enable(AUDIO) &&
			       enable(CONFIG) && enable(ROMFS);
		case NETWORK:
			socBuffer = (u32*) memalign(0x1000, 0x100000);
			if (!socBuffer)
				break;
			if (SOC_Initialize(socBuffer, 0x100000) != 0) {
				free(socBuffer);
				socBuffer = NULL;
				break;
			}
			success = true;
			break;
		case AUDIO:
			success = csndInit() == 0;
			break;
		case CONFIG:
			initCfgu();
			success = true;
			break;
		case ROMFS:
			romfsInit();
			success = true;
			break;
		default:
			break;
	}
<commit_msg>Add RomFS success variable<commit_after>#include <cpp3ds/Config.hpp>
#include <cpp3ds/System/Service.hpp>
#include <3ds.h>
#include <malloc.h>
#include <sys/unistd.h>
#include <string.h>

namespace cpp3ds {

Uint16 Service::m_enabledServices = 0x0;
u32* Service::socBuffer = NULL;


bool Service::enable(ServiceName service) {
	if (isEnabled(service))
		return true;

	bool success = false;

	switch (service) {
		case ALL:
			return enable(NETWORK) && enable(AUDIO) &&
			       enable(CONFIG) && enable(ROMFS);
		case NETWORK:
			socBuffer = (u32*) memalign(0x1000, 0x100000);
			if (!socBuffer)
				break;
			if (SOC_Initialize(socBuffer, 0x100000) != 0) {
				free(socBuffer);
				socBuffer = NULL;
				break;
			}
			success = true;
			break;
		case AUDIO:
			success = csndInit() == 0;
			break;
		case CONFIG:
			initCfgu();
			success = true;
			break;
		case ROMFS:
			romfsInit();
			success = strcmp(getcwd(NULL,0), "romfs:/") == 0;
			break;
		default:
			break;
	}

{'fraction_non_alphanumeric': 0.1388739946380697, 'fraction_numerical': 0.03646112600536193, 'mean_word_length': 3.496385542168675, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '4096472', 'n_tokens_mistral': 842, 'n_tokens_neox': 685, 'n_words': 159}