Merge branch 'master' of https://github.com/eugeneopalev/stb into stb_h_fix
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sean Barrett · committed by Sean Barrett · parents c41629f, a5bbc93 · Browse files · 6 files·+22 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+22 added−9 removed
- other:+22 added−9 removed
Provenance
- Commit
7d4f7c5- Tree
de4ea94- Author
Sean Barrett <sean2@nothings.org>- Committer
Sean Barrett <sean2@nothings.org>- Parent 1
c41629f- Parent 2
a5bbc93
6 files changed+22 added−9 removed
modified:docs/other_libs.md+1 added
62 unmodified lines63646566676869707157 unmodified lines62 unmodified lines- **geometry** [PolyPartition](https://github.com/ivanfratric/polypartition): polygon triangulation, partitioning (MIT license)- **network** [yocto](https://github.com/tom-seddon/yhs): non-production-use http server (public domain)- **network** [happyhttp](http://scumways.com/happyhttp/happyhttp.html): http client requests (zlib license)- **network** [mongoose](https://github.com/cesanta/mongoose): http server (GPL v2)- _**network** [LUrlParser](https://github.com/corporateshark/LUrlParser): lightweight URL & URI parser RFC 1738, RFC 3986 (MIT license)_- **crypto** [TweetNaCl](http://tweetnacl.cr.yp.to/software.html): high-quality tiny cryptography library (public domain)- **AI** [micropather](http://www.grinninglizard.com/MicroPather/): pathfinding with A* (zlib license)- **compression** [miniz.c](https://github.com/richgel999/miniz): zlib compression,decompression, zip file, png writing (public domain)- **compression** [lz4](https://github.com/Cyan4973/lz4): fast but larger LZ compression (BSD license)57 unmodified linesmodified:README.md+6 added-6 removed
5 unmodified lines6 single-file public domain libraries for C/C++ <a name="stb_libs"></a>7 8 library | lastest version | category | LoC | description9 --------------------- | ---- | -------- | --- | --------------------------------10-**stb_vorbis.c** | 1.06 | audio | 5441 | decode ogg vorbis files from file/memory to float/16-bit signed output11-**stb_image.h** | 2.08 | graphics | 6509 | image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC12-**stb_truetype.h** | 1.08 | graphics | 3235 | parse, decode, and rasterize characters from truetype fonts13-**stb_image_write.h** | 1.00 | graphics | 993 | image writing to disk: PNG, TGA, BMP10+**stb_vorbis.c** | 1.07 | audio | 5462 | decode ogg vorbis files from file/memory to float/16-bit signed output11+**stb_image.h** | 2.09 | graphics | 6610 | image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC12+**stb_truetype.h** | 1.09 | graphics | 3246 | parse, decode, and rasterize characters from truetype fonts13+**stb_image_write.h** | 1.01 | graphics | 1044 | image writing to disk: PNG, TGA, BMP14 **stb_image_resize.h** | 0.90 | graphics | 2586 | resize images larger/smaller with good quality15 **stb_rect_pack.h** | 0.08 | graphics | 572 | simple 2D rectangle packer with decent quality16 **stretchy_buffer.h** | 1.02 | utility | 216 | typesafe dynamic array for C (i.e. approximation to vector<>), doesn't compile as C++17 **stb_textedit.h** | 1.7 | user interface | 1301 | guts of a text editor for games etc implementing them from scratch2 unmodified lines20 **stb_perlin.h** | 0.2 | 3D graphics | 182 | revised Perlin noise (3D input, 1D output)21 **stb_easy_font.h** | 0.6 | 3D graphics | 232 | quick-and-dirty easy-to-deploy bitmap font for printing frame rate, etc22 **stb_tilemap_editor.h** | 0.36 | game dev | 4127 | embeddable tilemap editor23 **stb_herringbone_wa...** | 0.6 | game dev | 1220 | herringbone Wang tile map generator24-**stb_c_lexer.h** | 0.06 | parsing | 815 | simplify writing parsers for C-like languages24+**stb_c_lexer.h** | 0.07 | parsing | 816 | simplify writing parsers for C-like languages25 **stb_divide.h** | 0.91 | math | 379 | more useful 32-bit modulus e.g. "euclidean divide"26 **stb.h** | 2.25 | misc | 14136 | helper functions for C, mostly redundant in C++; basically author's personal stuff27 **stb_leakcheck.h** | 0.2 | misc | 124 | quick-and-dirty malloc/free leak-checking28 29 Total libraries: 18 30-Total lines of C code: 4644830+Total lines of C code: 4663331 32 33 FAQ34 ---97 unmodified linesmodified:stb_c_lexer.h+2 added-1 removed
1-// stb_c_lexer.h - v0.06 - public domain Sean Barrett 20131+// stb_c_lexer.h - v0.07 - public domain Sean Barrett 20132 // lexer for making little C-like languages with recursive-descent parsers3 //4 // This file provides both the interface and the implementation.5 // To instantiate the implementation,3 unmodified lines9 // The default configuration is fairly close to a C lexer, although10 // suffixes on integer constants are not handled (you can override this).11 //12 // History:13+// 0.07 fix mishandling of hexadecimal constants parsed by strtol14 // 0.06 fix missing next character after ending quote mark (Andreas Fredriksson)15 // 0.05 refixed get_location because github version had lost the fix16 // 0.04 fix octal parsing bug17 // 0.03 added STB_C_LEX_DISCARD_PREPROCESSOR option799 unmodified linesmodified:stb_tilemap_editor.h+2 added
326 unmodified lines327 #ifndef STB_TILEMAP_INCLUDE_STB_TILEMAP_EDITOR_H328 #define STB_TILEMAP_INCLUDE_STB_TILEMAP_EDITOR_H329 330 #ifdef _WIN32331+ #ifndef _CRT_SECURE_NO_WARNINGS332 #define _CRT_SECURE_NO_WARNINGS333+ #endif334 #include <stdlib.h>335 #include <stdio.h>336 #endif337 3792 unmodified linesmodified:stb_truetype.h+4 added-1 removed
48 unmodified lines49 // Ryan Gordon50 //51 // VERSION HISTORY52 //53-// 1.09 (????-??-??) warning fix; avoid crash on outofmem53+// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly54 // 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges55 // 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints;56 // variant PackFontRanges to pack and render in separate phases;57 // fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?);2463 unmodified lines2521 {2522 float scale;2523 int x,y,bottom_y, i;2524 stbtt_fontinfo f;2525+ f.userdata = NULL;2526 if (!stbtt_InitFont(&f, data, offset))2527 return -1;2528 STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels2529 x=y=1;456 unmodified lines2986 rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context);2987 if (rects == NULL)2988 return 0;2989 2990+ info.userdata = spc->user_allocator_context;2991 stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata,font_index));2992 2993 n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects);2994 209 unmodified lines3204 3205 3206 // FULL VERSION HISTORY3207 //3208+// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use alloc userdata for PackFontRanges3209 // 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges3210 // 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints;3211 // allow PackFontRanges to pack and render in separate phases;3212 // fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?);37 unmodified linesmodified:stb.h+7 added-1 removed
205 unmodified lines206 #endif207 #endif208 209 #ifdef _WIN32210+ #ifndef _CRT_SECURE_NO_WARNINGS211 #define _CRT_SECURE_NO_WARNINGS212+ #endif213+ #ifndef _CRT_NONSTDC_NO_DEPRECATE214 #define _CRT_NONSTDC_NO_DEPRECATE215+ #endif216+ #ifndef _CRT_NON_CONFORMING_SWPRINTFS217 #define _CRT_NON_CONFORMING_SWPRINTFS218+ #endif219 #if !defined(_MSC_VER) || _MSC_VER > 1700220 #include <intrin.h> // _BitScanReverse221 #endif222 #endif7606 unmodified lines7829 7830 void ** stb_ps_getlist(stb_ps *ps, int *count)7831 {7832 int i,n=0;7827- void **p;7833+ void **p = NULL;7834 switch (3 & (int) ps) {7835 case STB_ps_direct:7836 if (ps == NULL) { *count = 0; return NULL; }7837 p = (void **) malloc(sizeof(*p) * 1);6343 unmodified lines