This is a very simple HTTP server for Unix, using fork(). It's very easy to use
- include header
httpd.h - write your route method, handling requests.
- call
serve_forever("12913")to start serving on port 12913
| #ifndef BACKTRACE_UTILS_h | |
| #define BACKTRACE_UTILS_h | |
| // ref: http://stackoverflow.com/questions/8115192/android-ndk-getting-the-backtrace | |
| #include <cstdio> | |
| #include <ostream> | |
| #include <sstream> | |
| size_t captureBacktrace(void** buffer, size_t max); |
C++ code style written in markdown.
Astyle code automatic formatting settings
You can use clang-format too.
Use tools like vera++
| #include <utils/CallStack.h> | |
| namespace test { | |
| void myfun(){ | |
| android::CallStack stack; | |
| stack.update(); | |
| stack.log("<Stack prefix here>"); | |
| } | |
| } |
| #ifndef _MACARON_BASE64_H_ | |
| #define _MACARON_BASE64_H_ | |
| /** | |
| * The MIT License (MIT) | |
| * Copyright (c) 2016-2024 tomykaira | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining | |
| * a copy of this software and associated documentation files (the | |
| * "Software"), to deal in the Software without restriction, including |
| /* | |
| * This demo shows how preprocessor macros (formally called X macros) can be | |
| * used to convert one list into both an enumeration and an array of strings. | |
| * This is really useful for converting an enum value into a readable form. | |
| * | |
| * Dan Collins 2015 | |
| */ | |
| #include <stdlib.h> | |
| #include <stdio.h> |
| #include <algorithm> | |
| #include <cassert> | |
| #include <functional> | |
| #include <iostream> | |
| #include <limits> | |
| #include <map> | |
| #define LISTENER_COUNT_MAX 256 | |
| /// class Event |
There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.
All other files should be in your own global gitignore file:
.gitignore in your home directory and add any filepath patterns you want to ignore.Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute
.config/git/ignorefor.gitignorein your home directory, if you prefer.
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <pthread.h> | |
| #include <unistd.h> | |
| #include <stdbool.h> | |
| #include <time.h> | |
| #include <stdarg.h> | |
| #include <string.h> | |
| #include "future.h" |
| /* | |
| * Note: This template uses some c++11 functions , so you have to compile it with c++11 flag. | |
| * Example:- $ g++ -std=c++11 c++Template.cpp | |
| * | |
| * Author : Akshay Pratap Singh | |
| * Handle: code_crack_01 | |
| * | |
| */ | |
| /******** All Required Header Files ********/ |