1
0

init http framework

This commit is contained in:
2023-04-25 02:59:59 +00:00
parent f4e7319a44
commit 7b9fc827ca
12 changed files with 1693 additions and 39 deletions

25
src/main.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include "http.h"
#include <qrcodegen/qrcodegen.h>
void printQr(const std::string& text) {
int border = 1;
std::vector<uint8_t> qrcode(qrcodegen_BUFFER_LEN_MAX), tmpbuf(qrcodegen_BUFFER_LEN_MAX);
qrcodegen_encodeText(text.c_str(), tmpbuf.data(), qrcode.data(), qrcodegen_Ecc_LOW, qrcodegen_VERSION_MIN,
qrcodegen_VERSION_MAX, qrcodegen_Mask_AUTO, true);
int width = qrcodegen_getSize(qrcode.data());
for (int y = -border; y < width + border; y++) {
for (int x = -border; x < width + border; x++) {
qrcodegen_getModule(qrcode.data(), x, y) ? printf("\033[40m \033[0m") : printf("\033[47m \033[0m");
}
printf("\n");
}
printf("\n");
}
int main(int argc, char* argv[]) {
curl_global_init(CURL_GLOBAL_ALL);
curl_global_cleanup();
return 0;
}