init http framework
This commit is contained in:
25
src/main.cpp
Normal file
25
src/main.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user