sudo apt-get install -y git gcc-mingw32 libncurses5-dev
cd
git clone https://github.com/rmyorston/busybox-w32.git
cd ~/busybox-w32
find . -name "*" -exec sed -i "s/i686-pc-mingw32-/i686-w64-mingw32-/g" '{}' \;
make mingw32_defconfig
make menuconfig
# Exit menuconfig.
busybox sed -i '417 s/# undef HAVE_VASPRINTF$//g' include/platform.h
This file contains 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
// LZ4 streaming API example | |
#define _CRT_SECURE_NO_WARNINGS // for MSVC | |
#include "lz4.h" | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
enum { |
This file contains 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 <string> | |
template<class Char> | |
class ForEachNullTreminatedStringIterator { | |
using ThisClass = ForEachNullTreminatedStringIterator; | |
public: | |
ForEachNullTreminatedStringIterator() : p{} {} | |
ForEachNullTreminatedStringIterator(Char* p) : p{p} {} |
This file contains 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
## Old | |
## | |
## LIBVER_MAJOR=`sed -n '/LZ4_VERSION_MAJOR/s/.*\s\+\([0-9]\+\).*/\1/p' < lz4.h` | |
## LIBVER_MINOR=`sed -n '/LZ4_VERSION_MINOR/s/.*\s\+\([0-9]\+\).*/\1/p' < lz4.h` | |
## LIBVER_PATCH=`sed -n '/LZ4_VERSION_RELEASE/s/.*\s\+\([0-9]\+\).*/\1/p' < lz4.h` | |
## New | |
## | |
## (1) Need 'define ' to match only one line. | |
## (2) Use ' ' instead of '\s' for the compatibility. (Perhaps '[:blank:]' is better) |
This file contains 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
set LANG=C | |
set LC_MESSAGES=C | |
svn diff > diff.txt |
This file contains 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 "lz4Frame.h" | |
size_t LZ4F_getSrcSize(const LZ4F_preferences_t* preferences); // still missing function ? | |
int main() { | |
int result = EXIT_FAILURE; | |
FILE* inpFp = fopen("src.bin", "rb"); | |
FILE* outFp = fopen("dst.lz4", "wb"); |
This file contains 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 "lz4frame.h" | |
size_t compress(LZ4F_compressionContext_t* ctx, FILE* outFp, FILE* inpFp, | |
void* dstBuffer, size_t dstMaxSize, void* srcBuffer, size_t srcSize, | |
const LZ4F_compressOptions_t* options) | |
{ | |
// Maybe LZ4F_compressBegin()'s compressOptions seems to have overlooked. | |
const size_t headerSize = LZ4F_compressBegin( | |
ctx, dstBuffer, dstMaxSize, options); |
This file contains 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 "lz4frame.h" | |
// Upper bound of total output frame size | |
size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_preferences_t* preferences); | |
size_t compress( | |
LZ4F_compressionContext_t* ctx, | |
char* outPtr, size_t outSizeMax, const char* inpPtr, size_t inpSize, | |
const LZ4F_compressOptions_t* options, const LZ4F_preferences_t* preferences |
OlderNewer