This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <glad/glad.h> | |
#include <GLFW/glfw3.h> | |
#include <stdio.h> | |
#include <stdbool.h> | |
/* | |
* An iteration of the render loop is more commonly called a frame. | |
*/ | |
void framebuffer_size_callback(GLFWwindow* window, int width, int height) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void error_reporter(const char* sentence, const char* error_message, size_t offset) { | |
#define extra_error_offset 7 | |
#define extra_error_prefix "^ --- " | |
#define extra_error_prefix_size 6 | |
u8 n_offset = offset + extra_error_offset; | |
eprintln("Error: %s", sentence); | |
eprintln("%*s%s", n_offset, "^", error_message); // this does work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef FTODO_HPP | |
#define FTODO_HPP | |
#include <string_view> | |
#include <vector> | |
#include <filesystem> | |
#include <cstring> | |
#include <cassert> | |
#include <memory> | |
#include <optional> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <curl/curl.h> | |
CURL* xcurl_easy_init() { | |
CURL* curl = curl_easy_init(); | |
if (!curl) exit(0); | |
return curl; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdbool.h> | |
void While(bool *func()) { | |
LOOP: | |
if (func()) { | |
goto LOOP; | |
} else { | |
goto DONE; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <optional> | |
#include <iterator> | |
#include <fstream> | |
#include <cassert> | |
#include <map> | |
const char* filename = "mfclib/source/file.c"; | |
namespace Utils { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T, typename It> auto split(It begin, It end, char delm) { | |
It cursor = begin; | |
It token; | |
T sv_line; | |
std::vector<T> v_sv; | |
while (cursor != end) { | |
token = std::find(cursor, end, delm); | |
if (token != end) { | |
sv_line = std::string(cursor, token); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct stringstream { | |
std::string stream; | |
stringstream() = default; | |
stringstream(std::string_view&& sv) : stream { std::move(sv) } | |
{} | |
std::string str() { | |
return stream; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int num = 10; | |
LOOP: | |
if (--num) { | |
printf("%d ", num); | |
goto LOOP; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iterator> | |
#include <vector> | |
#include <algorithm> | |
#include <functional> | |
using namespace std; | |
template<typename It, typename OutIt> | |
OutIt printContainer(It begin, It end, OutIt ot) { |
NewerOlder