├── .github └── FUNDING.yml ├── .gitignore ├── .hgeol ├── .hgignore ├── COPYING ├── HACKING ├── INSTALL ├── Makefile ├── README.md ├── TODO ├── WIN32-installer.txt ├── bin ├── linux │ └── libgif.a └── win32 │ ├── freetype-license.txt │ ├── giflib-license.txt │ ├── libext-sqlite-3.45.1.a │ ├── libext-z-win32.a │ ├── libfreetype.a │ ├── libgif.a │ ├── libjpeg-turbo-license.txt │ ├── libjpeg.a │ ├── libpcre.a │ ├── libz.a │ ├── libzip-license.txt │ ├── libzip.a │ ├── pcre-license.txt │ └── zlib-license.txt ├── build-releases.sh ├── common.mki ├── docs ├── LICENSE.txt ├── Languages.txt ├── Makefile ├── Menu.txt ├── Topics.txt ├── bilist.txt ├── fbext.css ├── freetype │ ├── ftl.txt │ └── gpl.txt ├── jpeg │ └── libjpeg-license.txt ├── prebuild.sh └── zlib │ └── zlib.txt ├── examples ├── Makefile ├── TODO.txt ├── builder.bas ├── containers │ ├── bitarray.bas │ ├── hashtable.bas │ ├── hashtable_iterator.bas │ ├── hashtable_udt.bas │ ├── list.bas │ └── list_udt.bas ├── database │ ├── sqlite3.bas │ └── sqlite3.db ├── file │ ├── console_ex.bas │ ├── file.bas │ ├── test.txt │ └── zip-list.bas ├── graphics │ ├── GetTextWidth.bas │ ├── Scale2X.bas │ ├── Vera.ttf │ ├── alphablit.bas │ ├── blur.bas │ ├── bmp.bas │ ├── fbextlogo.jpg │ ├── fbextlogo.tga │ ├── fonttest.bas │ ├── freetype.bas │ ├── gif.bas │ ├── gir-dog-anim.png │ ├── grayscale.bas │ ├── image.bas │ ├── intensity.bas │ ├── manip_test.bas │ ├── marmot16bit-alt.bmp │ ├── marmot16bit.bmp │ ├── marmot1bit.bmp │ ├── marmot24bit.bmp │ ├── marmot2bit.bmp │ ├── marmot4bit.bmp │ ├── marmot8bit-alt.bmp │ ├── marmot8bit.bmp │ ├── ofont.bas │ ├── rectcol.bas │ ├── rotate.bas │ ├── rotozoom.bas │ ├── spbench.bas │ ├── sprite.bas │ ├── test.gif │ ├── test.png │ ├── testa.gif │ ├── tga.bas │ └── triangle.bas ├── hash │ ├── md5file.bas │ ├── md5text.bas │ ├── sha256file.bas │ └── sha256text.bas ├── logging │ ├── log-xml.bas │ └── log.bas ├── math │ ├── 2drotate.bas │ ├── 3drotate.bas │ ├── PointAt.bas │ ├── line-intersect.bas │ ├── perm-comb.bas │ ├── perpendicular-lines.bas │ ├── sphere-line-collision.bas │ ├── stars.bas │ ├── vector-field.bas │ ├── vectors.bas │ └── yinyang.bas ├── memory │ ├── detail │ │ └── common.bi │ └── sharedptr.bas ├── misc │ ├── genuuid.bas │ ├── vregex.bas │ ├── xinput-console.bas │ └── xinput-gui.bas ├── net │ ├── http-getfile.bas │ ├── http-getfiletomem.bas │ ├── http-server.bas │ ├── index.html │ ├── tcp-chat-client.bas │ └── tcp-chat-server.bas ├── options │ └── cmdopt.bas ├── preprocessor │ ├── seq-elem.bi │ └── seq-insert.bi ├── sort │ └── quicksort.bas ├── strings │ ├── join.bas │ ├── repeat.bas │ ├── replace.bas │ ├── reverse.bas │ ├── split.bas │ └── xstring.bas ├── threads │ └── comm.bas └── xml │ ├── advanced.bas │ ├── kloc.bas │ └── simple.bas ├── include └── freebasic │ └── ext │ ├── Interfaces.bi │ ├── algorithms.bi │ ├── algorithms │ ├── adjacentfind.bi │ ├── copy.bi │ ├── copybackward.bi │ ├── count.bi │ ├── countif.bi │ ├── detail │ │ └── common.bi │ ├── equal.bi │ ├── fill.bi │ ├── filln.bi │ ├── find.bi │ ├── findfirstof.bi │ ├── findif.bi │ ├── foreach.bi │ ├── gnomesort.bi │ ├── maxelement.bi │ ├── minelement.bi │ ├── quicksort.bi │ ├── replace.bi │ ├── replacecopy.bi │ ├── replacecopyif.bi │ ├── replaceif.bi │ ├── transform.bi │ ├── uninitializedcopy.bi │ └── uninitializedfilln.bi │ ├── config.bi │ ├── containers.bi │ ├── containers │ ├── array.bi │ ├── bitarray.bi │ ├── bloomfilter.bi │ ├── hashtable.bi │ ├── list.bi │ ├── pair.bi │ ├── queue.bi │ ├── stack.bi │ └── trees.bi │ ├── conversion.bi │ ├── conversion │ └── base64.bi │ ├── database │ ├── database.bi │ ├── driver.bi │ └── drivers │ │ ├── mysql.bi │ │ ├── postgre.bi │ │ ├── sqlite3.bi │ │ ├── sqlite3driver_int.bi │ │ └── xml.bi │ ├── datetime.bi │ ├── debug.bi │ ├── detail │ └── common.bi │ ├── error.bi │ ├── ext.bi │ ├── fbmld.bi │ ├── file.bi │ ├── file │ ├── console.bi │ ├── detail │ │ └── common.bi │ ├── directory.bi │ ├── file.bi │ ├── gzfile.bi │ └── zipfile.bi │ ├── graphics.bi │ ├── graphics │ ├── bmp.bi │ ├── collision.bi │ ├── colors.bi │ ├── detail │ │ └── common.bi │ ├── font.bi │ ├── gif.bi │ ├── image.bi │ ├── jpg.bi │ ├── manip.bi │ ├── png.bi │ ├── primitives.bi │ ├── sprite.bi │ ├── tga.bi │ └── xpm.bi │ ├── hash.bi │ ├── hash │ ├── adler32.bi │ ├── crc32.bi │ ├── hmac.bi │ ├── joaat.bi │ ├── md5.bi │ ├── sha2.bi │ └── sha3.bi │ ├── input.bi │ ├── json.bi │ ├── log.bi │ ├── math.bi │ ├── math │ ├── detail │ │ └── common.bi │ ├── factorial.bi │ ├── intersects.bi │ ├── line2.bi │ ├── matrix.bi │ ├── ncr.bi │ ├── npr.bi │ ├── pow2.bi │ ├── projections.bi │ ├── random.bi │ ├── reflections.bi │ ├── vector2.bi │ ├── vector3.bi │ ├── vector4.bi │ └── vectors.bi │ ├── memory.bi │ ├── memory │ ├── allocate.bi │ ├── allocator.bi │ ├── arrays.bi │ ├── construct.bi │ ├── detail │ │ └── common.bi │ ├── scopedptr.bi │ ├── scopedptrarray.bi │ ├── sharedarray.bi │ └── sharedptr.bi │ ├── misc.bi │ ├── net │ ├── detail │ │ ├── common.bi │ │ └── winsockets.bi │ ├── http.bi │ ├── ports.bi │ ├── socket.bi │ ├── tcp.bi │ └── udp.bi │ ├── options.bi │ ├── php.bi │ ├── php │ └── strings.bi │ ├── preprocessor.bi │ ├── preprocessor │ ├── arithmetic.bi │ ├── arithmetic │ │ ├── add.bi │ │ ├── dec.bi │ │ ├── inc.bi │ │ ├── mul.bi │ │ └── sub.bi │ ├── array.bi │ ├── array │ │ ├── data.bi │ │ ├── elem.bi │ │ ├── pushback.bi │ │ ├── pushfront.bi │ │ ├── replace.bi │ │ ├── reverse.bi │ │ └── size.bi │ ├── cat.bi │ ├── comparison.bi │ ├── comparison │ │ ├── equal.bi │ │ ├── greaterthan.bi │ │ ├── greaterthanorequal.bi │ │ ├── lessthan.bi │ │ ├── lessthanorequal.bi │ │ └── notequal.bi │ ├── control.bi │ ├── control │ │ ├── exprif.bi │ │ ├── expriif.bi │ │ ├── if.bi │ │ ├── iif.bi │ │ └── while.bi │ ├── detail │ │ └── auto_rec.bi │ ├── facilities.bi │ ├── facilities │ │ ├── empty.bi │ │ └── expand.bi │ ├── logical.bi │ ├── logical │ │ ├── and.bi │ │ ├── bitand.bi │ │ ├── bitnot.bi │ │ ├── bitor.bi │ │ ├── bitxor.bi │ │ ├── bool.bi │ │ ├── not.bi │ │ ├── or.bi │ │ └── xor.bi │ ├── punctuation.bi │ ├── punctuation │ │ ├── comma.bi │ │ └── commaif.bi │ ├── repetition.bi │ ├── repetition │ │ ├── detail │ │ │ └── for.bi │ │ ├── for.bi │ │ └── repeat.bi │ ├── seq.bi │ ├── seq │ │ ├── cat.bi │ │ ├── elem.bi │ │ ├── enum.bi │ │ ├── firstn.bi │ │ ├── foldleft.bi │ │ ├── foldright.bi │ │ ├── foreach.bi │ │ ├── foreachi.bi │ │ ├── fromvalue.bi │ │ ├── head.bi │ │ ├── insert.bi │ │ ├── popback.bi │ │ ├── popfront.bi │ │ ├── pushback.bi │ │ ├── pushfront.bi │ │ ├── replace.bi │ │ ├── restn.bi │ │ ├── reverse.bi │ │ ├── size.bi │ │ ├── split.bi │ │ ├── tail.bi │ │ ├── totuple.bi │ │ └── transform.bi │ ├── stringize.bi │ ├── struct.bi │ ├── tuple.bi │ └── tuple │ │ ├── eat.bi │ │ ├── elem.bi │ │ ├── enum.bi │ │ ├── foreach.bi │ │ ├── foreachi.bi │ │ ├── fromvalue.bi │ │ ├── remove.bi │ │ ├── remparens.bi │ │ ├── replace.bi │ │ ├── reverse.bi │ │ └── toseq.bi │ ├── review │ └── review.bi │ ├── strings.bi │ ├── strings │ ├── detail │ │ └── common.bi │ ├── manip.bi │ ├── misc.bi │ ├── split.bi │ └── substr.bi │ ├── templates.bi │ ├── tests.bi │ ├── threads │ ├── comm.bi │ ├── detail │ │ └── common.bi │ └── mutex.bi │ ├── uuid.bi │ ├── vregex.bi │ ├── xml.bi │ ├── xml │ ├── detail │ │ └── common.bi │ ├── dom.bi │ └── xpath.bi │ └── xstring.bi ├── installer.iss ├── lib ├── linux │ └── libs.linux ├── win32 │ └── libs.win32 └── win64 │ └── libs.win64 ├── src └── modules │ ├── Makefile │ ├── config │ └── libext-config.bas │ ├── containers │ ├── libext-container-bitarray.bas │ ├── libext-container-bloomfilter.bas │ └── libext-containers-hashtable-core.bas │ ├── conversion │ └── libext-conv-base64.bas │ ├── database │ ├── Makefile │ ├── database.bas │ └── drivers │ │ ├── mysql.bas │ │ ├── postgre.bas │ │ ├── sqlite3.bas │ │ └── xml.bas │ ├── error │ └── libext-core-error.bas │ ├── file │ ├── libext-file-console.bas │ ├── libext-file-file.bas │ ├── libext-file-gzfile.bas │ ├── libext-file-memorydriver.bas │ └── libext-file-zipfile.bas │ ├── graphics │ ├── libext-fbpng-IDAT.bas │ ├── libext-fbpng-IHDR.bas │ ├── libext-fbpng-PLTE.bas │ ├── libext-fbpng-png_dimensions.bas │ ├── libext-fbpng-png_image.bas │ ├── libext-fbpng-png_image_convert.bas │ ├── libext-fbpng-png_image_deinit.bas │ ├── libext-fbpng-png_image_init.bas │ ├── libext-fbpng-png_image_prepare.bas │ ├── libext-fbpng-png_load.bas │ ├── libext-fbpng-png_save.bas │ ├── libext-fbpng-tRNS.bas │ ├── libext-gfx-alphablit.bas │ ├── libext-gfx-blur.bas │ ├── libext-gfx-bmp.bas │ ├── libext-gfx-font.bas │ ├── libext-gfx-font_ttf.bas │ ├── libext-gfx-gif.bas │ ├── libext-gfx-image.bas │ ├── libext-gfx-img_load.bas │ ├── libext-gfx-intensify.bas │ ├── libext-gfx-jpg.bas │ ├── libext-gfx-manip.bas │ ├── libext-gfx-ofont.bas │ ├── libext-gfx-primitives.bas │ ├── libext-gfx-rectcol.bas │ ├── libext-gfx-rotate.bas │ ├── libext-gfx-rotozoom.bas │ ├── libext-gfx-scale2x.bas │ ├── libext-gfx-sprite.bas │ ├── libext-gfx-tga.bas │ ├── libext-gfx-xpm.bas │ ├── libext-graphics-loader.bas │ └── pnginc │ │ ├── IDAT.bi │ │ ├── IHDR.bi │ │ ├── PLTE.bi │ │ ├── file_to_buffer.bi │ │ ├── png_image.bi │ │ ├── png_save.bi │ │ └── tRNS.bi │ ├── hash │ ├── libext-hash-adler32.bas │ ├── libext-hash-crc32.bas │ ├── libext-hash-hmac.bas │ ├── libext-hash-joaat.bas │ ├── libext-hash-md5.bas │ ├── libext-hash-sha2.bas │ └── libext-hash-sha3.bas │ ├── json │ ├── libext-json-array.bas │ ├── libext-json-object.bas │ ├── libext-json-pair.bas │ └── libext-json-value.bas │ ├── logging │ ├── libext-logging-logger-unix-syslog.bas │ └── libext-logging-logger.bas │ ├── math │ ├── Makefile │ ├── libext-math-factorial.bas │ ├── libext-math-matrix.bas │ ├── libext-math-ncr.bas │ ├── libext-math-npr.bas │ ├── libext-math-random.bas │ ├── libext-math-shift64.bas │ ├── libext-math-vector2d.bas │ ├── libext-math-vector3d.bas │ └── libext-math-vector4d.bas │ ├── memory │ └── libext-memory-allocate.bas │ ├── misc │ ├── libext-misc-datetime.bas │ ├── libext-misc-uuid.bas │ ├── libext-misc-vregex.bas │ ├── libext-misc-xinput.bas │ └── libext-misc.bas │ ├── net │ ├── Makefile │ ├── libext-net-socket-TCP.bas │ ├── libext-net-socket-UDP.bas │ ├── libext-net-socket-core.bas │ ├── libext-net-socket-get-thread.bas │ ├── libext-net-socket-get-types.bas │ ├── libext-net-socket-get.bas │ ├── libext-net-socket-put-thread.bas │ ├── libext-net-socket-put-types.bas │ ├── libext-net-socket-put.bas │ ├── libext-net-system-TCP.bas │ ├── libext-net-system-UDP.bas │ ├── libext-net-system-lock.bas │ ├── libext-net-system.bas │ ├── libext-net-system.bi │ ├── libext-net-tcp-http-helpers.bas │ ├── libext-net-tcpsocket-core.bas │ ├── libext-net-tcpsocket-types.bas │ ├── libext-net-udpsocket-core.bas │ └── libext-net-udpsocket-types.bas │ ├── options │ ├── libext-options-option.bas │ └── libext-options-parser.bas │ ├── php │ ├── libext-php-addcslashes.bas │ ├── libext-php-addslashes.bas │ ├── libext-php-bin2hex.bas │ ├── libext-php-chunk_split.bas │ ├── libext-php-count_chars.bas │ ├── libext-php-implode.bas │ └── libext-php-strrchr.bas │ ├── strings │ ├── detail │ │ └── strings.bi │ ├── libext-strings-compact.bas │ ├── libext-strings-explode.bas │ ├── libext-strings-insertinto.bas │ ├── libext-strings-join.bas │ ├── libext-strings-leven.bas │ ├── libext-strings-pos.bas │ ├── libext-strings-repeat.bas │ ├── libext-strings-replace.bas │ ├── libext-strings-replace_copy.bas │ ├── libext-strings-reverse.bas │ ├── libext-strings-reverse_copy.bas │ ├── libext-strings-rot13.bas │ ├── libext-strings-shuffle.bas │ ├── libext-strings-shuffle_copy.bas │ ├── libext-strings-split.bas │ ├── libext-strings-substr.bas │ ├── libext-strings-substr_compare.bas │ ├── libext-strings-substr_count.bas │ ├── libext-strings-substr_replace.bas │ └── libext-strings-ucwords.bas │ ├── testly │ ├── testly_case.bas │ ├── testly_case.bi │ ├── testly_common.bas │ ├── testly_common.bi │ ├── testly_helpers.bas │ ├── testly_helpers.bi │ ├── testly_internals.bas │ ├── testly_internals.bi │ ├── testly_list.bas │ ├── testly_list.bi │ ├── testly_suite.bas │ └── testly_suite.bi │ ├── threads │ ├── Makefile │ ├── libext-threads-comm.bas │ └── libext-threads-mutex.bas │ ├── xml │ ├── libext-xml-common.bas │ ├── libext-xml-dom.bas │ └── libext-xml-xpath.bak │ └── xstring │ ├── detail │ └── strings.bi │ ├── libext-strings-xstring-core.bas │ ├── libext-xstring-builtins.bas │ ├── libext-xstring-cfirst.bas │ ├── libext-xstring-crc32.bas │ ├── libext-xstring-pos.bas │ ├── libext-xstring-repeat.bas │ ├── libext-xstring-replace.bas │ ├── libext-xstring-replace_copy.bas │ ├── libext-xstring-reverse.bas │ ├── libext-xstring-reverse_copy.bas │ ├── libext-xstring-rot13.bas │ ├── libext-xstring-shuffle.bas │ ├── libext-xstring-shuffle_copy.bas │ ├── libext-xstring-split.bas │ ├── libext-xstring-strpad.bas │ ├── libext-xstring-substr.bas │ ├── libext-xstring-substr_compare.bas │ ├── libext-xstring-substr_count.bas │ ├── libext-xstring-substr_replace.bas │ └── libext-xstring-ucwords.bas └── tests ├── Makefile ├── algorithms ├── copy.bas ├── copybackward.bas ├── count.bas ├── fill.bas └── filln.bas ├── containers ├── array-ctor-rep.bas ├── array-ctor.bas ├── array-index.bas ├── array-reserve.bas ├── array-sort.bas ├── array-swap.bas ├── array-udt.bas ├── array.bas ├── bitarray.bas ├── bloomfilter.bas ├── hashtable.bas ├── list-assigncount.bas ├── list-assignrange.bas ├── list-empty.bas ├── list-string.bas ├── list-udt.bas ├── list.bas ├── pair.bas.testing ├── queue.bas └── stack.bas ├── conversion └── base64.bas ├── database └── xmldb.bas ├── file ├── file.bas └── memory-driver.bas ├── hash ├── hashes.bas └── hmac.bas ├── json ├── json-advanced.bas ├── json-bson.bas └── json-create.bas ├── main.bas ├── math ├── matrix.bas ├── npr-ncr.bas ├── pow2.bas ├── random.bas ├── vector2-angle.bas ├── vector2-distance.bas ├── vector2-dot.bas ├── vector2-magnitude.bas ├── vector2-normal.bas ├── vector2-normalize.bas ├── vector3-distance.bas ├── vector3-dot.bas └── vector3-magnitude.bas ├── memory ├── allocator-string.bas ├── allocator.bas ├── arrayfuncs.bas ├── scopedptr.bas ├── scopedptrarray.bas └── sharedarray.bas ├── misc └── uuid.bas ├── php ├── addcslashes.bas ├── addslashes.bas ├── bin2hex.bas ├── chunk_split.bas ├── count_chars.bas ├── implode.bas ├── join.bas └── strrchr.bas ├── preprocessor ├── array-core.bas ├── comparison.bas ├── control-while.bas ├── logical-bitops.bas ├── repetition-for.bas ├── repetition-repeat.bas ├── seq-cat.bas ├── seq-elem.bas ├── seq-enum.bas ├── seq-firstn.bas ├── seq-foldleft.bas ├── seq-foldright.bas ├── seq-foreach.bas ├── seq-foreachi.bas ├── seq-fromvalue.bas ├── seq-head_tail.bas ├── seq-insert.bas ├── seq-popback.bas ├── seq-popfront.bas ├── seq-pushback.bas ├── seq-pushfront.bas ├── seq-replace.bas ├── seq-restn.bas ├── seq-reverse.bas ├── seq-size.bas ├── seq-totuple.bas ├── seq-transform.bas ├── tuple-eat.bas ├── tuple-elem.bas ├── tuple-enum.bas ├── tuple-foreach.bas ├── tuple-foreachi.bas ├── tuple-fromvalue.bas ├── tuple-remove.bas ├── tuple-replace.bas ├── tuple-reverse.bas └── tuple-toseq.bas ├── sort ├── gnome.bas └── qsort.bas ├── strings ├── compact.bas ├── insert.bas ├── join.bas ├── repeat.bas ├── replace.bas ├── replace_copy.bas ├── reverse.bas ├── reverse_copy.bas ├── tokenize.bas └── xstring_builtins.bas └── xml ├── xml-parse.bas └── xml-xpath.testing /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: mudhairless 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.bin 3 | *.zip 4 | *.o 5 | *.a 6 | *.dll 7 | *.bak 8 | *.xml 9 | *.orig 10 | *.so 11 | *.la 12 | NULL 13 | docs/Data/* 14 | docs/FramedHTML/* 15 | docs/Menu.txt 16 | tools/* 17 | *.log 18 | *.tst 19 | -------------------------------------------------------------------------------- /.hgeol: -------------------------------------------------------------------------------- 1 | [patterns] 2 | **.bas = native 3 | **.bi = native 4 | **.txt = native 5 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | *.exe 3 | *.bin 4 | *.zip 5 | *.o 6 | *.a 7 | *.dll 8 | *.bak 9 | *.xml 10 | *.orig 11 | *.so 12 | *.la 13 | NULL 14 | docs/Data/* 15 | docs/FramedHTML/* 16 | docs/Menu.txt 17 | tools/* 18 | *.log 19 | *.tst 20 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | [Linux] 2 | Use make install as directed in the README file. 3 | 4 | [Windows: With GNU Make (MSYS)] 5 | "make install" from within the MSYS shell should properly install 6 | the library if you installed FreeBASIC to the default directory. 7 | If you did not use the default directory you will need to pass: 8 | INSTALLDIR=/c/freebasic 9 | or what ever path you installed FreeBASIC to in MSYS style. 10 | 11 | [Windows: Without GNU Make] 12 | Copy the inc and lib directories and paste them into the root 13 | of your FreeBASIC directory (by default its C:\Program Files\FreeBASIC). 14 | They will not overwrite any files included with FreeBASIC. You 15 | should copy the contents of the bin directory to C:\WINDOWS\System32 16 | for maximum compatibility. They can also be located in your project's 17 | directory. You must remember to distribute any dlls you use with your project. -------------------------------------------------------------------------------- /WIN32-installer.txt: -------------------------------------------------------------------------------- 1 | This release does not fully support the latest 2 | version of FreeBASIC 0.90, the latest supported 3 | version is 0.24. 4 | 5 | On the next screen please provide 6 | the directory where the 7 | FreeBASIC install directory is located. 8 | 9 | For example: 10 | If FreeBASIC is installed in C:\FreeBASIC, 11 | you would provide C:\FreeBASIC or 12 | if FreeBASIC is installed in P:\llamas 13 | you would provide P:\llamas 14 | 15 | It is recommended you uninstall any previous 16 | versions of the Extended Library before 17 | continuing with the installation. 18 | -------------------------------------------------------------------------------- /bin/linux/libgif.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/bin/linux/libgif.a -------------------------------------------------------------------------------- /bin/win32/giflib-license.txt: -------------------------------------------------------------------------------- 1 | The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /bin/win32/libext-sqlite-3.45.1.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/bin/win32/libext-sqlite-3.45.1.a -------------------------------------------------------------------------------- /bin/win32/libext-z-win32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/bin/win32/libext-z-win32.a -------------------------------------------------------------------------------- /bin/win32/libfreetype.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/bin/win32/libfreetype.a -------------------------------------------------------------------------------- /bin/win32/libgif.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/bin/win32/libgif.a -------------------------------------------------------------------------------- /bin/win32/libjpeg.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/bin/win32/libjpeg.a -------------------------------------------------------------------------------- /bin/win32/libpcre.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/bin/win32/libpcre.a -------------------------------------------------------------------------------- /bin/win32/libz.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/bin/win32/libz.a -------------------------------------------------------------------------------- /bin/win32/libzip.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/bin/win32/libzip.a -------------------------------------------------------------------------------- /bin/win32/zlib-license.txt: -------------------------------------------------------------------------------- 1 | Copyright notice: 2 | 3 | (C) 1995-2022 Jean-loup Gailly and Mark Adler 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | Jean-loup Gailly Mark Adler 22 | jloup@gzip.org madler@alumni.caltech.edu 23 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | include ../common.mki 2 | 3 | DOC_PROJDIR := . 4 | 5 | DOC_INDIRS := ../$(INCLUDE_DIR) # ... additional input dirs ... 6 | 7 | DOC_FORMAT := FramedHTML 8 | DOC_OUTDIR := $(DOC_PROJDIR)/$(DOC_FORMAT) 9 | 10 | ND := `which naturaldocs` 11 | 12 | all : 13 | $(MD) $(DOC_OUTDIR) 14 | $(ND) -p $(DOC_PROJDIR) $(addprefix -i ,$(DOC_INDIRS)) -s fbext -o $(DOC_FORMAT) $(DOC_OUTDIR) 15 | 16 | clean : 17 | -$(RM) -rf $(DOC_OUTDIR)/*.* 18 | -$(RM) -rf $(DOC_PROJDIR)/Data 19 | 20 | .PHONY: install 21 | install : all 22 | @echo installing documentation files.. 23 | @$(MD) -p $(DOC_INSTALL_DIR) 24 | @$(CP) $(DOC_OUTDIR) $(DOC_INSTALL_DIR) 25 | -------------------------------------------------------------------------------- /docs/prebuild.sh: -------------------------------------------------------------------------------- 1 | sed "s/###/`svn info | grep 'Revision'`/g" Menu.auto > Menu.txt 2 | 3 | -------------------------------------------------------------------------------- /docs/zlib/zlib.txt: -------------------------------------------------------------------------------- 1 | /* zlib.h -- interface of the 'zlib' general purpose compression library 2 | version 1.2.3, July 18th, 2005 3 | 4 | Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler 5 | 6 | This software is provided 'as-is', without any express or implied 7 | warranty. In no event will the authors be held liable for any damages 8 | arising from the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, 11 | including commercial applications, and to alter it and redistribute it 12 | freely, subject to the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software 16 | in a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 3. This notice may not be removed or altered from any source distribution. 21 | 22 | Jean-loup Gailly jloup@gzip.org 23 | Mark Adler madler@alumni.caltech.edu 24 | 25 | */ 26 | -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | # fbext examples Makefile 2 | # 3 | EX_DIRS := containers hash memory preprocessor sort strings xml options logging threads database graphics math misc net 4 | EX_SRCS := $(foreach dir,$(EX_DIRS),$(wildcard $(dir)/*.bas)) 5 | EX_EXES := $(EX_SRCS:%.bas=%$(EXE_EXT)) 6 | 7 | FBC_CFLAGS := -g -i ../$(INCLUDE_DIR) -w all -enullptr 8 | FBC_LFLAGS := -p ../$(LIBRARY_DIR) -p ../$(BINARY_DIR) 9 | 10 | ifeq ($(ARCH), x86) 11 | ifeq ($(BITS),64) 12 | FBC_CFLAGS += -arch x86-64 13 | else 14 | FBC_CFLAGS += -arch 686 15 | endif 16 | endif 17 | 18 | ifndef NDEBUG 19 | FBC_CFLAGS += -g 20 | endif 21 | 22 | ifdef PROFILE 23 | FBC_CFLAGS += -profile 24 | endif 25 | 26 | ifdef EXX 27 | FBC_CFLAGS += -exx -d FBEXT_USE_MLD=1 28 | endif 29 | 30 | ifdef COPT 31 | FBC_CFLAGS += $(COPT) 32 | endif 33 | ifdef LOPT 34 | FBC_LFLAGS += $(LOPT) 35 | endif 36 | 37 | # TODO: deprecated 38 | ifdef OPT 39 | FBC_CFLAGS += $(OPT) 40 | endif 41 | 42 | ifeq ($(VERBOSE),2) 43 | FBC_CFLAGS += -v 44 | endif 45 | 46 | all : $(EX_EXES) 47 | 48 | %$(EXE_EXT) : %.bas 49 | -$(FBC) $(FBC_CFLAGS) $(FBC_LFLAGS) $^ -x $@ 50 | 51 | .PHONY : clean 52 | clean : 53 | -$(RM) -f $(EX_EXES) 54 | -------------------------------------------------------------------------------- /examples/TODO.txt: -------------------------------------------------------------------------------- 1 | These topics are currently lacking Examples: 2 | 3 | File Changelog: 4 | March 25 2008 : Initialized list, set todo list item at 0% completion - sir_mud 5 | 6 | ext.Array 7 | ext.Stack 8 | ext.Queue 9 | 10 | ext.hashes.adler32 11 | ext.hashes.crc32 12 | ext.hashes.joaat 13 | ext.hashes.joaat64 14 | 15 | ext.scopedptr 16 | ext.scopedarray 17 | ext.sharedarray 18 | 19 | ext.sort.gnome 20 | ext.sort.qsort 21 | 22 | ext.xml (needs another example showing more advanced usage) 23 | 24 | debug (including fbmld) 25 | 26 | error 27 | 28 | ext.math (vector/matrix examples need more comments) 29 | ext.math.pow2 30 | ext.math.factorial 31 | ext.math.random 32 | 33 | ext.preprocessor (needs more examples) 34 | ext.algorithms (needs examples) 35 | -------------------------------------------------------------------------------- /examples/containers/bitarray.bas: -------------------------------------------------------------------------------- 1 | ''File: bitarray.bas 2 | ''Description: Demonstration of ext.BitArray object. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/containers/bitarray.bi" 11 | # include once "ext/strings.bi" 12 | 13 | var bitstring = ext.strings.repeat("10", 64) 14 | ext.strings.shuffle(bitstring) 15 | 16 | var bitarray = ext.BitArray(len(bitstring)) 17 | bitarray.load(bitstring) 18 | print "bits: " & bitarray.dump() 19 | 20 | if bitarray.isset(0) then print "bit 0 is set" 21 | 22 | bitarray.toggle(30) 23 | bitarray.toggle(31) 24 | bitarray.toggle(32) 25 | print "bits: " & bitarray.dump() 26 | -------------------------------------------------------------------------------- /examples/containers/hashtable.bas: -------------------------------------------------------------------------------- 1 | ''File: hashtable.bas 2 | ''Description: Demonstration of ext.HashTable object. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/containers/hashtable.bi" 11 | 12 | fbext_Instanciate(fbext_HashTable, ((single))) 13 | 14 | using ext 15 | 16 | var myHT = fbext_HashTable((single))(16) 17 | 18 | print "Count before insertion: " & myHT.count 19 | 20 | print !"Inserting \"One\" as 1.0" 21 | myHT.insert("One", 1.0) 22 | 23 | print !"Inserting \"Two\" as 2.0" 24 | myHT.insert("Two", 2.0) 25 | 26 | print !"Inserting \"Three\" as 3.0" 27 | myHT.insert("Three", 3.0) 28 | 29 | print !"Inserting \"Tacos\" as 4.2" 30 | myHT.insert("Tacos", 4.2) 31 | 32 | print !"Inserting \"FBEXT\" as 5.6" 33 | myHT.insert("FBEXT", 5.6) 34 | 35 | print "Count after insertion: " & myHT.count 36 | 37 | print "One: " & *(myHT.find("One")) 38 | 39 | print "Removing Tacos" 40 | myHT.remove("Tacos") 41 | 42 | print "Two: " & *(myHT.find("Two")) 43 | 44 | print "Removing Three" 45 | myHT.remove("Three") 46 | 47 | print "FBEXT: " & *(myHT.find("FBEXT")) 48 | 49 | print "Count after 2 removes: " & myHT.count 50 | -------------------------------------------------------------------------------- /examples/containers/hashtable_iterator.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/containers/hashtable.bi" 2 | 3 | fbext_Instanciate(fbext_HashTable, ((integer))) 4 | 5 | declare sub MyIterator ( byref key as const string, byval value as integer ptr ) 6 | 7 | var MyHT = ext.FBEXT_HASHTABLE((integer))(150) 8 | 9 | for n as integer = 1 to 50 10 | MyHT.Insert("Number: " & n, n) 11 | next 12 | 13 | MyHT.ForEach( @MyIterator ) 14 | 15 | sub MyIterator ( byref key as const string, byval value as integer ptr ) 16 | 17 | print !"\"" & key & !"\" => " & *value 18 | 19 | end sub 20 | -------------------------------------------------------------------------------- /examples/containers/list.bas: -------------------------------------------------------------------------------- 1 | ''File: list.bas 2 | ''Description: Demonstration of ext.List object. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/containers/list.bi" 11 | 12 | private function ToString ( byref list as const ext.fbext_List( ((integer)) ) ) as string 13 | 14 | var result = "" 15 | var first = list.cBegin() 16 | var last = list.cEnd() 17 | 18 | do while first <> last 19 | result &= "(" & **first & ")" 20 | first.Increment() 21 | loop 22 | return result 23 | 24 | end function 25 | 26 | private function IsEven ( byref n as const integer ) as ext.bool 27 | return 0 = (n mod 2) 28 | end function 29 | 30 | '' ::::: (main) 31 | var list = ext.fbext_List( ((integer)) ) 32 | 33 | for n as integer = 1 to 5 34 | list.PushFront(-n) 35 | list.PushBack(n) 36 | next 37 | print ToString(list) 38 | 39 | list.RemoveIf(@IsEven) 40 | print ToString(list) 41 | -------------------------------------------------------------------------------- /examples/database/sqlite3.bas: -------------------------------------------------------------------------------- 1 | #include once "ext/database/database.bi" 2 | #include once "ext/database/drivers/sqlite3.bi" 3 | using ext.database 4 | 5 | var db = new Connection( driver._SQLite3("sqlite3.db") ) 6 | 7 | if db->connect() <> StatusCode.Ok then 8 | print "Error connecting to the database." 9 | print db->getError() 10 | delete db 11 | end 12 | end if 13 | 14 | var res = db->prepare( "SELECT * FROM test_table;" ) 15 | 16 | while res->execute() = StatusCode.MoreResults 17 | 18 | for n as integer = 0 to res->numColumns() - 1 19 | print res->columnName( n ) & " | "; 20 | next 21 | print 22 | for n as integer = 0 to res->numColumns() - 1 23 | print res->columnValue( n ) & " | "; 24 | next 25 | print 26 | 27 | wend 28 | 29 | delete res 30 | delete db 31 | 32 | 33 | -------------------------------------------------------------------------------- /examples/database/sqlite3.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/database/sqlite3.db -------------------------------------------------------------------------------- /examples/file/console_ex.bas: -------------------------------------------------------------------------------- 1 | ''File: console_ex.bas 2 | ''Description: Demonstration of ext.console functions. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/file/console.bi" 11 | 12 | var x = "Hello World!" 13 | 14 | for n as integer = 0 to len(x) - 1 15 | 16 | ext.console.Write( x[n] ) 17 | 18 | next 19 | 20 | ext.console.Write(!"\n") 21 | 22 | ext.console.WriteLine("From the FreeBASIC Extended Library!") 23 | -------------------------------------------------------------------------------- /examples/file/file.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/file/file.bi" 2 | # include once "ext/error.bi" 3 | 4 | var myfile = ext.File("test.txt", ext.ACCESS_TYPE.R) 5 | 6 | if myfile.open = ext.false then 7 | 8 | do while not myfile.eof 9 | 10 | print myfile.readLine 11 | 12 | loop 13 | 14 | else 15 | 16 | print ext.GetErrorText(myfile.LastError) 17 | 18 | end if 19 | -------------------------------------------------------------------------------- /examples/file/test.txt: -------------------------------------------------------------------------------- 1 | This is a test file. 2 | This could contain your data. 3 | Doesn't the Extended Library rock? 4 | Woot! 5 | -------------------------------------------------------------------------------- /examples/file/zip-list.bas: -------------------------------------------------------------------------------- 1 | 'ext.zipfile example 2 | #define fbext_nobuiltininstanciations() 1 3 | #include once "ext/file/zipfile.bi" 4 | 5 | var zf = command() 6 | if zf = "" then 7 | ? "List the files in the passed zip file." 8 | ? "Usage: " & command(0) & " file.zip" 9 | end 42 10 | end if 11 | 12 | var zfile = ext.ZipFile(zf) 13 | 14 | dim files() as string 15 | zfile.fileNames(files()) 16 | 17 | ? zf & " contains:" 18 | for n as integer = 0 to ubound(files) 19 | ? files(n) 20 | next 21 | 22 | -------------------------------------------------------------------------------- /examples/graphics/GetTextWidth.bas: -------------------------------------------------------------------------------- 1 | ''File: GetTextWidth.bas 2 | ''Description: Demonstration of ext.gfx.loadttf and ext.gfx.GetTextWidth functions. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | #include "ext/graphics/font.bi" 11 | using ext 12 | 13 | dim as FB.IMAGE ptr mysmallfont 14 | 15 | screenres 320,240,32 16 | 17 | paint (1,1),&hFFFFFF 18 | 19 | 20 | if ( gfx.font.loadttf("Vera.ttf", mysmallfont) = 1 ) then 21 | 22 | draw string (8,8), "This is a small test of the GetTextWidth Function.", , mysmallfont, ALPHA 23 | 24 | var text_width = gfx.font.GetTextWidth( mysmallfont, "This is a small test of the GetTextWidth Function." ) 25 | 26 | line (6,6)-(6 + text_width, 6 + mysmallfont->height),&hFF0000, B 27 | 28 | end if 29 | 30 | 31 | sleep 32 | 33 | -------------------------------------------------------------------------------- /examples/graphics/Scale2X.bas: -------------------------------------------------------------------------------- 1 | ''File: Scale2X.bas 2 | ''Description: Demonstration of ext.gfx.Scale2X function. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/graphics/image.bi" 11 | # include once "ext/graphics/manip.bi" 12 | 13 | using ext.gfx 14 | 15 | screenres 640, 480, 32 16 | 17 | var original = LoadImage("fbextlogo.jpg") 18 | 19 | if original <> 0 then 20 | original->Display 0, 0, PSET_ 21 | Scale2X( 0, original, original->width, 0 ) 22 | delete original 23 | else 24 | print "Failed" 25 | end if 26 | sleep 27 | -------------------------------------------------------------------------------- /examples/graphics/Vera.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/Vera.ttf -------------------------------------------------------------------------------- /examples/graphics/alphablit.bas: -------------------------------------------------------------------------------- 1 | ''File: alphablit.bas 2 | ''Description: Demonstration of ext.gfx.AlphaBlit function. 3 | '' 4 | ''Copyright (c) 2007-2024-2012 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/graphics/image.bi" 11 | # include once "ext/graphics/manip.bi" 12 | #include once "fbgfx.bi" 13 | 14 | using ext.gfx 15 | 16 | const as integer scrX = 320, scrY = 240 17 | screenres scrX, scrY, 32, ,FB.GFX_HIGH_PRIORITY 18 | var back = new Image(100,100,rgba(10,100,10,255)) 19 | var fore = new Image(100,100,rgba(100,10,100,255)) 20 | dim as integer alpha 21 | 22 | 23 | do 24 | alpha = 127.5 + 127.5 * sin(timer) 25 | screenlock 26 | cls 27 | back->Display scrX/2-back->width/2, scrY/2-back->height/2, PSET_ 28 | AlphaBlit( 0, fore, (scrX/2-fore->width/2)+50*sin(timer*2.3), (scrY/2-fore->height/2.5)+50*cos(timer*2), alpha ) 29 | locate 1,1 30 | print "additive alpha = " & alpha 31 | screensync 32 | screenunlock 33 | sleep 1,1 34 | 35 | loop until multikey(FB.SC_ESCAPE) 36 | 37 | delete back 38 | delete fore 39 | -------------------------------------------------------------------------------- /examples/graphics/blur.bas: -------------------------------------------------------------------------------- 1 | ''File: blur.bas 2 | ''Description: Demonstration of ext.gfx.Blur function. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/graphics/image.bi" 11 | # include once "ext/graphics/manip.bi" 12 | # include once "fbgfx.bi" 13 | 14 | using ext.gfx 15 | screenres 320,240,32 16 | 17 | 'test 1, blur the same image. 18 | var test1 = LoadImage("fbextlogo.jpg") 19 | test1->Display 160-test1->width\2,120-test1->height\2, PSET_ 20 | 21 | sleep 1000 22 | cls 23 | 24 | for i as integer = 1 to 256 25 | blur( test1, test1, 1 ) 26 | test1->Display i,120-test1->height\2, PSET_ 27 | next 28 | 29 | 'test 2, blur using 2 different buffers. 30 | var test2 = LoadImage("fbextlogo.jpg") 31 | dim as single amt 32 | 33 | for i as integer = 0 to 360 34 | amt = (i*5)*ext.math.pi_180 35 | blur(test1, test2, 1.5+1.5*sin(amt)) 36 | test1->Display 160-test1->width\2, 120-test1->height\2, PSET_ 37 | next 38 | 39 | delete test1 40 | delete test2 41 | 42 | print "Finished!" 43 | sleep 44 | -------------------------------------------------------------------------------- /examples/graphics/fbextlogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/fbextlogo.jpg -------------------------------------------------------------------------------- /examples/graphics/fbextlogo.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/fbextlogo.tga -------------------------------------------------------------------------------- /examples/graphics/gif.bas: -------------------------------------------------------------------------------- 1 | #include once "ext/graphics/gif.bi" 2 | 3 | screenres 320,220,32 4 | var ic = 0u 5 | var fn = command(1) 6 | var t = command(2) 7 | if fn = "" then fn = "test.gif" 8 | print "Loading " + curdir() + "\" + fn 9 | if t <> "" then 10 | var i = ext.gfx.gif.load(fn,ext.gfx.TARGET_FBNEW) 11 | windowtitle "Press any key to close" 12 | i->Display(0,0,ext.gfx.PSET_) 13 | sleep 14 | delete i 15 | else 16 | var i = ext.gfx.gif.loadAll(fn,ic) 17 | 18 | if i <> ext.null then 19 | if ic > 1 then 20 | windowtitle "Press ESC to Close" 21 | while not multikey(fb.SC_ESCAPE) 22 | for n as uinteger = 0 to ic-1 23 | i[n]->Display(0,0,ext.gfx.PSET_) 24 | sleep 200,1 25 | next 26 | wend 27 | else 28 | windowtitle "Press ANY Key to close" 29 | i[0]->Display(0,0,ext.gfx.PSET_) 30 | sleep 31 | end if 32 | delete[] i 33 | else 34 | print "could not load image" 35 | end if 36 | end if 37 | 38 | sleep -------------------------------------------------------------------------------- /examples/graphics/gir-dog-anim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/gir-dog-anim.png -------------------------------------------------------------------------------- /examples/graphics/grayscale.bas: -------------------------------------------------------------------------------- 1 | ''File: grayscale.bas 2 | ''Description: Demonstration of ext.gfx.grayscale function. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | #define FBEXT_NO_EXTERNAL_LIBS -1 11 | #include once "ext/graphics/manip.bi" 12 | #include once "ext/graphics/bmp.bi" 13 | #include once "ext/misc.bi" 14 | 15 | using ext.gfx 16 | 17 | screenres 640, 240, 32 18 | windowtitle "A simple example of the grayscale function using a Marmot." 19 | var img1 = bmp.load("marmot24bit.bmp") 20 | locate 10,1 21 | print "Photo provided by: http://www.flickr.com/photos/baggis/" 22 | print 23 | print "Preparing Marmot... "; 24 | FBEXT_TIMED_OP_START 25 | var img2 = grayscale(img1) 26 | var timeo = FBEXT_TIMED_OP_END 27 | print "press any key! " 28 | print 29 | 30 | if img2 = ext.null then 31 | print "fail" 32 | sleep 33 | system 34 | else 35 | print "Generated in " & timeo & " seconds" 36 | sleep 37 | end if 38 | cls 39 | 40 | img1->Display 1,1, PSET_ 41 | img2->Display 321,1, PSET_ 42 | 43 | sleep 44 | delete img1 45 | delete img2 46 | -------------------------------------------------------------------------------- /examples/graphics/image.bas: -------------------------------------------------------------------------------- 1 | ''File: image.bas 2 | ''Description: Demonstration of ext.gfx.image class with SharedPtr. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | #define fbext_NoBuiltinInstanciations() 1 11 | #include once "ext/memory/sharedptr.bi" 12 | #include once "ext/graphics/image.bi" 13 | 14 | ''Todo: Expand this example 15 | 16 | namespace ext.gfx 17 | fbext_Instanciate(fbext_SharedPtr, ((Image))) 18 | end namespace 19 | 20 | using ext.gfx 21 | screenres 320,240,32 22 | 23 | var sp1 = ext.gfx.fbext_SharedPtr((Image))(new Image(10,10,RGB(255,0,0))) 24 | 25 | sp1.get()->Display(1,1) 26 | 27 | sleep 28 | -------------------------------------------------------------------------------- /examples/graphics/intensity.bas: -------------------------------------------------------------------------------- 1 | ''File: intensify.bas 2 | ''Description: Demonstration of ext.gfx.Intensify function. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/graphics/image.bi" 11 | # include once "ext/graphics/manip.bi" 12 | # include once "fbgfx.bi" 13 | 14 | using ext 15 | screenres 320,240,32 16 | 'var image = gfx.LoadImage("fbextlogo.jpg") 17 | var image = new gfx.Image(100,100,rgba(100,50,100,255)) 18 | 19 | Do 20 | dim as ext.int32 intensity = 255*sin(timer) 21 | screenlock 22 | cls 23 | gfx.Intensify( 0, image, 160-image->width\2, 120-image->height\2, intensity ) 24 | screensync 25 | screenunlock 26 | sleep 1,1 27 | Loop until multikey(FB.SC_ESCAPE) 28 | -------------------------------------------------------------------------------- /examples/graphics/manip_test.bas: -------------------------------------------------------------------------------- 1 | ''File: manip_test.bas 2 | ''Description: Demonstration of ext.gfx.change_color function. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/graphics/manip.bi" 11 | 12 | using ext.gfx 13 | screenres 320,240,32 14 | 15 | 'create a 100x100 box and fill it with pink with full alpha 16 | var myimg = new image(100,100, &hFFFF00FF) 17 | 18 | print "Original image:" 19 | myimg->Display 1, 10, PSET_ 20 | sleep 21 | 22 | 'change pink to yellow, keeping the original alpha and treating it like a font buffer 23 | changeColor( myimg, &hFF00FF, &hFFF00F, ext.false, ext.true ) 24 | 25 | cls 26 | print "New image:" 27 | myimg->Display 1, 10, PSET_ 28 | sleep 29 | 30 | delete myimg 31 | -------------------------------------------------------------------------------- /examples/graphics/marmot16bit-alt.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/marmot16bit-alt.bmp -------------------------------------------------------------------------------- /examples/graphics/marmot16bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/marmot16bit.bmp -------------------------------------------------------------------------------- /examples/graphics/marmot1bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/marmot1bit.bmp -------------------------------------------------------------------------------- /examples/graphics/marmot24bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/marmot24bit.bmp -------------------------------------------------------------------------------- /examples/graphics/marmot2bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/marmot2bit.bmp -------------------------------------------------------------------------------- /examples/graphics/marmot4bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/marmot4bit.bmp -------------------------------------------------------------------------------- /examples/graphics/marmot8bit-alt.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/marmot8bit-alt.bmp -------------------------------------------------------------------------------- /examples/graphics/marmot8bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/marmot8bit.bmp -------------------------------------------------------------------------------- /examples/graphics/ofont.bas: -------------------------------------------------------------------------------- 1 | ''File: ofont.bas 2 | ''Description: Demonstration of ext.gfx.ofont class. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | #include "ext/graphics/font.bi" 11 | using ext.gfx.font 12 | 13 | dim as oFont ptr mysmallfont, mylargefont 14 | 15 | screenres 320,240,32 16 | 17 | mylargefont = new oFont( "#micross.ttf", 40 ) 18 | mysmallfont = new oFont( "Vera.ttf", 14 ) 19 | 20 | with *(mylargefont) 21 | .drawString 1, 10, "ABCDEFGHIJKLMN" 22 | .drawString 1, 50, "OPQRSTUVWXYZ" 23 | .drawString 1, 90, "abcdefghijklmn" 24 | .drawString 1, 130, "opqrstuvwxyz" 25 | 26 | Line (1,50)-(1,90) 27 | print .getWidth("ABCDEFGHIJKLMN") 28 | line (1,1)-(.getWidth("ABCDEFGHIJKLMN") + 1,1), &hff0000 29 | end with 30 | 31 | with *(mysmallfont) 32 | 33 | .drawString 1,170, "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 34 | .drawString 1,184, "abcdefghijklmnopqrstuvwxyz" 35 | 36 | end with 37 | sleep 38 | 39 | -------------------------------------------------------------------------------- /examples/graphics/rotate.bas: -------------------------------------------------------------------------------- 1 | ''File: rotate.bas 2 | ''Description: Demonstration of ext.gfx.Rotate function. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/graphics/image.bi" 11 | # include once "ext/graphics/manip.bi" 12 | 13 | using ext.gfx 14 | 15 | screenres 320, 240, 32 16 | 17 | var original = LoadImage("fbextlogo.jpg") 18 | 19 | var angle = 0 20 | 21 | do while not multikey(FB.SC_ESCAPE) 22 | 23 | screenlock 24 | cls 25 | Rotate(0, original, 160-original->width\2, 120-original->height\2, angle) 26 | screenunlock 27 | 28 | if multikey(FB.SC_RIGHT) then angle -= 5 29 | if multikey(FB.SC_LEFT) then angle += 5 30 | if multikey(FB.SC_UP) then angle = 0 31 | if multikey(FB.SC_DOWN) then angle = 180 32 | 33 | if angle < 0 then angle = 360 + angle 34 | if angle > 360 then angle = (angle - 360) 35 | 36 | sleep 5,1 37 | 38 | loop 39 | 40 | delete original 41 | -------------------------------------------------------------------------------- /examples/graphics/test.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/test.gif -------------------------------------------------------------------------------- /examples/graphics/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/test.png -------------------------------------------------------------------------------- /examples/graphics/testa.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/examples/graphics/testa.gif -------------------------------------------------------------------------------- /examples/graphics/tga.bas: -------------------------------------------------------------------------------- 1 | ''File: tga.bas 2 | ''Description: Demonstration of the tga loading function. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | #include once "ext/graphics/tga.bi" 11 | #include once "ext/misc.bi" 12 | using ext.gfx 13 | 14 | Dim As String file_name 15 | Dim As Double t 16 | 17 | file_name = Command( 1 ) 18 | 19 | screenres 800, 600, 32 20 | windowtitle "FBEXT TGA Viewer" 21 | 22 | If file_name = "" Then file_name = "fbextlogo.tga" 23 | 24 | FBEXT_TIMED_OP_START 25 | var img = tga.load( file_name ) 26 | var timeo = FBEXT_TIMED_OP_END 27 | 28 | If img <> 0 Then 29 | Print "Loaded in: " & timeo & " seconds" 30 | img->Display 16, 16, PSET_ 31 | delete img 32 | Else 33 | Print "Load error" 34 | End If 35 | 36 | Sleep 37 | End 38 | -------------------------------------------------------------------------------- /examples/graphics/triangle.bas: -------------------------------------------------------------------------------- 1 | ''File: triangle.bas 2 | ''Description: Demonstration of flat shaded triangle drawing function. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | #include once "ext/graphics/primitives.bi" 11 | using ext.gfx 12 | 13 | screenres 320,240,32 14 | var tbuffer = new image(320,240) 15 | 16 | do 17 | screenlock 18 | Triangle( tbuffer, rnd*320, rnd*240, rnd*320, rnd*240, rnd*320, rnd*240, rgba(rnd*255, rnd*255, rnd*255, rnd*255) ) 19 | tbuffer->Display 0, 0,trans_ 20 | 21 | Triangle( 0, rnd*320, rnd*240, rnd*320, rnd*240, rnd*320, rnd*240, rgba(rnd*255, rnd*255, rnd*255, 0) ) 22 | screenunlock 23 | sleep 1,1 24 | loop until len(inkey) 25 | -------------------------------------------------------------------------------- /examples/hash/md5file.bas: -------------------------------------------------------------------------------- 1 | 'Simple example of getting the md5sum of some file or files from the commandline. 2 | 'Output is compatible with the md5sum command. 3 | #include once "ext/hash.bi" 4 | #include once "ext/file/file.bi" 5 | using ext 6 | 7 | for n as integer = 1 to ( __FB_ARGC__ - 1 ) 8 | 9 | print hashes.md5( File(command(n)) ) & " *" & command(n) 10 | 11 | next 12 | -------------------------------------------------------------------------------- /examples/hash/md5text.bas: -------------------------------------------------------------------------------- 1 | 'Simple example of getting the md5sum of some text from the commandline. 2 | 'Equivalent to the command: echo -n 'Your text here' | md5sum 3 | #include once "ext/hash.bi" 4 | using ext 5 | 6 | print hashes.md5( command() ) & " *-" 7 | -------------------------------------------------------------------------------- /examples/hash/sha256file.bas: -------------------------------------------------------------------------------- 1 | 'Simple example of getting the sha256sum of some file or files from the commandline. 2 | #include once "ext/hash.bi" 3 | #include once "ext/file/file.bi" 4 | using ext 5 | 6 | for n as integer = 1 to ( __FB_ARGC__ - 1 ) 7 | 8 | print hashes.sha2( File(command(n)) ) & " *" & command(n) 9 | 10 | next 11 | -------------------------------------------------------------------------------- /examples/hash/sha256text.bas: -------------------------------------------------------------------------------- 1 | 'Simple example of getting the sha256sum of some text from the commandline. 2 | #include once "ext/hash.bi" 3 | using ext 4 | 5 | print hashes.sha2( command() ) & " *-" 6 | -------------------------------------------------------------------------------- /examples/logging/log-xml.bas: -------------------------------------------------------------------------------- 1 | #include once "ext/log.bi" 2 | using ext 3 | 4 | setLogMethod(0,LOG_FILE_XML) 5 | 6 | INFO("This is an example of the logging module") 7 | WARN("This should also work in a multithreaded environment.") 8 | 9 | -------------------------------------------------------------------------------- /examples/logging/log.bas: -------------------------------------------------------------------------------- 1 | #include once "ext/log.bi" 2 | using ext 3 | 4 | sub my_custom_log( byval l as loglevel, byref m as const string, byref f as const string, byval l_ as integer, byval fd as any ptr ) 5 | print m 6 | end sub 7 | 8 | enum MyChannels 9 | MAIN_C = 0 10 | FILE_C 11 | CUST_C 12 | end enum 13 | 14 | if not setNumberOfLogChannels(3) then 'gives us channel 0, 1 and 2 15 | 16 | setLogMethod(FILE_C,LOG_FILE) 'direct log channel 2 output to a file, should be writable by the process or will silently fail 17 | setLogLevel(FILE_C,_WARN) 'The default level is INFO, only print this level and above 18 | setLogMethod(CUST_C,LOG_CUSTOM,@my_custom_log) 'change it up a bit 19 | 20 | INFO("This is a test log message.") 'print this one 21 | DEBUG("This is a test debug message.") 'debug not printed by default 22 | INFOto(FILE_C,"This is also a test log message.") 'not printed 23 | WARNto(FILE_C,"Only one entry should be written to the log.") 'printed 24 | WARNto(CUST_C,"Whoa dude, we can do anything with this!") 'whoa! 25 | 26 | end if 27 | -------------------------------------------------------------------------------- /examples/math/perm-comb.bas: -------------------------------------------------------------------------------- 1 | ''File: perm-comb.bas 2 | ''Description: !!Write Me!! 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/math.bi" 11 | 12 | 13 | using ext.math 14 | 15 | print "number of 5-card poker hands = " & nPr(52, 5) 16 | print "number of unique 5-card poker hands = " & nCr(52, 5) 17 | -------------------------------------------------------------------------------- /examples/math/vectors.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/math.bi" 2 | 3 | dim as ext.math.vec4f my4 4 | dim as ext.math.vec3f my3 5 | 6 | 7 | my4.x = 1 8 | my4.y = 2 9 | my4.z = 3 10 | my4.w = 23 11 | 12 | print my4 13 | 14 | my4 = my4 + my4 15 | 16 | print my4 17 | 18 | my3 = my4 19 | print my3 20 | -------------------------------------------------------------------------------- /examples/memory/sharedptr.bas: -------------------------------------------------------------------------------- 1 | ''File: sharedptr.bas 2 | ''Description: Demonstration of ext.SharedPtr object. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/memory/sharedptr.bi" 11 | 12 | type Gizmo 13 | declare constructor ( byval n as integer ) 14 | declare destructor 15 | i as integer 16 | end type 17 | 18 | constructor Gizmo ( byval n as integer ) 19 | print "constructing Gizmo object: " & n 20 | i = n 21 | end constructor 22 | 23 | destructor Gizmo 24 | print "destroying Gizmo object: " & i 25 | end destructor 26 | 27 | namespace ext 28 | fbext_Instanciate(fbext_SharedPtr, ((Gizmo))) 29 | end namespace 30 | 31 | '' 32 | private sub DestroyGizmo ( byval p as Gizmo ptr ) 33 | delete p 34 | end sub 35 | 36 | '' a lib could expose a factory procedure to get new Gizmo objects.. 37 | function CreateGizmo ( byval n as integer ) as ext.fbext_SharedPtr((Gizmo)) 38 | return ext.fbext_SharedPtr((Gizmo))(new Gizmo(n), @DestroyGizmo) 39 | end function 40 | 41 | scope 42 | var sp1 = CreateGizmo(420) 43 | scope 44 | var sp2 = sp1 45 | end scope 46 | end scope ' <- users don't need to worry about destroying the Gizmo object. 47 | 48 | -------------------------------------------------------------------------------- /examples/misc/genuuid.bas: -------------------------------------------------------------------------------- 1 | 'This program is a simple example of using the UUID class 2 | #include once "ext/misc.bi" 3 | 4 | using ext 5 | 6 | var cmd = lcase(command()) 7 | if cmd = "-h" orelse cmd = "--help" then 8 | ? "genuuid - Generates a random UUID." 9 | ? "Powered by: " & FBEXT_VERSION_STRING 10 | end 1 11 | end if 12 | 13 | randomize timer 14 | 15 | var r = new misc.UUID() 16 | r->randomize() 17 | ? *r 18 | delete r 19 | -------------------------------------------------------------------------------- /examples/misc/vregex.bas: -------------------------------------------------------------------------------- 1 | #define PCRE_STATIC 2 | #include once "ext/vregex.bi" 3 | 4 | using ext 5 | 6 | sub test_url( byref url as string ) 7 | var expr = VRegex() 8 | with expr 9 | .searchOneLine() 10 | .startOfLine() 11 | ._then("http") 12 | .maybe("s") 13 | ._then("://") 14 | .maybe("www.") 15 | .anythingBut(" ") 16 | .endOfLine() 17 | end with 18 | 19 | if expr.test(url) then 20 | print url & " is a valid url." 21 | else 22 | print url & " is NOT a valid url." 23 | end if 24 | if expr.error_string <> 0 then 25 | ? *(expr.error_string) 26 | end if 27 | print expr 28 | end sub 29 | 30 | sub test_replace( ) 31 | var expr = VRegex() 32 | expr.find("red") 33 | print expr.replace("The house is red.","blue") 34 | print expr.replace("My name is Fred.","rank") 35 | print expr 36 | end sub 37 | 38 | var turl = "https://www.google.com" 39 | if command(1) <> "" then 40 | turl = command(1) 41 | end if 42 | 43 | print "URL Test:" 44 | test_url(turl) 45 | print 46 | 47 | print "Replace Test:" 48 | test_replace -------------------------------------------------------------------------------- /examples/misc/xinput-console.bas: -------------------------------------------------------------------------------- 1 | #include once "ext/input.bi" 2 | 3 | var x = ext.xInput() 4 | var color_ = (2 shl 16) OR 12 5 | x.print_cb_data = @color_ 6 | x.maxLength = 19 7 | cls 8 | print chr(201) & string(22,205) & chr(187) 9 | print chr(186) & " What is your name? " & chr(186) 10 | print chr(186) & string(22,32 ) & chr(186) 11 | print chr(186) & string(22,32 ) & chr(186) 12 | print chr(200) & string(22,205) & chr(188) 13 | 14 | var yname = x.get(3,4,">") 15 | 16 | cls 17 | print chr(201) & string(22,205) & chr(187) 18 | print chr(186) & " Hello " & chr(186) 19 | print chr(186) & string(22,32 ) & chr(186) 20 | print chr(186) & string(22,32 ) & chr(186) 21 | print chr(200) & string(22,205) & chr(188) 22 | 23 | locate 4,3 'locate uses y,x 24 | print yname 25 | locate 6,1 26 | print 27 | -------------------------------------------------------------------------------- /examples/misc/xinput-gui.bas: -------------------------------------------------------------------------------- 1 | #include once "ext/input.bi" 2 | using ext 3 | 4 | dim shared asking as bool 5 | function updateScreen( byval ch as uinteger, byval data_ as any ptr ) as bool 6 | cls 7 | print chr(201) & string(22,205) & chr(187) 8 | if asking then 9 | print chr(186) & " Hello " & chr(186) 10 | else 11 | print chr(186) & " What is your name? " & chr(186) 12 | end if 13 | print chr(186) & string(22,32 ) & chr(186) 14 | print chr(186) & string(22,32 ) & chr(186) 15 | print chr(200) & string(22,205) & chr(188) 16 | return true 17 | end function 18 | 19 | screenres 320, 240, 32 20 | windowtitle "Please answer the question." 21 | 22 | var x = xInput() 23 | 24 | with x 25 | .maxLength = 20 26 | .callback = @updateScreen 27 | end with 28 | 29 | var yname = x.get(2*8,3*8) 30 | 31 | asking = true 32 | 33 | updateScreen(0,0) 34 | windowtitle "Thank you." 35 | 36 | draw string (2*8,3*8), yname 37 | 38 | sleep 39 | -------------------------------------------------------------------------------- /examples/net/http-getfile.bas: -------------------------------------------------------------------------------- 1 | #include once "ext/net/socket.bi" 2 | using ext 3 | 'This is just an example, in real code you should use the getRemoteFileTo* functions 4 | 'in ext/net/http.bi 5 | var sckt = net.socket 6 | If sckt.client("http://ext.freebasic.net", 80) <> net.SOCKET_OK Then 7 | Print "Unable to connect to http://ext.freebasic.net, sunspots?" 8 | End 42 9 | End If 10 | 11 | sckt.putHTTPRequest("http://ext.freebasic.net/dev-docs/index.html","GET") 12 | 13 | var rheader = " " 14 | var con_len = 0 15 | 16 | print "Response (Header):" 17 | while rheader <> "" 18 | rheader = trim(sckt.getLine()) 19 | if left(rheader,15) = "Content-Length:" then 20 | con_len = valint(right(rheader,len(rheader)-15)) 21 | end if 22 | print rheader 23 | 24 | wend 25 | 26 | print "Content --------" 27 | if con_len <> 0 then 28 | var content = space(con_len) 29 | sckt.get(*cast(ubyte ptr,@content[0]),con_len,net.BLOCK) 30 | print content 31 | else 32 | print "**NO CONTENT**" 33 | end if 34 | sckt.close 35 | 36 | -------------------------------------------------------------------------------- /examples/net/http-getfiletomem.bas: -------------------------------------------------------------------------------- 1 | #include once "ext/net/http.bi" 2 | using ext 3 | 4 | var retlen = 0u 5 | var st = net.HTTP_STATUS.NONE 6 | 7 | var buf = net.getRemoteFileToMemory("http://ext.freebasic.net/dev-docs/index.html",retlen,st) 8 | 9 | ? "Status: " & st 10 | if buf <> null then 11 | ? *(cast(zstring ptr,buf)) 12 | delete[] buf 13 | end if 14 | 15 | -------------------------------------------------------------------------------- /examples/net/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FBEXT::TESTSERVER 5 | 6 | 7 | 8 |

It Works!

9 |

The FreeBASIC Extended Library is now serving web pages!

10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/preprocessor/seq-elem.bi: -------------------------------------------------------------------------------- 1 | ''File: seq-elem.bi 2 | ''Description: Demonstration of sequence element preprocessor macros. 3 | '' 4 | ''Copyright (c) 2007 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include once "ext/preprocessor/seq/elem.bi" 11 | 12 | # define SEQ (byte)(short)(integer)(longint) 13 | 14 | # print FBEXT_PP_SEQ_ELEM(0, SEQ) ' byte 15 | # print FBEXT_PP_SEQ_ELEM(1, SEQ) ' short 16 | # print FBEXT_PP_SEQ_ELEM(2, SEQ) ' integer 17 | # print FBEXT_PP_SEQ_ELEM(3, SEQ) ' longint 18 | -------------------------------------------------------------------------------- /examples/strings/join.bas: -------------------------------------------------------------------------------- 1 | ''File: join.bas 2 | ''Description: Demonstration of ext.strings.join function. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include "ext/strings.bi" 11 | 12 | using ext.strings 13 | 14 | dim strings(3) as string = { "a", "b", "c", "d" } 15 | 16 | ' a b c d 17 | ' 18 | print join(strings()) 19 | 20 | ' abcd 21 | ' 22 | print join(strings(), "") 23 | 24 | ' a 25 | ' b 26 | ' c 27 | ' d 28 | ' 29 | print join(strings(), !"\r\n") 30 | -------------------------------------------------------------------------------- /examples/strings/repeat.bas: -------------------------------------------------------------------------------- 1 | ''File: repeat.bas 2 | ''Description: Demonstration of ext.strings.repeat function. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include "ext/strings.bi" 11 | 12 | using ext.strings 13 | 14 | ' AAAAA 15 | ' 16 | print repeat(65, 5) 17 | 18 | ' abcabcabc 19 | ' 20 | print repeat("abc", 3) 21 | -------------------------------------------------------------------------------- /examples/strings/replace.bas: -------------------------------------------------------------------------------- 1 | ''File: replace.bas 2 | ''Description: Demonstration of ext.strings.replace and replace_copy functions. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include "ext/strings.bi" 11 | 12 | using ext.strings 13 | 14 | dim strings(3) as string = _ 15 | { _ 16 | "John likes to fly kites.", _ 17 | "'Flying kites is fun,' said John.", _ 18 | "December 25th is John's birthday.", _ 19 | "On his birthday, John received a brand new kite." _ 20 | } 21 | 22 | dim oldtexts(1) as const string = { "John", "kite" } 23 | dim newtexts(1) as const string = { "Luke", "airplane" } 24 | 25 | ext.strings.replace(strings(), oldtexts(), newtexts()) 26 | 27 | ' Luke likes to fly airplanes. 28 | ' 'Flying airplanes is fun,' said Luke. 29 | ' December 25th is Luke's birthday. 30 | ' On his birthday, Luke received a brand new airplane. 31 | ' 32 | for i as integer = lbound(strings) to ubound(strings) 33 | print strings(i) 34 | next 35 | 36 | ' Thequickbrownfox 37 | ' 38 | print ReplaceCopy("The quick brown fox", " ", "") 39 | -------------------------------------------------------------------------------- /examples/strings/reverse.bas: -------------------------------------------------------------------------------- 1 | ''File: reverse.bas 2 | ''Description: Demonstration of ext.strings.reverse function. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | # include "ext/strings.bi" 11 | 12 | using ext.strings 13 | 14 | var text = "abcef" 15 | reverse(text) 16 | print text 17 | 18 | print ReverseCopy("12345") 19 | -------------------------------------------------------------------------------- /examples/xml/simple.bas: -------------------------------------------------------------------------------- 1 | ''File: simple.bas 2 | ''Description: Demonstration of ext.xml object. 3 | '' 4 | ''Copyright (c) 2007-2024 FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. (See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING) 9 | 10 | #include "ext/xml.bi" 11 | using ext 12 | 13 | dim as xml.tree foo 14 | 15 | foo.root->appendChild("root") 16 | 17 | foo.root->child("root")->appendChild("tag") 18 | foo.root->child("root")->appendChild("tag") 19 | foo.root->child("root")->appendChild("tag") 20 | 21 | foo.root->child("root")->child("tag", 1)->attribute("attribute") = "value" 22 | foo.root->child("root")->child("tag", 2)->attribute("unicode") = "你好,世界!" 23 | 24 | ? foo 25 | 26 | foo.clear() 27 | 28 | foo = !"" 29 | 30 | ? foo 31 | -------------------------------------------------------------------------------- /include/freebasic/ext/containers.bi: -------------------------------------------------------------------------------- 1 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 2 | '' 3 | ''Distributed under the FreeBASIC Extended Library Group license. See 4 | ''accompanying file LICENSE.txt or copy at 5 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # pragma once 8 | # ifndef FBEXT_CONTAINERS_BI__ 9 | # define FBEXT_CONTAINERS_BI__ -1 10 | 11 | # include once "ext/containers/array.bi" 12 | # include once "ext/containers/list.bi" 13 | # include once "ext/containers/queue.bi" 14 | # include once "ext/containers/stack.bi" 15 | 16 | # include once "ext/containers/trees.bi" 17 | # include once "ext/containers/bitarray.bi" 18 | # include once "ext/containers/hashtable.bi" 19 | 20 | # endif ' include guard 21 | -------------------------------------------------------------------------------- /include/freebasic/ext/conversion.bi: -------------------------------------------------------------------------------- 1 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 2 | '' 3 | ''Distributed under the FreeBASIC Extended Library Group license. See 4 | ''accompanying file LICENSE.txt or copy at 5 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # pragma once 8 | #ifndef FBEXT_CONVERSION_BI__ 9 | #define FBEXT_CONVERSION_BI__ -1 10 | 11 | #include once "ext/conversion/base64.bi" 12 | 13 | #if not __FB_MT__ 14 | #inclib "ext-conversion" 15 | #ifdef FBEXT_MULTITHREADED 16 | #error "The multithreaded version of the library must be built using the -mt compiler option." 17 | #endif 18 | #else 19 | #inclib "ext-conversion.mt" 20 | #ifndef FBEXT_MULTITHREADED 21 | #define FBEXT_MULTITHREADED 1 22 | #endif 23 | #endif 24 | 25 | #endif 'FBEXT_CONVERSION_BI__ 26 | -------------------------------------------------------------------------------- /include/freebasic/ext/database/drivers/mysql.bi: -------------------------------------------------------------------------------- 1 | ''Title: database/drivers/mysql.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | #include once "ext/database/driver.bi" 11 | #if not __FB_MT__ 12 | #inclib "ext-database-driver-mysql" 13 | #ifdef FBEXT_MULTITHREADED 14 | #error "The multithreaded version of the library must be built using the -mt compiler option." 15 | #endif 16 | #else 17 | #inclib "ext-database-driver-mysql.mt" 18 | #ifndef FBEXT_MULTITHREADED 19 | #define FBEXT_MULTITHREADED 1 20 | #endif 21 | #endif 22 | 23 | 24 | ''Namespace: ext.database.driver 25 | namespace ext.database.driver 26 | 27 | ''Function: _MySQL 28 | ''Returns a pointer to a populated to allow access to a MySQL database. 29 | ''Connect string is in the format: username:passwd@host:port/dbname 30 | ''passwd, port and dbname are all optional, string without would be username@host 31 | declare function _MySQL( byref conn as const string ) as DatabaseDriver ptr 32 | 33 | 34 | end namespace 35 | -------------------------------------------------------------------------------- /include/freebasic/ext/database/drivers/postgre.bi: -------------------------------------------------------------------------------- 1 | ''Title: database/drivers/postgre.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | #include once "ext/database/driver.bi" 11 | #if not __FB_MT__ 12 | #inclib "ext-database-driver-postgre" 13 | #ifdef FBEXT_MULTITHREADED 14 | #error "The multithreaded version of the library must be built using the -mt compiler option." 15 | #endif 16 | #else 17 | #inclib "ext-database-driver-postgre.mt" 18 | #ifndef FBEXT_MULTITHREADED 19 | #define FBEXT_MULTITHREADED 1 20 | #endif 21 | #endif 22 | 23 | 24 | ''Namespace: ext.database.driver 25 | namespace ext.database.driver 26 | 27 | ''Function: _Postgre 28 | ''Returns a pointer to a populated to allow access to a Postgre database. 29 | ''Connect string is in the same format as would be passed to PQconnectdb 30 | declare function _Postgre( byref conn as const string ) as DatabaseDriver ptr 31 | 32 | 33 | end namespace 34 | -------------------------------------------------------------------------------- /include/freebasic/ext/database/drivers/sqlite3.bi: -------------------------------------------------------------------------------- 1 | ''Title: database/drivers/sqlite3.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | #include once "ext/database/drivers/sqlite3driver_int.bi" 11 | #include once "ext/database/driver.bi" 12 | #if not __FB_MT__ 13 | #inclib "ext-database-driver-sqlite3" 14 | #ifdef FBEXT_MULTITHREADED 15 | #error "The multithreaded version of the library must be built using the -mt compiler option." 16 | #endif 17 | #else 18 | #inclib "ext-database-driver-sqlite3.mt" 19 | #ifndef FBEXT_MULTITHREADED 20 | #define FBEXT_MULTITHREADED 1 21 | #endif 22 | #endif 23 | 24 | 25 | ''Namespace: ext.database.driver 26 | namespace ext.database.driver 27 | 28 | ''Function: _SQLite3 29 | ''Returns a pointer to a populated to allow access to a SQLite3 database. 30 | ''Connect string is filename of database to open. 31 | declare function _SQLite3( byref conn as const string ) as DatabaseDriver ptr 32 | 33 | 34 | end namespace 35 | -------------------------------------------------------------------------------- /include/freebasic/ext/file.bi: -------------------------------------------------------------------------------- 1 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 2 | '' 3 | ''Distributed under the FreeBASIC Extended Library Group license. See 4 | ''accompanying file LICENSE.txt or copy at 5 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # pragma once 8 | #ifndef FBEXT_FILE__BI__ 9 | #define FBEXT_FILE__BI__ -1 10 | 11 | #include once "ext/file/file.bi" 12 | #include once "ext/file/console.bi" 13 | 14 | #endif 'FBEXT_FILE__BI__ 15 | -------------------------------------------------------------------------------- /include/freebasic/ext/graphics.bi: -------------------------------------------------------------------------------- 1 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 2 | '' 3 | ''Distributed under the FreeBASIC Extended Library Group license. See 4 | ''accompanying file LICENSE.txt or copy at 5 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # pragma once 8 | #ifndef FBEXT_GFX__BI__ 9 | #define FBEXT_GFX__BI__ -1 10 | 11 | #include once "fbgfx.bi" 12 | 13 | #include once "ext/graphics/font.bi" 14 | #include once "ext/graphics/colors.bi" 15 | #include once "ext/graphics/bmp.bi" 16 | #include once "ext/graphics/manip.bi" 17 | #include once "ext/graphics/collision.bi" 18 | #include once "ext/graphics/sprite.bi" 19 | #include once "ext/graphics/primitives.bi" 20 | #include once "ext/graphics/image.bi" 21 | #include once "ext/graphics/tga.bi" 22 | #include once "ext/graphics/xpm.bi" 23 | 24 | 25 | #ifndef FBEXT_NO_EXTERNAL_LIBS 26 | 27 | #include once "ext/graphics/jpg.bi" 28 | #include once "ext/graphics/png.bi" 29 | #include once "ext/graphics/gif.bi" 30 | 31 | #endif 32 | 33 | #Include Once "ext/graphics/detail/common.bi" 34 | 35 | #endif 'FBEXT_GFX__BI__ 36 | -------------------------------------------------------------------------------- /include/freebasic/ext/graphics/xpm.bi: -------------------------------------------------------------------------------- 1 | ''Title: graphics/xpm.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | #ifndef FBEXT_GFX_XPM_BI__ 11 | #define FBEXT_GFX_XPM_BI__ -1 12 | 13 | #include once "ext/detail/common.bi" 14 | #include once "ext/file/file.bi" 15 | #include once "ext/graphics/detail/common.bi" 16 | #include once "fbgfx.bi" 17 | 18 | #ifndef FBEXT_BUILD_NO_GFX_LOADERS 19 | #define FBEXT_BUILD_NO_GFX_LOADERS -1 20 | #include once "ext/graphics/image.bi" 21 | #undef FBEXT_BUILD_NO_GFX_LOADERS 22 | #endif 23 | 24 | ''Namespace: ext.gfx.xpm 25 | namespace ext.gfx.xpm 26 | 27 | ''Function: load 28 | ''Load a version 1 XPM image. 29 | '' 30 | ''Parameters: 31 | ''fn - File object pointing to file or buffer containing XPM image. 32 | '' 33 | ''Returns: 34 | '' ptr on success or NULL on error 35 | declare function load ( byref fn as File, byval t as target_e = TARGET_FBNEW ) as Image ptr 36 | 37 | #ifndef FBEXT_BUILD_NO_GFX_LOADERS 38 | sub loadXPMdriver() constructor 39 | var loader = new GraphicsLoader 40 | loader->f = @load 41 | getDriver("xpm",loader) 42 | end sub 43 | #endif 44 | 45 | end namespace 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /include/freebasic/ext/hash.bi: -------------------------------------------------------------------------------- 1 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 2 | '' 3 | ''Distributed under the FreeBASIC Extended Library Group license. See 4 | ''accompanying file LICENSE.txt or copy at 5 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # pragma once 8 | # ifndef FBEXT_HASH__BI__ 9 | # define FBEXT_HASH__BI__ -1 10 | 11 | # include once "ext/hash/joaat.bi" 12 | # include once "ext/hash/crc32.bi" 13 | # include once "ext/hash/adler32.bi" 14 | # include once "ext/hash/md5.bi" 15 | # include once "ext/hash/sha2.bi" 16 | # include once "ext/hash/sha3.bi" 17 | 18 | #if not __FB_MT__ 19 | #inclib "ext-hash" 20 | #ifdef FBEXT_MULTITHREADED 21 | #error "The multithreaded version of the library must be built using the -mt compiler option." 22 | #endif 23 | #else 24 | #inclib "ext-hash.mt" 25 | #ifndef FBEXT_MULTITHREADED 26 | #define FBEXT_MULTITHREADED 1 27 | #endif 28 | #endif 29 | 30 | # endif ' include guard 31 | -------------------------------------------------------------------------------- /include/freebasic/ext/hash/adler32.bi: -------------------------------------------------------------------------------- 1 | ''Title: hash/adler32.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | #ifndef FBEXT_HASH_ADLER32_BI__ 11 | #define FBEXT_HASH_ADLER32_BI__ -1 12 | 13 | #include once "ext/detail/common.bi" 14 | 15 | ''Namespace: ext.hashes 16 | 17 | namespace ext.hashes 18 | 19 | ''Function: adler32 20 | ''Returns the adler32 hash of a memory buffer. 21 | '' 22 | ''Parameters: 23 | ''buf - pointer to the buffer to hash. 24 | ''buf_len - the length of the buffer in bytes. 25 | ''adler - optional value to initalize the hash with, defaults to 0 26 | '' 27 | ''Returns: 28 | ''ulong containing the hash. 29 | '' 30 | declare function adler32 overload ( byval buf As const any ptr, byval buf_len as uinteger, byval adler as ulong = 0 ) As ulong 31 | 32 | ''Function: adler32 33 | ''Returns the adler32 hash of a string. 34 | '' 35 | ''Parameters: 36 | ''buf - the string to hash. 37 | '' 38 | ''Returns: 39 | ''ulong containing the hash. 40 | '' 41 | declare function adler32 overload ( byref buf as const string ) as ulong 42 | 43 | end namespace ' ext.hashes 44 | 45 | #endif 'FBEXT_HASH_ADLER32_BI__ 46 | -------------------------------------------------------------------------------- /include/freebasic/ext/hash/crc32.bi: -------------------------------------------------------------------------------- 1 | ''Title: hash/crc32.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | #ifndef FBEXT_HASH_CRC32_BI__ 11 | #define FBEXT_HASH_CRC32_BI__ -1 12 | 13 | #include once "ext/detail/common.bi" 14 | 15 | ''Namespace: ext.hashes 16 | 17 | namespace ext.hashes 18 | 19 | ''Function: crc32 20 | ''Calculates the 32 bit cyclic redundancy check of a memory buffer. 21 | '' 22 | ''Parameters: 23 | ''buf - pointer to memory buffer. 24 | ''buf_len - length of buffer in bytes. 25 | ''crc - optional value to initialize the hash with, defaults to 0 26 | '' 27 | ''Returns: 28 | ''ulong containing the hash. 29 | '' 30 | declare function crc32 overload ( byval buf As const any ptr, byval buf_len as uinteger, byval crc as ulong = 0 ) As ulong 31 | 32 | ''Function: crc32 33 | ''Calculates the 32 bit cyclic redundancy check of a string. 34 | '' 35 | ''Parameters: 36 | ''buf - string to hash. 37 | '' 38 | ''Returns: 39 | ''ulong containing the hash. 40 | '' 41 | declare function crc32 ( byref buf as const string ) as ulong 42 | 43 | end namespace ' ext.hashes 44 | 45 | #endif 'FBEXT_HASH_CRC32_BI__ 46 | -------------------------------------------------------------------------------- /include/freebasic/ext/hash/hmac.bi: -------------------------------------------------------------------------------- 1 | ''Title: hash/hmac.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | #include once "ext/hash.bi" 11 | 12 | ''Namespace: ext.hashes.hmac 13 | namespace ext.hashes.hmac 14 | 15 | declare function md5 ( byref key as const string, byref msg as const string ) as string 16 | 17 | declare function sha256 ( byref key as const string, byref msg as const string ) as string 18 | 19 | declare function sha3_256 ( byref key as const string, byref msg as const string ) as string 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /include/freebasic/ext/math.bi: -------------------------------------------------------------------------------- 1 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 2 | '' 3 | ''Distributed under the FreeBASIC Extended Library Group license. See 4 | ''accompanying file LICENSE.txt or copy at 5 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # pragma once 8 | # ifndef FBEXT_MATH_BI__ 9 | # define FBEXT_MATH_BI__ -1 10 | 11 | # include once "ext/math/vector2.bi" 12 | # include once "ext/math/vector3.bi" 13 | # include once "ext/math/vector4.bi" 14 | # include once "ext/math/line2.bi" 15 | # include once "ext/math/intersects.bi" 16 | # include once "ext/math/projections.bi" 17 | # include once "ext/math/reflections.bi" 18 | 19 | # include once "ext/math/matrix.bi" 20 | # include once "ext/math/factorial.bi" 21 | # include once "ext/math/pow2.bi" 22 | # include once "ext/math/random.bi" 23 | # include once "ext/math/npr.bi" 24 | # include once "ext/math/ncr.bi" 25 | 26 | # endif 27 | -------------------------------------------------------------------------------- /include/freebasic/ext/math/factorial.bi: -------------------------------------------------------------------------------- 1 | ''Title: math/factorial.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | # ifndef FBEXT_MATH_FACTORIAL_BI__ 11 | # define FBEXT_MATH_FACTORIAL_BI__ -1 12 | 13 | # include once "ext/math/detail/common.bi" 14 | 15 | ''Namespace: ext.math 16 | 17 | namespace ext.math 18 | 19 | ''Function: factorial 20 | ''Computes a factorial number up to 21 | '' 22 | ''Parameters: 23 | ''n - the number to calculate the factorial of. 24 | '' 25 | ''Returns: 26 | ''The factorial of n. 27 | '' 28 | declare function factorial (byval n as double) as double 29 | 30 | ''Constant: MAX_FACTORIAL 31 | const MAX_FACTORIAL = 256# 32 | 33 | end namespace 34 | 35 | # endif 36 | -------------------------------------------------------------------------------- /include/freebasic/ext/math/ncr.bi: -------------------------------------------------------------------------------- 1 | ''Title: math/ncr.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | # ifndef FBEXT_MATH_NCR_BI__ 11 | # define FBEXT_MATH_NCR_BI__ -1 12 | 13 | # include once "ext/math/detail/common.bi" 14 | 15 | '' Namespace: ext.math 16 | 17 | namespace ext.math 18 | 19 | '' Function: nCr 20 | '' Finds the number of combinations of a sub-set of elements of a set. 21 | '' 22 | '' Parameters: 23 | '' n - the total number of elements in the set. 24 | '' r - the number of elements in the sub-set. 25 | '' 26 | '' Returns: 27 | '' The number of combinations of size //r// possible from a set of 28 | '' size //n//. 29 | declare function nCr (byval n as ulongint, byval r as ulongint) as ulongint 30 | 31 | end namespace 32 | 33 | # endif 34 | -------------------------------------------------------------------------------- /include/freebasic/ext/math/npr.bi: -------------------------------------------------------------------------------- 1 | ''Title: math/npr.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | # ifndef FBEXT_MATH_NPR_BI__ 11 | # define FBEXT_MATH_NPR_BI__ -1 12 | 13 | # include once "ext/math/detail/common.bi" 14 | 15 | '' Namespace: ext.math 16 | 17 | namespace ext.math 18 | 19 | '' Function: nPr 20 | '' Finds the number of permutations of a sub-set of elements of a set. 21 | '' 22 | '' Parameters: 23 | '' n - the total number of elements in the set. 24 | '' r - the number of elements in the sub-set. 25 | '' 26 | '' Returns: 27 | '' The number of permutations of size //r// possible from a set of 28 | '' size //n//. 29 | declare function nPr (byval n as ulongint, byval r as ulongint) as ulongint 30 | 31 | end namespace 32 | 33 | # endif 34 | -------------------------------------------------------------------------------- /include/freebasic/ext/memory/allocate.bi: -------------------------------------------------------------------------------- 1 | ''Title: memory/allocate.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | # pragma once 11 | # ifndef FBEXT_MEMORY_ALLOCATE_BI__ 12 | # define FBEXT_MEMORY_ALLOCATE_BI__ -1 13 | #include once "ext/detail/common.bi" 14 | 15 | ''Namespace: ext 16 | namespace ext 17 | 18 | ''Function: callocateAligned 19 | ''Allocate a special buffer, that is aligned to a multiple of 16, for SSE usage 20 | '' 21 | declare function callocateAligned( byval size as sizetype ) as any ptr 22 | 23 | end namespace 24 | 25 | # endif -------------------------------------------------------------------------------- /include/freebasic/ext/memory/detail/common.bi: -------------------------------------------------------------------------------- 1 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 2 | '' 3 | ''Distributed under the FreeBASIC Extended Library Group license. See 4 | ''accompanying file LICENSE.txt or copy at 5 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # ifndef FBEXT_MEMORY_DETAIL_COMMON_BI__ 8 | # define FBEXT_MEMORY_DETAIL_COMMON_BI__ -1 9 | 10 | # include once "ext/detail/common.bi" 11 | 12 | namespace ext 13 | 14 | # define fbext_DestroyProc(T_) fbext_TypeID((DestroyProc) T_) 15 | # macro fbext_DestroyProc_Declare(T_) 16 | : 17 | type fbext_DestroyProc(T_) as sub ( byval p as fbext_TypeName(T_) ptr ) 18 | : 19 | # endmacro 20 | 21 | end namespace 22 | 23 | # endif ' include guard 24 | -------------------------------------------------------------------------------- /include/freebasic/ext/php.bi: -------------------------------------------------------------------------------- 1 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 2 | '' 3 | ''Distributed under the FreeBASIC Extended Library Group license. See 4 | ''accompanying file LICENSE.txt or copy at 5 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # pragma once 8 | # ifndef FBEXT_PHP_BI__ 9 | # define FBEXT_PHP_BI__ -1 10 | 11 | # include once "ext/php/strings.bi" 12 | 13 | #if not __FB_MT__ 14 | #inclib "ext-php" 15 | #ifdef FBEXT_MULTITHREADED 16 | #error "The multithreaded version of the library must be built using the -mt compiler option." 17 | #endif 18 | #else 19 | #inclib "ext-php.mt" 20 | #ifndef FBEXT_MULTITHREADED 21 | #define FBEXT_MULTITHREADED 1 22 | #endif 23 | #endif 24 | 25 | # endif ' include guard 26 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor.bi: -------------------------------------------------------------------------------- 1 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 2 | '' 3 | ''Distributed under the FreeBASIC Extended Library Group license. See 4 | ''accompanying file LICENSE.txt or copy at 5 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # pragma once 8 | # ifndef FBEXT_INCLUDED_PREPROCESSOR_BI__ 9 | # define FBEXT_INCLUDED_PREPROCESSOR_BI__ -1 10 | 11 | /' lmf: note the order of least recursion '/ 12 | # include once "ext/preprocessor/cat.bi" 13 | # include once "ext/preprocessor/facilities.bi" 14 | # include once "ext/preprocessor/stringize.bi" 15 | # include once "ext/preprocessor/logical.bi" 16 | # include once "ext/preprocessor/punctuation.bi" 17 | # include once "ext/preprocessor/tuple.bi" 18 | # include once "ext/preprocessor/arithmetic.bi" 19 | # include once "ext/preprocessor/array.bi" 20 | # include once "ext/preprocessor/comparison.bi" 21 | # include once "ext/preprocessor/repetition.bi" 22 | # include once "ext/preprocessor/seq.bi" 23 | # include once "ext/preprocessor/control.bi" 24 | 25 | # include once "ext/preprocessor/struct.bi" 26 | 27 | # endif ' include guard 28 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/arithmetic.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/arithmetic.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_ARITHMETIC_BI__ 19 | # define FBEXT_INCLUDED_PP_ARITHMETIC_BI__ -1 20 | 21 | # include once "ext/preprocessor/arithmetic/inc.bi" 22 | # include once "ext/preprocessor/arithmetic/dec.bi" 23 | # include once "ext/preprocessor/arithmetic/add.bi" 24 | # include once "ext/preprocessor/arithmetic/sub.bi" 25 | # include once "ext/preprocessor/arithmetic/mul.bi" 26 | 27 | # endif ' include guard 28 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/arithmetic/add.bi: -------------------------------------------------------------------------------- 1 | '' Title: preprocessor/arithmetic/add.bi 2 | '' 3 | '' About: License 4 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 6 | '' 7 | '' Distributed under the Boost Software License, Version 1.0. See 8 | '' accompanying file LICENSE_1_0.txt or copy at 9 | '' http://www.boost.org/LICENSE_1_0.txt) 10 | '' 11 | '' Distributed under the FreeBASIC Extended Library Group license. See 12 | '' accompanying file LICENSE.txt or copy at 13 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 14 | 15 | # pragma once 16 | # ifndef FBEXT_INCLUDED_PP_ADD_BI__ 17 | # define FBEXT_INCLUDED_PP_ADD_BI__ -1 18 | 19 | # include once "ext/preprocessor/repetition/repeat.bi" 20 | # include once "ext/preprocessor/arithmetic/inc.bi" 21 | 22 | # define FBEXT_PP_ADD(lhs, rhs) fbextPP_Add(lhs, rhs) 23 | 24 | '' Macro: fbextPP_Add 25 | '' Adds two numbers together. 26 | '' 27 | '' Parameters: 28 | '' lhs - A number. 29 | '' rhs - A number. 30 | '' 31 | '' Returns: 32 | '' The sum of the two numbers. 33 | # define fbextPP_Add(lhs, rhs) _ 34 | FBEXT_PP_REPEAT(rhs, fbextPP_Add_L, __) lhs FBEXT_PP_REPEAT(rhs, fbextPP_Add_R, __) 35 | 36 | # define fbextPP_Add_L(n, __) FBEXT_PP_INC( 37 | # define fbextPP_Add_R(n, __) ) 38 | 39 | # endif ' include guard 40 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/arithmetic/sub.bi: -------------------------------------------------------------------------------- 1 | '' Title: preprocessor/arithmetic/sub.bi 2 | '' 3 | '' About: License 4 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 6 | '' 7 | '' Distributed under the Boost Software License, Version 1.0. See 8 | '' accompanying file LICENSE_1_0.txt or copy at 9 | '' http://www.boost.org/LICENSE_1_0.txt) 10 | '' 11 | '' Distributed under the FreeBASIC Extended Library Group license. See 12 | '' accompanying file LICENSE.txt or copy at 13 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 14 | 15 | # pragma once 16 | # ifndef FBEXT_INCLUDED_PP_SUB_BI__ 17 | # define FBEXT_INCLUDED_PP_SUB_BI__ -1 18 | 19 | # include once "ext/preprocessor/repetition/repeat.bi" 20 | # include once "ext/preprocessor/arithmetic/dec.bi" 21 | 22 | # define FBEXT_PP_SUB(lhs, rhs) fbextPP_Sub(lhs, rhs) 23 | 24 | '' Macro: fbextPP_Sub 25 | '' Subtracts one number from another. 26 | '' 27 | '' Parameters: 28 | '' lhs - A number. 29 | '' rhs - A number. 30 | '' 31 | '' Returns: 32 | '' The result of the subtraction. 33 | # define fbextPP_Sub(lhs, rhs) _ 34 | FBEXT_PP_REPEAT(rhs, fbextPP_Sub__L, __) lhs FBEXT_PP_REPEAT(rhs, fbextPP_Sub__R, __) 35 | 36 | # define fbextPP_Sub__L(n, data) FBEXT_PP_DEC( 37 | 38 | # define fbextPP_Sub__R(n, data) ) 39 | 40 | # endif ' include guard 41 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/array.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/array.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2002, Paul Mensonides 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_ARRAY_BI__ 19 | # define FBEXT_INCLUDED_PP_ARRAY_BI__ -1 20 | 21 | # include once "ext/preprocessor/array/data.bi" 22 | # include once "ext/preprocessor/array/elem.bi" 23 | # include once "ext/preprocessor/array/pushback.bi" 24 | # include once "ext/preprocessor/array/pushfront.bi" 25 | # include once "ext/preprocessor/array/reverse.bi" 26 | # include once "ext/preprocessor/array/size.bi" 27 | 28 | # endif ' include guard 29 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/array/data.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/array/data.bi 2 | '' 3 | '' About: License 4 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' Copyright (c) 2002, Paul Mensonides 6 | '' 7 | '' Distributed under the Boost Software License, Version 1.0. See 8 | '' accompanying file LICENSE_1_0.txt or copy at 9 | '' http://www.boost.org/LICENSE_1_0.txt) 10 | '' 11 | '' Distributed under the FreeBASIC Extended Library Group license. See 12 | '' accompanying file LICENSE.txt or copy at 13 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 14 | 15 | # pragma once 16 | # ifndef FBEXT_INCLUDED_PP_ARRAY_DATA_BI__ 17 | # define FBEXT_INCLUDED_PP_ARRAY_DATA_BI__ -1 18 | 19 | # include once "ext/preprocessor/tuple/elem.bi" 20 | 21 | # define FBEXT_PP_ARRAY_Data(array) fbextPP_ArrayData(array) 22 | 23 | '' Macro: fbextPP_ArrayData 24 | '' Returns the data (a tuple) portion of an array. 25 | '' 26 | '' Parameters: 27 | '' array - An array. 28 | '' 29 | '' Returns: 30 | '' Returns the data (a tuple) portion of an array. 31 | '' 32 | '' Description: 33 | '' Given an array *(4, (a, b, c, d))*, this macro will expand to 34 | '' *(a, b, c, d)*. 35 | # define fbextPP_ArrayData(array) FBEXT_PP_TUPLE_ELEM(2, 1, array) 36 | 37 | # endif ' include guard 38 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/array/replace.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/array/data.bi 2 | '' 3 | '' About: License 4 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' Copyright (c) 2002, Paul Mensonides 6 | '' 7 | '' Distributed under the Boost Software License, Version 1.0. See 8 | '' accompanying file LICENSE_1_0.txt or copy at 9 | '' http://www.boost.org/LICENSE_1_0.txt) 10 | '' 11 | '' Distributed under the FreeBASIC Extended Library Group license. See 12 | '' accompanying file LICENSE.txt or copy at 13 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 14 | 15 | # pragma once 16 | # ifndef FBEXT_INCLUDED_PP_ARRAY_REPLACE_BI__ 17 | # define FBEXT_INCLUDED_PP_ARRAY_REPLACE_BI__ -1 18 | 19 | # include once "ext/preprocessor/tuple/replace.bi" 20 | 21 | # include once "ext/preprocessor/array/size.bi" 22 | # include once "ext/preprocessor/array/data.bi" 23 | 24 | '' Macro: fbextPP_ArrayReplace 25 | '' for every `n` in the range [0, array.size), do 26 | '' `array[n] = iif(n <> index, array[n], value)` 27 | # define fbextPP_ArrayReplace(array, index, value) _ 28 | ( fbextPP_ArraySize(array), _ 29 | fbextPP_TupleReplace(fbextPP_ArraySize(array), index, fbextPP_ArrayData(array), value) _ 30 | ) 31 | 32 | ' deprecated. 33 | # define FBEXT_PP_ARRAY_REPLACE(array, index, value) fbextPP_ArrayReplace(array, index, value) 34 | 35 | # endif ' include guard 36 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/array/size.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/array/size.bi 2 | '' 3 | '' About: License 4 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' Copyright (c) 2002, Paul Mensonides 6 | '' 7 | '' Distributed under the Boost Software License, Version 1.0. See 8 | '' accompanying file LICENSE_1_0.txt or copy at 9 | '' http://www.boost.org/LICENSE_1_0.txt) 10 | '' 11 | '' Distributed under the FreeBASIC Extended Library Group license. See 12 | '' accompanying file LICENSE.txt or copy at 13 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 14 | 15 | # pragma once 16 | # ifndef FBEXT_INCLUDED_PP_ARRAY_SIZE_BI__ 17 | # define FBEXT_INCLUDED_PP_ARRAY_SIZE_BI__ -1 18 | 19 | #include once "ext/preprocessor/tuple/elem.bi" 20 | 21 | # define FBEXT_PP_ARRAY_SIZE(array) fbextPP_ArraySize(array) 22 | 23 | '' Macro: fbextPP_ArraySize 24 | '' Returns the size, in elements, of an array. 25 | '' 26 | '' Parameters: 27 | '' array - An array. 28 | '' 29 | '' Returns: 30 | '' Returns the size, in elements, of an array. 31 | '' 32 | '' Description: 33 | '' Given an array *(4, (a, b, c, d))*, this macro will expand to 34 | '' *4*. 35 | # define fbextPP_ArraySize(array) fbextPP_TupleElem(2, 0, array) 36 | 37 | # endif ' include guard 38 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/cat.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/cat.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_CAT_BI__ 19 | # define FBEXT_INCLUDED_PP_CAT_BI__ -1 20 | 21 | '' ##### FBEXT_PP_CAT 22 | 23 | # define FBEXT_PP_CAT(a, b) a##b 24 | # define fbextPP_Cat(a, b) a##b 25 | 26 | # endif ' include guard 27 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/comparison.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/comparison.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_COMPARISON_BI__ 19 | # define FBEXT_INCLUDED_PP_COMPARISON_BI__ -1 20 | 21 | # include once "ext/preprocessor/comparison/equal.bi" 22 | # include once "ext/preprocessor/comparison/notequal.bi" 23 | # include once "ext/preprocessor/comparison/lessthan.bi" 24 | # include once "ext/preprocessor/comparison/lessthanorequal.bi" 25 | # include once "ext/preprocessor/comparison/greaterthan.bi" 26 | # include once "ext/preprocessor/comparison/greaterthanorequal.bi" 27 | 28 | # endif ' include guard 29 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/comparison/greaterthanorequal.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/comparison/greaterthanorequal.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_GREATERTHANOREQUAL_BI__ 19 | # define FBEXT_INCLUDED_PP_GREATERTHANOREQUAL_BI__ -1 20 | 21 | # include once "ext/preprocessor/logical/not.bi" 22 | # include once "ext/preprocessor/comparison/lessthan.bi" 23 | 24 | # define fbextPP_GreaterThanOrEqual(a, b) _ 25 | fbextPP_Not(fbextPP_LessThan(a, b)) 26 | 27 | # define FBEXT_PP_GREATERTHANOREQUAL(a, b) fbextPP_GreaterThanOrEqual(a, b) 28 | 29 | # endif ' include guard 30 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/comparison/lessthan.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/comparison/lessthan.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_LESSTHAN_BI__ 19 | # define FBEXT_INCLUDED_PP_LESSTHAN_BI__ -1 20 | 21 | # include once "ext/preprocessor/logical/and.bi" 22 | # include once "ext/preprocessor/logical/not.bi" 23 | # include once "ext/preprocessor/arithmetic/sub.bi" 24 | 25 | # define fbextPP_LessThan(a, b) _ 26 | fbextPP_And( _ 27 | fbextPP_Sub(b, a), _ 28 | fbextPP_Not(fbextPP_Sub(a, b)) _ 29 | ) _ 30 | '' 31 | 32 | # define FBEXT_PP_LESSTHAN(a, b) fbextPP_LessThan(a, b) 33 | 34 | # endif ' include guard 35 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/comparison/lessthanorequal.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/comparison/lessthanorequal.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_LESSTHANOREQUAL_BI__ 19 | # define FBEXT_INCLUDED_PP_LESSTHANOREQUAL_BI__ -1 20 | 21 | # include once "ext/preprocessor/logical/not.bi" 22 | # include once "ext/preprocessor/comparison/lessthan.bi" 23 | 24 | # define fbextPP_LessThanOrEqual(a, b) _ 25 | fbextPP_Not(fbextPP_LessThan(b, a)) 26 | 27 | # define FBEXT_PP_LESSTHANOREQUAL(a, b) fbextPP_LessThanOrEqual(a, b) 28 | 29 | # endif ' include guard 30 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/comparison/notequal.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/comparison/notequal.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_NOTEQUAL_BI__ 19 | # define FBEXT_INCLUDED_PP_NOTEQUAL_BI__ -1 20 | 21 | # include once "ext/preprocessor/comparison/equal.bi" 22 | 23 | '' Macro: fbextPP_NotEqual 24 | '' expands to `1` if *a* and *b* do not compare equal, otherwise it expands to 25 | '' `0`. *a* and *b* must be integer literals in the range [0, 255], inclusive. 26 | # define fbextPP_NotEqual(a, b) _ 27 | fbextPP_Not(fbextPP_Equal(a, b)) 28 | 29 | '' Macro: FBEXT_PP_NOTEQUAL 30 | '' is deprecated, use instead. 31 | # define FBEXT_PP_NOTEQUAL(a, b) fbextPP_NotEqual(a, b) 32 | 33 | # endif ' include guard 34 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/control.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/control.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2002, Paul Mensonides 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_CONTROL_BI__ 19 | # define FBEXT_INCLUDED_PP_CONTROL_BI__ -1 20 | 21 | # include once "ext/preprocessor/control/iif.bi" 22 | # include once "ext/preprocessor/control/if.bi" 23 | # include once "ext/preprocessor/control/expriif.bi" 24 | # include once "ext/preprocessor/control/exprif.bi" 25 | # include once "ext/preprocessor/control/while.bi" 26 | 27 | # endif ' include guard 28 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/control/exprif.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/control/exprif.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_CONTROL_EXPRIF_BI__ 19 | # define FBEXT_INCLUDED_PP_CONTROL_EXPRIF_BI__ -1 20 | 21 | # include once "ext/preprocessor/control/expriif.bi" 22 | # include once "ext/preprocessor/logical/bool.bi" 23 | 24 | # define FBEXT_PP_EXPRIF(cond, expr) fbextPP_ExprIf(cond, expr) 25 | 26 | '' Macro: fbextPP_ExprIf 27 | # define fbextPP_ExprIf(cond, expr) fbextPP_ExprIif(FBEXT_PP_BOOL(cond), expr) 28 | 29 | # endif ' include guard 30 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/control/expriif.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/control/expriif.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_CONTROL_EXPRIIF_BI__ 19 | # define FBEXT_INCLUDED_PP_CONTROL_EXPRIIF_BI__ -1 20 | 21 | # include once "ext/preprocessor/control/iif.bi" 22 | 23 | # define FBEXT_PP_EXPRIIF(bit, expr) fbextPP_ExprIif(bit, expr) 24 | 25 | '' Macro: fbextPP_ExprIif 26 | # define fbextPP_ExprIif(bit, expr) _fbextPP_ExprIif_I(bit, expr) 27 | 28 | # define _fbextPP_ExprIif_I(bit, expr) _fbextPP_ExprIif_##bit(expr) 29 | # define _fbextPP_ExprIif_0(expr) 30 | # define _fbextPP_ExprIif_1(expr) expr 31 | 32 | # endif ' include guard 33 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/facilities.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/facilities.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2002, Paul Mensonides 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_FACILITIES_BI__ 19 | # define FBEXT_INCLUDED_PP_FACITILIES_BI__ -1 20 | 21 | # include once "ext/preprocessor/facilities/empty.bi" 22 | # include once "ext/preprocessor/facilities/expand.bi" 23 | 24 | # endif ' include guard 25 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/facilities/empty.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/facilities/empty.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_FACILITIES_EMPTY_BI__ 19 | # define FBEXT_INCLUDED_PP_FACILITIES_EMPTY_BI__ -1 20 | 21 | '' ##### fbextPP_Empty 22 | 23 | # define fbextPP_Empty() FBEXT_PP_EMPTY() 24 | # define FBEXT_PP_EMPTY() 25 | 26 | # endif ' include guard 27 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/facilities/expand.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/facilities/expand.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_FACILITIES_EXPAND_BI__ 19 | # define FBEXT_INCLUDED_PP_FACILITIES_EXPAND_BI__ -1 20 | 21 | '' ##### fbextPP_Expand 22 | 23 | # define fbextPP_Expand(x) FBEXT_PP_EXPAND(x) 24 | # define FBEXT_PP_EXPAND(x) x 25 | 26 | # endif ' include guard 27 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/logical/and.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/logical/and.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_AND_BI__ 19 | # define FBEXT_INCLUDED_PP_AND_BI__ -1 20 | 21 | # include once "ext/preprocessor/logical/bool.bi" 22 | # include once "ext/preprocessor/logical/bitand.bi" 23 | 24 | # define fbextPP_And(a, b) _ 25 | fbextPP_BitAnd(fbextPP_Bool(a), fbextPP_Bool(b)) 26 | 27 | ' 28 | # define FBEXT_PP_AND(a, b) fbextPP_And(a, b) 29 | 30 | # endif ' include guard 31 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/logical/bitand.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/logical/bitand.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_BITAND_BI__ 19 | # define FBEXT_INCLUDED_PP_BITAND_BI__ -1 20 | 21 | # define fbextPP_BitAnd(a, b) fbextPP_BitAnd_##a##b() 22 | 23 | # define fbextPP_BitAnd_00() 0 24 | # define fbextPP_BitAnd_01() 0 25 | # define fbextPP_BitAnd_10() 0 26 | # define fbextPP_BitAnd_11() 1 27 | 28 | ' 29 | # define FBEXT_PP_BITAND(a, b) fbextPP_BitAnd(a, b) 30 | 31 | # endif ' include guard 32 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/logical/bitnot.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/logical/bitor.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_BITNOT_BI__ 19 | # define FBEXT_INCLUDED_PP_BITNOT_BI__ -1 20 | 21 | # define fbextPP_BitNot(a) fbextPP_BitNot_##a() 22 | 23 | # define fbextPP_BitNot_0() 1 24 | # define fbextPP_BitNot_1() 0 25 | 26 | ' 27 | # define FBEXT_PP_BITNOT(a) fbextPP_BitNot(a) 28 | 29 | # endif ' include guard 30 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/logical/bitor.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/logical/bitor.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_BITOR_BI__ 19 | # define FBEXT_INCLUDED_PP_BITOR_BI__ -1 20 | 21 | # define fbextPP_BitOr(a, b) fbextPP_BitOr_##a##b() 22 | 23 | # define fbextPP_BitOr_00() 0 24 | # define fbextPP_BitOr_01() 1 25 | # define fbextPP_BitOr_10() 1 26 | # define fbextPP_BitOr_11() 1 27 | 28 | ' 29 | # define FBEXT_PP_BITOR(a, b) fbextPP_BitOr(a, b) 30 | 31 | # endif ' include guard 32 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/logical/bitxor.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/logical/bitxor.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_BITXOR_BI__ 19 | # define FBEXT_INCLUDED_PP_BITXOR_BI__ -1 20 | 21 | # define fbextPP_BitXor(a, b) fbextPP_BitXor_##a##b() 22 | 23 | # define fbextPP_BitXor_00() 0 24 | # define fbextPP_BitXor_01() 1 25 | # define fbextPP_BitXor_10() 1 26 | # define fbextPP_BitXor_11() 0 27 | 28 | ' 29 | # define FBEXT_PP_BITXOR(a, b) fbextPP_BitXor(a, b) 30 | 31 | # endif ' include guard 32 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/logical/not.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/logical/not.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_NOT_BI__ 19 | # define FBEXT_INCLUDED_PP_NOT_BI__ -1 20 | 21 | # include once "ext/preprocessor/logical/bool.bi" 22 | # include once "ext/preprocessor/logical/bitnot.bi" 23 | 24 | # define fbextPP_Not(a) fbextPP_BitNot(fbextPP_Bool(a)) 25 | 26 | ' 27 | # define FBEXT_PP_NOT(a) fbextPP_Not(a) 28 | 29 | # endif ' include guard 30 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/logical/or.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/logical/or.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_OR_BI__ 19 | # define FBEXT_INCLUDED_PP_OR_BI__ -1 20 | 21 | # include once "ext/preprocessor/logical/bool.bi" 22 | # include once "ext/preprocessor/logical/bitor.bi" 23 | 24 | # define fbextPP_Or(a, b) fbextPP_BitOr(fbextPP_Bool(a), fbextPP_Bool(b)) 25 | 26 | ' 27 | # define FBEXT_PP_OR(a, b) fbextPP_Or(a, b) 28 | 29 | # endif ' include guard 30 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/logical/xor.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/logical/xor.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_XOR_BI__ 19 | # define FBEXT_INCLUDED_PP_XOR_BI__ -1 20 | 21 | # define fbextPP_Xor(a, b) fbextPP_BitXor(fbextPP_Bool(a), fbextPP_Bool(b)) 22 | 23 | ' 24 | # define FBEXT_PP_XOR(a, b) fbextPP_Xor(a, b) 25 | 26 | # endif ' include guard 27 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/punctuation.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/punctuation.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2002, Paul Mensonides 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_PUNCTUATION_BI__ 19 | # define FBEXT_INCLUDED_PP_PUNCTUATION_BI__ -1 20 | 21 | # include once "ext/preprocessor/punctuation/comma.bi" 22 | # include once "ext/preprocessor/punctuation/commaif.bi" 23 | 24 | # endif ' include guard 25 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/punctuation/comma.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/punctuation/comma.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_PUNCUATION_COMMA_BI__ 19 | # define FBEXT_INCLUDED_PP_PUNCUATION_COMMA_BI__ -1 20 | 21 | # define FBEXT_PP_COMMA() fbextPP_Comma() 22 | 23 | '' Macro: fbextPP_Comma 24 | '' Expands to a comma (,) 25 | '' 26 | '' Returns: 27 | '' A comma (,). 28 | # define fbextPP_Comma() , 29 | 30 | # endif ' include guard 31 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/repetition.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/repetition.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2002, Paul Mensonides 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_REPETITION_BI__ 19 | # define FBEXT_INCLUDED_PP_REPETITION_BI__ -1 20 | 21 | # include once "ext/preprocessor/repetition/repeat.bi" 22 | # include once "ext/preprocessor/repetition/for.bi" 23 | 24 | # endif ' include guard 25 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/seq/popfront.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/seq/popfront.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2002, Paul Mensonides 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_SEQ_POPFRONT_BI__ 19 | # define FBEXT_INCLUDED_PP_SEQ_POPFRONT_BI__ -1 20 | 21 | #include once "ext/preprocessor/seq/restn.bi" 22 | 23 | # define FBEXT_PP_SEQ_POPFRONT(seq) fbextPP_SeqPopFront(seq) 24 | 25 | '' Macro: fbextPP_SeqPopFront 26 | '' Removes the first element in a sequence. 27 | '' 28 | '' Parameters: 29 | '' seq - A sequence. 30 | '' 31 | '' Returns: 32 | '' The new sequence. 33 | '' 34 | '' Description: 35 | '' Given a sequence *(a)(b)(c)(d)*, this macro will expand to 36 | '' *(b)(c)(d)*. 37 | # define fbextPP_SeqPopFront(seq) _ 38 | FBEXT_PP_SEQ_RESTN(1, seq) 39 | 40 | # endif ' include guard 41 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/seq/pushback.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/seq/pushback.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2002, Paul Mensonides 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_SEQ_PUSHBACK_BI__ 19 | # define FBEXT_INCLUDED_PP_SEQ_PUSHBACK_BI__ -1 20 | 21 | # define FBEXT_PP_SEQ_PUSHBACK(seq, elem) fbextPP_SeqPushBack(seq, elem) 22 | 23 | '' Macro: fbextPP_SeqPushBack 24 | '' Adds an element to the end of a sequence. 25 | '' 26 | '' Parameters: 27 | '' seq - A sequence. 28 | '' x - An element to add. 29 | '' 30 | '' Returns: 31 | '' The new sequence. 32 | '' 33 | '' Description: 34 | '' Given a sequence *(a)(b)(c)(d)*, this macro will expand to 35 | '' *(a)(b)(c)(d)(x)*. 36 | # define fbextPP_SeqPushBack(seq, x) seq(x) 37 | 38 | # endif ' include guard 39 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/seq/pushfront.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/seq/pushfront.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2002, Paul Mensonides 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_SEQ_PUSHFRONT_BI__ 19 | # define FBEXT_INCLUDED_PP_SEQ_PUSHFRONT_BI__ -1 20 | 21 | # define FBEXT_PP_SEQ_PUSHFRONT(seq, elem) fbextPP_SeqPushFront(seq, elem) 22 | 23 | '' Macro: fbextPP_SeqPushFront 24 | '' Adds an element to the beginning of a sequence. 25 | '' 26 | '' Parameters: 27 | '' seq - A sequence. 28 | '' x - An element to add. 29 | '' 30 | '' Returns: 31 | '' The new sequence. 32 | '' 33 | '' Description: 34 | '' Given a sequence *(a)(b)(c)(d)*, this macro will expand to 35 | '' *(x)(a)(b)(c)(d)*. 36 | # define fbextPP_SeqPushFront(seq, x) (x)##seq 37 | 38 | # endif ' include guard 39 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/seq/tail.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/seq/tail.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2002, Paul Mensonides 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_SEQ_TAIL_BI__ 19 | # define FBEXT_INCLUDED_PP_SEQ_TAIL_BI__ -1 20 | 21 | # include once "ext/preprocessor/seq/restn.bi" 22 | 23 | # define FBEXT_PP_SEQ_TAIL(seq) fbextPP_SeqTail(seq) 24 | 25 | '' Macro: fbextPP_SeqTail 26 | '' Returns the tail end of a sequence. 27 | '' 28 | '' Parameters: 29 | '' seq - A sequence. 30 | '' 31 | '' Returns: 32 | '' Returns the tail end of s sequence. 33 | '' 34 | '' Description: 35 | '' Given a sequence *(a)(b)(c)(d)*, this macro will expand to 36 | '' *(b)(c)(d)*. 37 | # define fbextPP_SeqTail(seq) _ 38 | FBEXT_PP_SEQ_RESTN(1, seq) 39 | 40 | # endif ' include guard 41 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/seq/totuple.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/seq/totuple.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2002, Paul Mensonides 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_SEQ_TOTUPLE_BI__ 19 | # define FBEXT_INCLUDED_PP_SEQ_TOTUPLE_BI__ -1 20 | 21 | # include once "ext/preprocessor/seq/enum.bi" 22 | 23 | # define FBEXT_PP_SEQ_TOTUPLE(seq) fbextPP_SeqToTuple(seq) 24 | 25 | '' Macro: fbextPP_SeqToTuple 26 | '' Converts a sequence into a tuple. 27 | '' 28 | '' Parameters: 29 | '' seq - the sequence to convert 30 | '' 31 | '' Returns: 32 | '' Returns the tuple representation of the sequence. 33 | '' 34 | '' Description: 35 | '' Given a sequence *(a)(b)(c)(d)*, this macro expands to 36 | '' *(a, b, c, d)*. 37 | # define fbextPP_SeqToTuple(seq) _ 38 | (FBEXT_PP_SEQ_ENUM(seq)) 39 | 40 | # endif ' include guard 41 | -------------------------------------------------------------------------------- /include/freebasic/ext/preprocessor/stringize.bi: -------------------------------------------------------------------------------- 1 | '' Title: ext/preprocessor/stringize.bi 2 | '' This file is part of the library API, and can be 3 | '' directly included by user programs. 4 | '' 5 | '' About: License 6 | '' Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 7 | '' Copyright (c) 2001, Housemarque Oy (http://www.housemarque.com) 8 | '' 9 | '' Distributed under the Boost Software License, Version 1.0. See 10 | '' accompanying file LICENSE_1_0.txt or copy at 11 | '' http://www.boost.org/LICENSE_1_0.txt) 12 | '' 13 | '' Distributed under the FreeBASIC Extended Library Group license. See 14 | '' accompanying file LICENSE.txt or copy at 15 | '' https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 16 | 17 | # pragma once 18 | # ifndef FBEXT_INCLUDED_PP_STRINGIZE_BI__ 19 | # define FBEXT_INCLUDED_PP_STRINGIZE_BI__ -1 20 | 21 | '' ##### FBEXT_PP_STRINGIZE 22 | 23 | # define FBEXT_PP_STRINGIZE(x) #x 24 | # define fbextPP_Stringize(x) #x 25 | 26 | # endif ' include guard 27 | -------------------------------------------------------------------------------- /include/freebasic/ext/review/review.bi: -------------------------------------------------------------------------------- 1 | ''Title: About the Review Section 2 | '' 3 | ''The review section is for items considered for future inclusion into the library. 4 | '' 5 | ''Code located in the review section should be considered volatile and not ready for production use. -------------------------------------------------------------------------------- /include/freebasic/ext/strings.bi: -------------------------------------------------------------------------------- 1 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 2 | '' 3 | ''Distributed under the FreeBASIC Extended Library Group license. See 4 | ''accompanying file LICENSE.txt or copy at 5 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # pragma once 8 | # ifndef FBEXT_STRINGS_BI__ 9 | # define FBEXT_STRINGS_BI__ -1 10 | 11 | # include once "ext/strings/misc.bi" 12 | # include once "ext/strings/split.bi" 13 | # include once "ext/strings/manip.bi" 14 | # include once "ext/strings/substr.bi" 15 | 16 | # endif ' include guard 17 | -------------------------------------------------------------------------------- /include/freebasic/ext/threads/detail/common.bi: -------------------------------------------------------------------------------- 1 | #ifndef __FBEXT_THREADS_COMMON_BI 2 | #define __FBEXT_THREADS_COMMON_BI 1 3 | 4 | #inclib "ext-threads" 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /include/freebasic/ext/threads/mutex.bi: -------------------------------------------------------------------------------- 1 | ''Title: threads/mutex.bi 2 | '' 3 | ''About: License 4 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 5 | '' 6 | ''Distributed under the FreeBASIC Extended Library Group license. See 7 | ''accompanying file LICENSE.txt or copy at 8 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 9 | 10 | #ifndef __FBEXT_THREADS_MUTEX 11 | #define __FBEXT_THREADS_MUTEX 1 12 | 13 | #include once "ext/threads/detail/common.bi" 14 | 15 | ''Namespace: ext.threads 16 | namespace ext.threads 17 | 18 | ''Class: Mutex 19 | type Mutex 20 | public: 21 | ''Sub: lock 22 | declare sub lock() 23 | 24 | ''Sub: unlock 25 | declare sub unlock() 26 | declare constructor() 27 | declare constructor( byref rhs as Mutex ) 28 | declare operator let( byref rhs as Mutex ) 29 | declare destructor() 30 | 31 | private: 32 | _m as any ptr 33 | end type 34 | 35 | end namespace 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/freebasic/ext/xml.bi: -------------------------------------------------------------------------------- 1 | ''Copyright (c) 2007-2024, FreeBASIC Extended Library Development Group 2 | '' 3 | ''Distributed under the FreeBASIC Extended Library Group license. See 4 | ''accompanying file LICENSE.txt or copy at 5 | ''https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | #ifndef FBEXT_XML__BI__ 8 | #define FBEXT_XML__BI__ -1 9 | 10 | ''Notice: 11 | ''This file is being deprecated after the next release. 12 | ''Please modify your program to use ext/xml/dom.bi instead. 13 | 14 | #include once "ext/xml/detail/common.bi" 15 | #include once "ext/xml/dom.bi" 16 | 17 | #endif 'FBEXT_XML__BI__ 18 | -------------------------------------------------------------------------------- /lib/linux/libs.linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/lib/linux/libs.linux -------------------------------------------------------------------------------- /lib/win32/libs.win32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/lib/win32/libs.win32 -------------------------------------------------------------------------------- /lib/win64/libs.win64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeBASIC-Extended-Library/fb-ext-lib/0453119e887d07a63696d6ff09d3fc15c3559b6f/lib/win64/libs.win64 -------------------------------------------------------------------------------- /src/modules/graphics/libext-fbpng-PLTE.bas: -------------------------------------------------------------------------------- 1 | #include once "pnginc/png_image.bi" 2 | 3 | namespace ext.gfx.png 4 | ':::::::: 5 | ' Purpose : Find the PLTE chunk and unpack it 6 | ' Return : 0 on success 7 | function PLTE_prepare _ 8 | ( _ 9 | byref png_image as png_image_t _ 10 | ) as integer 11 | 12 | dim as integer PLTE_chunk = chunk_find( png_image, "PLTE", 0 ) 13 | dim as ubyte ptr p = any 14 | dim as integer i = any 15 | 16 | function = 1 17 | 18 | if PLTE_chunk <> -1 then 19 | 20 | with *png_image.chunk[PLTE_chunk] 21 | p = .data 22 | png_image.PLTE_count = .length \ 3 23 | end with 24 | 25 | with png_image 26 | 27 | if .PLTE_count <= 256 then 28 | for i = 0 to .PLTE_count - 1 29 | .PLTE(i).r = *p 30 | .PLTE(i).g = p[1] 31 | .PLTE(i).b = p[2] 32 | p += 3 33 | next i 34 | function = 0 35 | end if 36 | 37 | end with 38 | end if 39 | 40 | end function 41 | end namespace 'ext.gfx.png 42 | -------------------------------------------------------------------------------- /src/modules/graphics/libext-fbpng-png_image_deinit.bas: -------------------------------------------------------------------------------- 1 | #include once "pnginc/png_image.bi" 2 | #include once "crt.bi" 3 | 4 | 5 | namespace ext.gfx.png 6 | ':::::::: 7 | ' Purpose : Free up memory 8 | ' Return : none 9 | sub png_image_deinit _ 10 | ( _ 11 | byref png_image as png_image_t _ 12 | ) 13 | 14 | dim as integer i = any 15 | 16 | with png_image 17 | if .chunk <> NULL then 18 | for i = 0 to .chunk_count - 1 19 | deallocate( .chunk[i] ) 20 | next i 21 | deallocate( .chunk ) 22 | end if 23 | if .IDAT <> NULL then deallocate( .IDAT ) 24 | end with 25 | 26 | end sub 27 | 28 | end namespace 'ext.gfx.png 29 | -------------------------------------------------------------------------------- /src/modules/graphics/libext-fbpng-png_image_init.bas: -------------------------------------------------------------------------------- 1 | #include once "pnginc/png_image.bi" 2 | #include once "crt.bi" 3 | 4 | 5 | namespace ext.gfx.png 6 | 7 | ':::::::: 8 | ' Purpose : Clear the structure and set the buffer 9 | ' Return : none 10 | sub png_image_init _ 11 | ( _ 12 | byref png_image as png_image_t, _ 13 | byval buffer as any ptr, _ 14 | byval buffer_len as uinteger _ 15 | ) 16 | 17 | memset( @png_image, 0, sizeof( png_image_t ) ) 18 | 19 | with png_image 20 | .buffer = buffer 21 | .buffer_len = buffer_len 22 | .initialized = TRUE 23 | end with 24 | 25 | end sub 26 | 27 | end namespace 'ext.gfx.png 28 | -------------------------------------------------------------------------------- /src/modules/graphics/libext-fbpng-tRNS.bas: -------------------------------------------------------------------------------- 1 | #include once "pnginc/png_image.bi" 2 | 3 | 4 | namespace ext.gfx.png 5 | ':::::::: 6 | ' Purpose : Prepare the tRNS chunk 7 | ' Return : Zero on success, non zero otherwise 8 | function tRNS_prepare _ 9 | ( _ 10 | byref png_image as png_image_t _ 11 | ) as integer 12 | 13 | dim as integer tRNS_chunk = chunk_find( png_image, "tRNS", 0 ) 14 | dim as ubyte ptr p = any 15 | dim as integer i = any 16 | 17 | function = 1 18 | 19 | if tRNS_chunk <> -1 then 20 | with png_image 21 | p = .chunk[tRNS_chunk]->data 22 | .has_tRNS = TRUE 23 | select case .colortype 24 | case 0 25 | if .chunk[tRNS_chunk]->length = 2 then 26 | .tRNS_0 = get_u16( p ) 27 | function = 0 28 | end if 29 | case 2 30 | if .chunk[tRNS_chunk]->length = 6 then 31 | .tRNS_2r = get_u16( p ) 32 | .tRNS_2g = get_u16( @p[2] ) 33 | .tRNS_2b = get_u16( @p[4] ) 34 | function = 0 35 | end if 36 | case 3 37 | if .chunk[tRNS_chunk]->length <= 256 then 38 | for i = 0 to .chunk[tRNS_chunk]->length - 1 39 | .tRNS_3(i) = p[i] 40 | next i 41 | for i = .chunk[tRNS_chunk]->length to 255 42 | .tRNS_3(i) = 255 43 | next i 44 | function = 0 45 | end if 46 | end select 47 | end with 48 | else 49 | function = 0 50 | end if 51 | 52 | end function 53 | 54 | end namespace 'ext.gfx.png 55 | -------------------------------------------------------------------------------- /src/modules/graphics/pnginc/IDAT.bi: -------------------------------------------------------------------------------- 1 | #ifndef _IDAT_BI_ 2 | #define _IDAT_BI_ 3 | 4 | namespace ext.gfx.png 5 | ':::::::: 6 | declare function IDAT_prepare _ 7 | ( _ 8 | byref png_image as png_image_t ) as integer 9 | 10 | end namespace 11 | #endif '_IDAT_BI_ 12 | -------------------------------------------------------------------------------- /src/modules/graphics/pnginc/IHDR.bi: -------------------------------------------------------------------------------- 1 | #ifndef _IHDR_BI_ 2 | #define _IHDR_BI_ 3 | 4 | namespace ext.gfx.png 5 | 6 | ':::::::: 7 | declare function IHDR_prepare _ 8 | ( _ 9 | byref png_image as png_image_t ) as integer 10 | 11 | end namespace 12 | #endif '_IHDR_BI_ 13 | -------------------------------------------------------------------------------- /src/modules/graphics/pnginc/PLTE.bi: -------------------------------------------------------------------------------- 1 | #ifndef _PLTE_BI_ 2 | #define _PLTE_BI_ 3 | 4 | namespace ext.gfx.png 5 | 6 | ':::::::: 7 | declare function PLTE_prepare _ 8 | ( _ 9 | byref png_image as png_image_t ) as integer 10 | end namespace 11 | 12 | #endif '_PLTE_BI_ 13 | -------------------------------------------------------------------------------- /src/modules/graphics/pnginc/file_to_buffer.bi: -------------------------------------------------------------------------------- 1 | #ifndef _FILE_TO_BUFFER_BI_ 2 | #define _FILE_TO_BUFFER_BI_ 3 | 4 | namespace ext.gfx.png 5 | 6 | declare function file_to_buffer _ 7 | ( _ 8 | byval fname as zstring ptr, _ 9 | byref fsize as integer _ 10 | ) as any ptr 11 | 12 | end namespace 13 | 14 | #endif '_FILE_TO_BUFFER_BI_ 15 | -------------------------------------------------------------------------------- /src/modules/graphics/pnginc/png_save.bi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/modules/graphics/pnginc/tRNS.bi: -------------------------------------------------------------------------------- 1 | #ifndef _TRNS_BI_ 2 | #define _TRNS_BI_ 3 | 4 | namespace ext.gfx.png 5 | ':::::::: 6 | declare function tRNS_prepare _ 7 | ( _ 8 | byref png_image as png_image_t ) as integer 9 | end namespace 10 | #endif '_TRNS_BI_ 11 | -------------------------------------------------------------------------------- /src/modules/math/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009, FreeBASIC Extended Library Development Group 2 | # 3 | # Distributed under the FreeBASIC Extended Library Group license. See 4 | # accompanying file LICENSE.txt or copy at 5 | # https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # Custom Makefile demonstration 8 | # 9 | 10 | # fix-up path names 11 | INCLUDE_DIR := ../$(INCLUDE_DIR) 12 | SOURCE_DIR := ../$(SOURCE_DIR) 13 | LIBRARY_DIR := ../$(LIBRARY_DIR) 14 | 15 | SOURCES := $(wildcard *.bas) 16 | OBJECTS := $(SOURCES:%.bas=%$(if $(MT),.mt).o) 17 | 18 | LIBRARY_NAME := libext-math$(if $(MT),.mt).a 19 | LIBRARY_FILE := $(LIBRARY_DIR)/$(LIBRARY_NAME) 20 | LIBRARY_OUT := $(LIBRARY_DIR)/$(LIBRARY_NAME) 21 | 22 | .PHONY: math build-math 23 | math build-math: $(LIBRARY_FILE) 24 | 25 | $(LIBRARY_FILE): $(OBJECTS) 26 | $(FBC) $(FBC_LFLAGS) -p $(LIBRARY_DIR) $^ -x $(LIBRARY_OUT) 27 | 28 | ./%.o: ./%.bas 29 | $(FBC) $(FBC_CFLAGS) -i $(INCLUDE_DIR) $< -o $@ 30 | 31 | ./%.mt.o: ./%.bas 32 | $(FBC) $(FBC_CFLAGS) -i $(INCLUDE_DIR) $< -o $@ 33 | 34 | .PHONY: clean-math 35 | clean-math: 36 | $(RM) -f $(LIBRARY_FILE) 37 | $(RM) -f $(OBJECTS) 38 | 39 | -------------------------------------------------------------------------------- /src/modules/net/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009, FreeBASIC Extended Library Development Group 2 | # 3 | # Distributed under the FreeBASIC Extended Library Group license. See 4 | # accompanying file LICENSE.txt or copy at 5 | # https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # Custom Makefile demonstration 8 | # 9 | 10 | # fix-up path names 11 | INCLUDE_DIR := ../$(INCLUDE_DIR) 12 | SOURCE_DIR := ../$(SOURCE_DIR) 13 | LIBRARY_DIR := ../$(LIBRARY_DIR) 14 | 15 | SOURCES := $(wildcard *.bas) 16 | OBJECTS := $(SOURCES:%.bas=%.o) 17 | 18 | LIBRARY_NAME := libext-net.a 19 | LIBRARY_FILE := $(LIBRARY_DIR)/$(LIBRARY_NAME) 20 | LIBRARY_OUT := $(LIBRARY_DIR)/$(LIBRARY_NAME) 21 | 22 | .PHONY: net build-net 23 | net build-net: $(LIBRARY_FILE) 24 | 25 | $(LIBRARY_FILE): $(OBJECTS) 26 | $(FBC) $(FBC_LFLAGS) -mt -p $(LIBRARY_DIR) $^ -x $(LIBRARY_OUT) 27 | 28 | ./%.o: ./%.bas 29 | $(FBC) $(FBC_CFLAGS) -mt -i $(INCLUDE_DIR) $< -o $@ 30 | 31 | .PHONY: clean-net 32 | clean-net: 33 | $(RM) -f $(LIBRARY_FILE) 34 | $(RM) -f $(OBJECTS) 35 | 36 | -------------------------------------------------------------------------------- /src/modules/php/libext-php-addcslashes.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/php.bi" 2 | 3 | namespace ext.php 4 | 5 | '' ::::: 6 | function AddCSlashes ( byref text as const string, byref chars as const string ) as string 7 | 8 | if (strptr(text) = null) then return "" 9 | if (strptr(chars) = null) then return text 10 | 11 | var result = space(2 * len(text)) 12 | var src = cast(ubyte ptr, strptr(text)) 13 | var dst = cast(ubyte ptr, strptr(result)) 14 | 15 | for x as integer = 0 to len(text) - 1 16 | for y as integer = 0 to len(chars) - 1 17 | if (*src = chars[y]) then 18 | *dst = asc("\") 19 | dst += 1 20 | exit for 21 | end if 22 | next 23 | *dst = *src 24 | dst += 1 25 | src += 1 26 | next 27 | 28 | return left(result, dst - cast(ubyte ptr, strptr(result))) 29 | 30 | end function 31 | 32 | end namespace 33 | -------------------------------------------------------------------------------- /src/modules/php/libext-php-addslashes.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/php.bi" 2 | 3 | namespace ext.php 4 | 5 | '' ::::: 6 | function AddSlashes ( byref text as const string ) as string 7 | 8 | ' quote ('), double-quote (") and backslash (\). 9 | return AddCSlashes(text, !"'\"\\") 10 | 11 | end function 12 | 13 | end namespace 14 | -------------------------------------------------------------------------------- /src/modules/php/libext-php-bin2hex.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/php.bi" 2 | 3 | namespace ext.php 4 | 5 | '' ::::: 6 | function Bin2Hex ( byref text as const string ) as string 7 | 8 | if (strptr(text) = null) then return "" 9 | 10 | var result = string(len(text) * 2, asc("0")) 11 | 12 | for c as integer = 0 to len(text) - 1 13 | var ch = text[c] 14 | 15 | if (ch >= &h10) then 16 | mid(result, (2 * c) + 1, 2) = hex(ch) 17 | 18 | else 19 | mid(result, (2 * c) + 2, 1) = hex(ch) 20 | 21 | end if 22 | next 23 | 24 | return result 25 | 26 | end function 27 | 28 | end namespace 29 | -------------------------------------------------------------------------------- /src/modules/php/libext-php-strrchr.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/php.bi" 2 | # include once "ext/algorithms/detail/common.bi" 3 | 4 | namespace ext.php 5 | 6 | '' ::::: 7 | function StrRChr ( byref text as const string, byref char as const string ) as string 8 | 9 | if (strptr(char) <> null) then 10 | return ext.php.StrRChr(text, char[0]) 11 | end if 12 | 13 | return "" 14 | end function 15 | 16 | '' ::::: 17 | function StrRChr ( byref text as const string, byval char as ubyte ) as string 18 | 19 | if (strptr(text) = null) then 20 | return "" 21 | end if 22 | 23 | var first = cast(ubyte ptr, strptr(text)) 24 | var last = first + len(text) 25 | var it = last - 1 26 | 27 | do while (first <> it) 28 | if (*it = char) then 29 | exit do 30 | end if 31 | it -= 1 32 | loop 33 | 34 | if (first <> it) then 35 | var result_size = last - it 36 | var result = space(result_size) 37 | memcpy(strptr(result), it, result_size) 38 | return result 39 | end if 40 | 41 | return "" 42 | 43 | end function 44 | 45 | end namespace 46 | -------------------------------------------------------------------------------- /src/modules/testly/testly_case.bas: -------------------------------------------------------------------------------- 1 | '#-- 2 | '# Copyright (c) 2006-2008 Luis Lavena, Multimedia systems 3 | '# 4 | '# This source code is released under the MIT License. 5 | '# See MIT-LICENSE file for details 6 | '#++ 7 | 8 | #include once "testly_case.bi" 9 | 10 | namespace ext.tests 11 | '############################################################# 12 | '# TestCase 13 | '# ctor() 14 | constructor TestCase(byref new_name as string = "", byref new_test_func as test_func_t = 0) 15 | '# assign the values 16 | test_name = new_name 17 | test_func = new_test_func 18 | end constructor 19 | 20 | end namespace 'Testly 21 | -------------------------------------------------------------------------------- /src/modules/testly/testly_case.bi: -------------------------------------------------------------------------------- 1 | '#-- 2 | '# Copyright (c) 2006-2008 Luis Lavena, Multimedia systems 3 | '# 4 | '# This source code is released under the MIT License. 5 | '# See MIT-LICENSE file for details 6 | '#++ 7 | 8 | #ifndef __TESTLY_CASE_BI__ 9 | #define __TESTLY_CASE_BI__ 10 | 11 | #include once "ext/tests.bi" 12 | 13 | namespace ext.tests 14 | '# TestCase represent each test inside a Suite. 15 | type TestCase 16 | declare constructor(byref as string = "", byref as test_func_t = 0) 17 | 18 | test_name as string 19 | test_func as test_func_t 20 | test_passed as ext.bool 21 | end type 22 | 23 | end namespace 'Testly 24 | 25 | #endif '__TESTLY_CASE_BI__ 26 | 27 | -------------------------------------------------------------------------------- /src/modules/testly/testly_helpers.bi: -------------------------------------------------------------------------------- 1 | '#-- 2 | '# Copyright (c) 2006-2008 Luis Lavena, Multimedia systems 3 | '# 4 | '# This source code is released under the MIT License. 5 | '# See MIT-LICENSE file for details 6 | '#++ 7 | 8 | #ifndef __TESTLY_HELPERS_BI__ 9 | #define __TESTLY_HELPERS_BI__ 10 | 11 | #include once "testly_case.bi" 12 | #include once "testly_suite.bi" 13 | 14 | namespace ext.tests 15 | namespace Helpers 16 | '# CURRENT_SUITE 17 | extern CURRENT_SUITE as Suite ptr 18 | 19 | '# CURRENT_TEST 20 | extern CURRENT_TEST as TestCase ptr 21 | 22 | end namespace 'Helpers 23 | end namespace 'Testly 24 | 25 | #endif '__TESTLY_HELPERS_BI__ 26 | -------------------------------------------------------------------------------- /src/modules/testly/testly_internals.bi: -------------------------------------------------------------------------------- 1 | '#-- 2 | '# Copyright (c) 2006-2008 Luis Lavena, Multimedia systems 3 | '# 4 | '# This source code is released under the MIT License. 5 | '# See MIT-LICENSE file for details 6 | '#++ 7 | 8 | #ifndef __TESTLY_INTERNALS_BI__ 9 | #define __TESTLY_INTERNALS_BI__ 10 | 11 | #include once "testly_case.bi" 12 | #include once "testly_suite.bi" 13 | 14 | namespace ext.tests 15 | '# Helpers simplify the addition of suites and new test to each suite. 16 | '# you could call them directly, but is recomended (and shorter) 17 | '# use the defines below in this file. 18 | namespace InternalHelpers 19 | declare function suite_defined(byref as string) as ext.bool 20 | declare function test_defined(byref as string) as ext.bool 21 | declare function select_suite(byref as string) as Suite ptr 22 | declare function select_test(byref as string) as TestCase ptr 23 | 24 | declare function current_suite_name() as string 25 | declare function current_test_name() as string 26 | 27 | '# SELECTED_SUITE 28 | extern SELECTED_SUITE as Suite ptr 29 | 30 | '# SELECTED_TEST 31 | extern SELECTED_TEST as TestCase ptr 32 | 33 | end namespace 'InternalHelpers 34 | end namespace 'Testly 35 | 36 | #endif '__TESTLY_INTERNALS_BI__ 37 | -------------------------------------------------------------------------------- /src/modules/testly/testly_suite.bas: -------------------------------------------------------------------------------- 1 | '#-- 2 | '# Copyright (c) 2006-2008 Luis Lavena, Multimedia systems 3 | '# 4 | '# This source code is released under the MIT License. 5 | '# See MIT-LICENSE file for details 6 | '#++ 7 | 8 | #include once "testly_suite.bi" 9 | #include once "testly_case.bi" 10 | 11 | namespace ext.tests 12 | '############################################################# 13 | '# Suite 14 | '# default ctor() 15 | constructor Suite(byref new_name as string = "") 16 | '# assign the suite properties 17 | suite_name = new_name 18 | 19 | tests_list = new List 20 | end constructor 21 | 22 | '# dtor() 23 | destructor Suite() 24 | dim test as TestCase ptr 25 | 26 | '# remove the Suite tests 27 | do while (tests_list->count > 0) 28 | test = cast(TestCase ptr, tests_list->shift()) 29 | delete test 30 | loop 31 | end destructor 32 | 33 | '# property tests_count as uinteger 34 | property Suite.tests_count as uinteger 35 | return tests_list->count 36 | end property 37 | 38 | end namespace 'Testly 39 | -------------------------------------------------------------------------------- /src/modules/threads/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009, FreeBASIC Extended Library Development Group 2 | # 3 | # Distributed under the FreeBASIC Extended Library Group license. See 4 | # accompanying file LICENSE.txt or copy at 5 | # https://github.com/FreeBASIC-Extended-Library/fb-ext-lib/blob/master/COPYING 6 | 7 | # Custom Makefile demonstration 8 | # 9 | 10 | # fix-up path names 11 | INCLUDE_DIR := ../$(INCLUDE_DIR) 12 | SOURCE_DIR := ../$(SOURCE_DIR) 13 | LIBRARY_DIR := ../$(LIBRARY_DIR) 14 | 15 | SOURCES := $(wildcard *.bas) 16 | OBJECTS := $(SOURCES:%.bas=%.o) 17 | 18 | LIBRARY_NAME := libext-threads.a 19 | LIBRARY_FILE := $(LIBRARY_DIR)/$(LIBRARY_NAME) 20 | LIBRARY_OUT := $(LIBRARY_DIR)/$(LIBRARY_NAME) 21 | 22 | .PHONY: threads build-threads 23 | threads build-threads: $(LIBRARY_FILE) 24 | 25 | $(LIBRARY_FILE): $(OBJECTS) 26 | $(FBC) $(FBC_LFLAGS) -mt -p $(LIBRARY_DIR) $^ -x $(LIBRARY_OUT) 27 | 28 | ./%.o: ./%.bas 29 | $(FBC) $(FBC_CFLAGS) -mt -i $(INCLUDE_DIR) $< -o $@ 30 | 31 | .PHONY: clean-threads 32 | clean-threads: 33 | $(RM) -f $(LIBRARY_FILE) 34 | $(RM) -f $(OBJECTS) 35 | 36 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | FBC_CFLAGS := -g -i ../include/freebasic -enullptr -w all 2 | FBC_LFLAGS := -p ../$(LIBRARY_DIR) -p ../$(BINARY_DIR) 3 | 4 | ifeq ($(ARCH), x86) 5 | ifeq ($(BITS),64) 6 | FBC_CFLAGS += -arch x86-64 7 | else 8 | FBC_CFLAGS += -arch 686 9 | endif 10 | endif 11 | 12 | TESTS_MAIN := main$(EXE_EXT) 13 | 14 | 15 | TESTS_DIRS := algorithms containers conversion database file hash json math memory misc php preprocessor sort strings xml 16 | 17 | 18 | TESTS_SRCS := $(foreach dir,$(TESTS_DIRS),$(wildcard $(dir)/*.bas)) 19 | TESTS_OBJS := $(TESTS_SRCS:%.bas=%.o) 20 | 21 | all : run-tests 22 | 23 | run-tests: $(TESTS_MAIN) 24 | @$(EXE_PFX)$(TESTS_MAIN) 25 | 26 | %.o : %.bas 27 | $(FBC) $(OPT) -c $(FBC_CFLAGS) $< -o $@ 28 | 29 | main.o : main.bas 30 | $(FBC) $(OPT) -c $(FBC_CFLAGS) -m main $< -o $@ 31 | 32 | $(TESTS_MAIN) : $(TESTS_OBJS) main.o 33 | $(FBC) $(OPT) $(FBC_LFLAGS) $(FBC_CFLAGS) $(TESTS_OBJS) main.o -x $(TESTS_MAIN) 34 | 35 | .PHONY : clean 36 | clean : 37 | -$(RM) -f $(TESTS_MAIN) main.o 38 | -$(RM) -f $(TESTS_OBJS) 39 | -------------------------------------------------------------------------------- /tests/algorithms/copy.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/algorithms/copy.bi" 3 | 4 | namespace ext.tests.algorithms 5 | 6 | private sub test_copy 7 | dim array(4) as integer = { 10, 20, 30, 40, 50 } 8 | dim result(4) as integer = any 9 | 10 | ext.Copy(@array(0), @array(0) + 5, @result(0)) 11 | 12 | ext_assert_TRUE( result(0) = 10 ) 13 | ext_assert_TRUE( result(1) = 20 ) 14 | ext_assert_TRUE( result(2) = 30 ) 15 | ext_assert_TRUE( result(3) = 40 ) 16 | ext_assert_TRUE( result(4) = 50 ) 17 | 18 | end sub 19 | 20 | private sub test_copy_overlap 21 | 22 | dim array(4) as integer = { 10, 20, 30, 40, 50 } 23 | 24 | ext.Copy(@array(2), @array(2) + 3, @array(0)) 25 | 26 | ext_assert_TRUE( array(0) = 30 ) 27 | ext_assert_TRUE( array(1) = 40 ) 28 | ext_assert_TRUE( array(2) = 50 ) 29 | ext_assert_TRUE( array(3) = 40 ) 30 | ext_assert_TRUE( array(4) = 50 ) 31 | 32 | end sub 33 | 34 | private sub register constructor 35 | ext.tests.addSuite("ext-algorithms-copy") 36 | ext.tests.addTest("copy_overlap", @test_copy_overlap) 37 | ext.tests.addTest("copy",@test_copy) 38 | end sub 39 | 40 | end namespace 41 | -------------------------------------------------------------------------------- /tests/algorithms/copybackward.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/algorithms/copybackward.bi" 3 | 4 | namespace ext.tests.algorithms 5 | 6 | private sub test_copybackward 7 | dim array(4) as integer = { 10, 20, 30, 40, 50 } 8 | dim result(4) as integer = any 9 | 10 | ext.CopyBackward(@array(0), @array(0) + 5, @result(0) + 5) 11 | 12 | ext_assert_TRUE( result(0) = 10 ) 13 | ext_assert_TRUE( result(1) = 20 ) 14 | ext_assert_TRUE( result(2) = 30 ) 15 | ext_assert_TRUE( result(3) = 40 ) 16 | ext_assert_TRUE( result(4) = 50 ) 17 | 18 | end sub 19 | 20 | private sub test_copybackward_overlap 21 | 22 | dim array(4) as integer = { 10, 20, 30, 40, 50 } 23 | 24 | ext.CopyBackward(@array(2), @array(2) + 3, @array(0)) 25 | 26 | ext_assert_TRUE( array(0) = 30 ) 27 | ext_assert_TRUE( array(1) = 40 ) 28 | ext_assert_TRUE( array(2) = 50 ) 29 | ext_assert_TRUE( array(3) = 40 ) 30 | ext_assert_TRUE( array(4) = 50 ) 31 | 32 | end sub 33 | 34 | private sub register constructor 35 | ext.tests.addSuite("ext-algorithms-copy") 36 | ext.tests.addTest("join", @test_copybackward) 37 | ext.tests.addTest("join", @test_copybackward_overlap) 38 | end sub 39 | 40 | end namespace 41 | -------------------------------------------------------------------------------- /tests/algorithms/count.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/algorithms/count.bi" 3 | # include once "ext/algorithms/countif.bi" 4 | 5 | namespace ext.tests.algorithms 6 | 7 | private sub test_count 8 | dim array(6) as integer = { 420, 20, 30, 420, 420, 50, 10 } 9 | 10 | var c = ext.Count(@array(0), @array(0) + 6, 420) 11 | 12 | ext_assert_TRUE( 3 = c ) 13 | 14 | end sub 15 | 16 | private function LessThan30 ( byref a as integer) as bool 17 | return a < 30 18 | end function 19 | 20 | private sub test_countif 21 | dim array(6) as integer = { 10, 20, 30, 420, 420, 50, 10 } 22 | 23 | var c = ext.CountIf(@array(0), @array(0) + 7, @LessThan30) 24 | 25 | ext_assert_TRUE( 3 = c ) 26 | 27 | end sub 28 | 29 | private sub register constructor 30 | ext.tests.addSuite("ext-algorithms-count") 31 | ext.tests.addTest("ext_algorithms-count", @test_count) 32 | ext.tests.addTest("ext_algorithms-countif", @test_countif) 33 | end sub 34 | 35 | end namespace 36 | -------------------------------------------------------------------------------- /tests/algorithms/fill.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/algorithms/fill.bi" 3 | 4 | namespace ext.tests.algorithms 5 | 6 | private sub test_fill 7 | dim array(4) as integer = { 10, 20, 30, 40, 50 } 8 | 9 | ext.Fill(@array(1), @array(1) + 3, 420) 10 | 11 | ext_assert_TRUE( array(0) = 10 ) 12 | ext_assert_TRUE( array(1) = 420 ) 13 | ext_assert_TRUE( array(2) = 420 ) 14 | ext_assert_TRUE( array(3) = 420 ) 15 | ext_assert_TRUE( array(4) = 50 ) 16 | 17 | end sub 18 | 19 | private sub register constructor 20 | ext.tests.addSuite("ext-algorithms-fill") 21 | ext.tests.addTest("ext_algorithms-fill", @test_fill) 22 | end sub 23 | 24 | end namespace 25 | -------------------------------------------------------------------------------- /tests/algorithms/filln.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/algorithms/filln.bi" 3 | 4 | namespace ext.tests.algorithms 5 | 6 | private sub test_filln 7 | dim array(4) as integer = { 10, 20, 30, 40, 50 } 8 | 9 | ext.FillN(@array(1), 3, 420) 10 | 11 | ext_assert_TRUE( array(0) = 10 ) 12 | ext_assert_TRUE( array(1) = 420 ) 13 | ext_assert_TRUE( array(2) = 420 ) 14 | ext_assert_TRUE( array(3) = 420 ) 15 | ext_assert_TRUE( array(4) = 50 ) 16 | 17 | end sub 18 | 19 | private sub register constructor 20 | ext.tests.addSuite("ext-algorithms-filln") 21 | ext.tests.addTest("ext_algorithms-filln", @test_filln) 22 | end sub 23 | 24 | end namespace 25 | -------------------------------------------------------------------------------- /tests/containers/array-ctor-rep.bas: -------------------------------------------------------------------------------- 1 | # define fbext_NoBuiltinInstanciations() 1 2 | # include once "ext/tests.bi" 3 | # include once "ext/containers/array.bi" 4 | 5 | fbext_Instanciate( fbext_Array, ((integer)) ) 6 | 7 | namespace ext.tests.containers 8 | 9 | private sub Test0 10 | 11 | var array = fbext_Array( ((integer)) )( 0, 420 ) 12 | ext_assert_EQUAL( 0, array.Size() ) 13 | ext_assert_EQUAL( 0, array.Capacity() ) 14 | 15 | end sub 16 | 17 | private sub Test1 18 | 19 | var array = fbext_Array( ((integer)) )( 1, 420 ) 20 | ext_assert_EQUAL( 1, array.Size() ) 21 | ext_assert_EQUAL( 420, *array.Front() ) 22 | 23 | end sub 24 | 25 | private sub register constructor 26 | ext.tests.addSuite("ext-containers-array-ctor-rep") 27 | ext.tests.addTest("Test0", @Test0) 28 | ext.tests.addTest("Test1", @Test1) 29 | end sub 30 | 31 | end namespace 32 | -------------------------------------------------------------------------------- /tests/containers/array-index.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/containers/array.bi" 3 | 4 | namespace ext.tests.containers.array_ 5 | 6 | private sub test_index 7 | 8 | var array = ext.fbext_Array( ((integer)) ) 9 | 10 | for i as integer = 0 to 5 11 | array.PushBack(i) 12 | next 13 | 14 | for i as integer = 0 to 5 15 | ext_assert_EQUAL( i, *array.Index(i) ) 16 | next 17 | 18 | end sub 19 | 20 | private sub test_at 21 | 22 | var array = ext.fbext_Array( ((integer)) ) 23 | 24 | for i as integer = 0 to 5 25 | array.PushBack(i) 26 | next 27 | 28 | ext_assert_EQUAL( 1, *array.at(1) ) 29 | ext_assert_TRUE( array.at(10) = null ) 30 | 31 | end sub 32 | 33 | private sub register constructor 34 | ext.tests.addSuite("ext-containers-array-index") 35 | ext.tests.addTest("Index", @test_index) 36 | ext.tests.addTest("At",@test_at) 37 | end sub 38 | 39 | end namespace 40 | -------------------------------------------------------------------------------- /tests/containers/array-swap.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/containers/array.bi" 3 | 4 | namespace ext.tests.containers.array_ 5 | 6 | private sub test_arrayswap 7 | 8 | var array1 = ext.fbext_Array( ((integer)) )(3, 69) 9 | var array2 = ext.fbext_Array( ((integer)) )(8, 420) 10 | 11 | array1.Swap_(array2) 12 | 13 | ext_assert_EQUAL( 8, array1.Size() ) 14 | ext_assert_EQUAL( 3, array2.Size() ) 15 | 16 | end sub 17 | 18 | private sub register constructor 19 | ext.tests.addSuite("ext-containers-array-swap") 20 | ext.tests.addTest("test_arrayswap", @test_arrayswap) 21 | end sub 22 | 23 | end namespace 24 | -------------------------------------------------------------------------------- /tests/containers/array.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/containers/array.bi" 3 | 4 | namespace ext.tests.containers 5 | 6 | private sub test_pushback 7 | 8 | var array = fbext_Array( ((integer)) ) 9 | 10 | array.PushBack(10) 11 | ext_assert_TRUE( 1 = array.Size() ) 12 | ext_assert_TRUE( 10 = *array.Front() ) 13 | ext_assert_TRUE( 10 = *array.Back() ) 14 | 15 | array.PushBack(20) 16 | ext_assert_TRUE( 2 = array.Size() ) 17 | ext_assert_TRUE( 10 = *array.Front() ) 18 | ext_assert_TRUE( 20 = *array.Back() ) 19 | 20 | array.PushBack(30) 21 | ext_assert_TRUE( 3 = array.Size() ) 22 | ext_assert_TRUE( 10 = *array.Front() ) 23 | ext_assert_TRUE( 30 = *array.Back() ) 24 | 25 | end sub 26 | 27 | private sub test_insert 28 | 29 | var array = fbext_Array( ((integer)) ) 30 | 31 | array.Insert(array.End_(), 5, 420) 32 | ext_assert_TRUE( 5 = array.Size() ) 33 | 34 | end sub 35 | 36 | private sub register constructor 37 | ext.tests.addSuite("ext-containers-array") 38 | ext.tests.addTest("test_pushback", @test_pushback) 39 | ext.tests.addTest("test_insert", @test_insert) 40 | end sub 41 | 42 | end namespace 43 | -------------------------------------------------------------------------------- /tests/containers/bloomfilter.bas: -------------------------------------------------------------------------------- 1 | #include once "ext/tests.bi" 2 | #include once "ext/containers/bloomfilter.bi" 3 | 4 | namespace ext.tests.bloomf 5 | 6 | private sub test_bf 7 | 8 | var bf = new ext.BloomFilter( 10 ) 9 | 10 | bf->add("Andre Victor") 11 | bf->add("Brian Kerighan") 12 | bf->add("Dennis Ritchie") 13 | bf->add("Rob Pike") 14 | bf->add("Ruben Rodriguez") 15 | bf->add("Daniel Verkamp") 16 | bf->add("Tito Puentes") 17 | 18 | ext_assert_TRUE(bf->lookup("Dennis Ritchie")) 19 | ext_assert_TRUE(bf->lookup("Andre Victor")) 20 | ext_assert_FALSE(bf->lookup("Ben Stiller")) 21 | ext_assert_FALSE(bf->lookup("Bill Gates")) 22 | 23 | delete bf 24 | 25 | end sub 26 | 27 | private sub register constructor 28 | ext.tests.addSuite("Containers::BloomFilter") 29 | ext.tests.addTest("General",@test_bf) 30 | end sub 31 | 32 | end namespace 33 | -------------------------------------------------------------------------------- /tests/containers/list-empty.bas: -------------------------------------------------------------------------------- 1 | # define fbext_NoBuiltinInstanciations() 1 2 | # include once "ext/tests.bi" 3 | 4 | # include once "ext/containers/list.bi" 5 | 6 | fbext_Instanciate(fbext_List, ((integer))) 7 | 8 | namespace ext.tests.containers 9 | 10 | private sub testEmpty 11 | 12 | var list = fbext_List( ((integer)) ) 13 | 14 | ext_assert_TRUE( list.Empty() ) 15 | 16 | list.PushBack(1) 17 | 18 | ext_assert_TRUE( not list.Empty() ) 19 | 20 | end sub 21 | 22 | private sub register constructor 23 | ext.tests.addSuite("ext-containers-list-empty") 24 | ext.tests.addTest("testEmpty", @testEmpty) 25 | end sub 26 | 27 | end namespace 28 | -------------------------------------------------------------------------------- /tests/containers/list-string.bas: -------------------------------------------------------------------------------- 1 | # define fbext_NoBuiltinInstanciations() 1 2 | # include once "ext/tests.bi" 3 | 4 | # include once "ext/containers/list.bi" 5 | 6 | fbext_Instanciate(fbext_List, ((string))) 7 | 8 | namespace ext.tests.containers 9 | 10 | private sub testSimple 11 | 12 | var list = ext.fbext_List( ((string)) ) 13 | 14 | list.PushBack("one") 15 | list.PushBack("two") 16 | 17 | ext_assert_STRING_EQUAL( "one", *list.cFront() ) 18 | ext_assert_STRING_EQUAL( "two", *list.cBack() ) 19 | 20 | end sub 21 | 22 | private sub register constructor 23 | ext.tests.addSuite("ext-containers-list-string") 24 | ext.tests.addTest("testSimple", @testSimple) 25 | end sub 26 | 27 | end namespace 28 | -------------------------------------------------------------------------------- /tests/containers/list.bas: -------------------------------------------------------------------------------- 1 | # define fbext_NoBuiltinInstanciations() 1 2 | # include once "ext/tests.bi" 3 | 4 | # include once "ext/containers/list.bi" 5 | 6 | fbext_Instanciate(fbext_List, ((integer))) 7 | 8 | namespace ext.tests.containers 9 | 10 | private sub test_pushback 11 | 12 | var list = fbext_List( ((integer)) ) 13 | 14 | list.PushBack(10) 15 | ext_assert_TRUE( 1 = list.Size() ) 16 | ext_assert_TRUE( 10 = *list.Front() ) 17 | ext_assert_TRUE( 10 = *list.Back() ) 18 | 19 | list.PushBack(20) 20 | ext_assert_TRUE( 2 = list.Size() ) 21 | ext_assert_TRUE( 10 = *list.Front() ) 22 | ext_assert_TRUE( 20 = *list.Back() ) 23 | 24 | list.PushBack(30) 25 | ext_assert_TRUE( 3 = list.Size() ) 26 | ext_assert_TRUE( 10 = *list.Front() ) 27 | ext_assert_TRUE( 30 = *list.Back() ) 28 | 29 | end sub 30 | 31 | private sub test_insert 32 | 33 | var list = fbext_List( ((integer)) ) 34 | 35 | list.Insert(list.End_(), 5, 420) 36 | ext_assert_TRUE( 5 = list.Size() ) 37 | 38 | end sub 39 | 40 | private sub register constructor 41 | ext.tests.addSuite("ext-containers-list") 42 | ext.tests.addTest("test_pushback", @test_pushback) 43 | ext.tests.addTest("test_insert", @test_insert) 44 | end sub 45 | 46 | end namespace 47 | -------------------------------------------------------------------------------- /tests/conversion/base64.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/conversion/base64.bi" 3 | 4 | namespace ext.tests.conversion.base64 5 | 6 | const hw_base64 = "SGVsbG8sIFdvcmxkIQ==" 7 | const hellow = "Hello, World!" 8 | 9 | private sub test_base64_encode 10 | 11 | var enc64 = ext.conversion.base64.encode( hellow ) 12 | 13 | ext_assert_STRING_EQUAL( hw_base64, enc64 ) 14 | 15 | end sub 16 | 17 | function stringcompare( byref rhs as const string, byref lhs as const string ) as ext.bool 18 | 19 | var len_r = len(rhs) - 1 20 | var len_l = len(lhs) - 1 21 | 22 | var len_u = len_r 23 | if len_l < len_r then len_u = len_l 24 | 25 | for n as integer = 0 to len_u 26 | if rhs[n] <> lhs[n] then return false 27 | next 28 | 29 | return true 30 | 31 | end function 32 | 33 | private sub test_base64_decode 34 | 35 | var dec64 = "" 36 | ext.conversion.base64.decode( dec64, hw_base64 ) 37 | 38 | ext_assert_TRUE( stringcompare(hellow, dec64) ) 39 | 40 | end sub 41 | 42 | private sub register constructor 43 | ext.tests.addSuite("ext-base64") 44 | ext.tests.addTest("test_base64_encode", @test_base64_encode) 45 | ext.tests.addTest("test_base64_decode", @test_base64_decode) 46 | end sub 47 | 48 | end namespace 49 | -------------------------------------------------------------------------------- /tests/file/file.bas: -------------------------------------------------------------------------------- 1 | #include once "ext/tests.bi" 2 | #include once "ext/file/file.bi" 3 | 4 | namespace ext.tests.file_ 5 | 6 | const as string test_filename = "fbexttest.tst" 7 | 8 | private sub create_file 9 | var ff = freefile 10 | var ret = open( test_filename, for output, access write, as #ff ) 11 | ext_assert_TRUE_ERROR( ret = 0 ) 12 | for n as integer = 0 to 9 13 | print #ff, "Line " & n 14 | next 15 | close #ff 16 | end sub 17 | 18 | private sub test_readline 19 | var x = new ext.File(test_filename) 20 | ext_assert_TRUE_ERROR( x <> 0 ) 21 | ext_assert_FALSE( x->open() ) 22 | for n as integer = 0 to 9 23 | ext_assert_STRING_EQUAL( "Line " & n, x->readLine() ) 24 | next 25 | delete x 26 | end sub 27 | 28 | private sub kill_file 29 | kill test_filename 30 | end sub 31 | 32 | private sub register constructor 33 | ext.tests.addSuite("ext-file-class") 34 | ext.tests.addSuiteHook(ext.tests.Hook.before_all,@create_file) 35 | ext.tests.addSuiteHook(ext.tests.Hook.after_all,@kill_file) 36 | ext.tests.addTest("reading lines", @test_readline) 37 | end sub 38 | 39 | end namespace 40 | -------------------------------------------------------------------------------- /tests/hash/hmac.bas: -------------------------------------------------------------------------------- 1 | #include once "ext/tests.bi" 2 | #include once "ext/hash/hmac.bi" 3 | 4 | namespace ext.tests.hmac 5 | 6 | const HMAC_TEST_STRING = "The quick brown fox jumps over the lazy dog" 7 | 8 | private sub test_hmacmd5 9 | 10 | var empty = lcase(ext.hashes.hmac.md5("","")) 11 | var test = lcase(ext.hashes.hmac.md5("key", HMAC_TEST_STRING)) 12 | 13 | EXT_ASSERT_TRUE("74e6f7298a9c2d168935f58c001bad88" = empty) 14 | EXT_ASSERT_TRUE("80070713463e7749b90c2dc24911e275" = test) 15 | 16 | end sub 17 | 18 | private sub test_hmacsha256 19 | 20 | var empty = lcase(ext.hashes.hmac.sha256("","")) 21 | var test = lcase(ext.hashes.hmac.sha256("key", HMAC_TEST_STRING)) 22 | 23 | EXT_ASSERT_TRUE("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad" = empty) 24 | EXT_ASSERT_TRUE("f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8" = test) 25 | 26 | end sub 27 | 28 | private sub register constructor 29 | ext.tests.addSuite("ext-hashes-hmac") 30 | ext.tests.addTest("hmac-md5",@test_hmacmd5) 31 | ext.tests.addTest("hmac-sha256",@test_hmacsha256) 32 | end sub 33 | 34 | end namespace 35 | -------------------------------------------------------------------------------- /tests/main.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | 3 | dim as integer retval = ext.tests.runTests() 4 | 5 | if retval > -1 then end retval 6 | -------------------------------------------------------------------------------- /tests/math/npr-ncr.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/math/npr.bi" 3 | # include once "ext/math/ncr.bi" 4 | 5 | namespace ext.tests.math 6 | 7 | using ext.math 8 | 9 | private sub test_npr 10 | 11 | ' 0-size set and/or subset (fail).. 12 | ext_assert_EQUAL(0, nPr(0, 0)) 13 | ext_assert_EQUAL(0, nPr(1, 0)) 14 | ext_assert_EQUAL(0, nPr(0, 1)) 15 | 16 | ' larger subset (fail).. 17 | ext_assert_EQUAL(0, nPr(1, 2)) 18 | 19 | ' general.. 20 | ext_assert_EQUAL(311875200, nPr(52, 5)) 21 | 22 | end sub 23 | 24 | private sub test_ncr 25 | 26 | ' 0-size set and/or subset (fail).. 27 | ext_assert_EQUAL(0, nCr(0, 0)) 28 | ext_assert_EQUAL(0, nCr(1, 0)) 29 | ext_assert_EQUAL(0, nCr(0, 1)) 30 | 31 | ' larger subset (fail).. 32 | ext_assert_EQUAL(0, nCr(1, 2)) 33 | 34 | ' general.. 35 | ext_assert_EQUAL(2598960, nCr(52, 5)) 36 | 37 | end sub 38 | 39 | private sub register constructor 40 | ext.tests.addSuite("ext-math-npr/ncr") 41 | ext.tests.addTest("test_npr", @test_npr) 42 | ext.tests.addTest("test_ncr", @test_ncr) 43 | end sub 44 | 45 | end namespace 46 | 47 | -------------------------------------------------------------------------------- /tests/math/pow2.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/math/pow2.bi" 4 | 5 | namespace ext.tests.math 6 | 7 | private sub ispow2test 8 | 9 | dim as ulongint n 10 | n = cast(ulongint, 2) 11 | while n < 2^32 12 | ext_assert_TRUE( ext.math.ispow2(n) ) 13 | 'print ext.math.ispow2(n) & ":" & n 14 | n^=2 15 | wend 16 | 17 | end sub 18 | 19 | private sub register constructor 20 | ext.tests.addSuite("ext-math-pow2-test") 21 | ext.tests.addTest("ispow2test", @ispow2test) 22 | end sub 23 | 24 | end namespace 25 | -------------------------------------------------------------------------------- /tests/math/random.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/math/random.bi" 4 | 5 | namespace ext.tests.math 6 | 7 | private sub intRndRangetest 8 | 9 | dim as integer xx 10 | 11 | for n as integer = 1 to 30 12 | 13 | xx = ext.math.RndRange(1,5) 14 | 15 | ext_assert_TRUE( ( xx >= 1 ) ) 16 | ext_assert_TRUE( ( xx<=5 ) ) 17 | 18 | next 19 | 20 | end sub 21 | 22 | private sub doubleRndRangetest 23 | 24 | dim as double xx 25 | 26 | for n as integer = 1 to 30 27 | 28 | xx = ext.math.RndRange(1.0,5.0) 29 | 30 | ext_assert_TRUE( ( xx > 0.99 ) ) 31 | ext_assert_TRUE( ( xx < 6.0 ) ) 32 | 33 | next 34 | 35 | end sub 36 | 37 | private sub register constructor 38 | ext.tests.addSuite("ext-math-random-test") 39 | ext.tests.addTest("intRndRange", @intRndRangetest) 40 | ext.tests.addTest("doubleRndRange", @doubleRndRangetest) 41 | end sub 42 | 43 | end namespace 44 | -------------------------------------------------------------------------------- /tests/math/vector2-dot.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/math/vector2.bi" 3 | 4 | namespace ext.tests.math 5 | 6 | type Vector as ext.math.fbext_Vector2( ((double)) ) 7 | 8 | private sub Test 9 | 10 | var a = Vector( 2.0, 3.0 ) 11 | var b = Vector( 4.0, 5.0 ) 12 | 13 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 23.0, a.Dot(b) ) ) 14 | 15 | end sub 16 | 17 | private sub register constructor 18 | ext.tests.addSuite("ext-math-vector2-magnitude") 19 | ext.tests.addTest("Test", @Test) 20 | end sub 21 | 22 | end namespace 23 | -------------------------------------------------------------------------------- /tests/math/vector2-magnitude.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/math/vector2.bi" 3 | 4 | namespace ext.tests.math 5 | 6 | type Vector as ext.math.fbext_Vector2( ((double)) ) 7 | 8 | private sub Test 9 | 10 | var a = Vector( 5.0, 0.0 ) 11 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 5.0, a.Magnitude() ) ) 12 | 13 | var b = Vector( -5.0, 0.0 ) 14 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 5.0, b.Magnitude() ) ) 15 | 16 | var c = Vector( 0.0, 5.0 ) 17 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 5.0, c.Magnitude() ) ) 18 | 19 | var d = Vector( 0.0, -5.0 ) 20 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 5.0, d.Magnitude() ) ) 21 | 22 | var e = Vector( 3.0, 4.0 ) 23 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 5.0, e.Magnitude() ) ) 24 | 25 | end sub 26 | 27 | private sub register constructor 28 | ext.tests.addSuite("ext-math-vector2-magnitude") 29 | ext.tests.addTest("Test", @Test) 30 | end sub 31 | 32 | end namespace 33 | 34 | -------------------------------------------------------------------------------- /tests/math/vector2-normal.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/math/vector2.bi" 3 | 4 | namespace ext.tests.math 5 | 6 | type Vector as ext.math.fbext_Vector2( ((double)) ) 7 | 8 | private sub Test 9 | 10 | var a = Vector( 10.0, 0.0 ) 11 | a.Normalize() 12 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 1.0, a.x ) ) 13 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 0.0, a.y ) ) 14 | 15 | var b = Vector( 0.0, 10.0 ) 16 | b.Normalize() 17 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 0.0, b.x ) ) 18 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 1.0, b.y ) ) 19 | 20 | var c = Vector( -10.0, 0.0 ) 21 | c.Normalize() 22 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( -1.0, c.x ) ) 23 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 0.0, c.y ) ) 24 | 25 | var d = Vector( 0.0, -10.0 ) 26 | d.Normalize() 27 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 0.0, d.x ) ) 28 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( -1.0, d.y ) ) 29 | 30 | end sub 31 | 32 | private sub register constructor 33 | ext.tests.addSuite("ext-math-vector2-normal") 34 | ext.tests.addTest("Test", @Test) 35 | end sub 36 | 37 | end namespace 38 | -------------------------------------------------------------------------------- /tests/math/vector2-normalize.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/math/vector2.bi" 3 | 4 | namespace ext.tests.math 5 | 6 | private sub TestSimple 7 | 8 | var a = ext.math.fbext_Vector2( ((double)) )( 100.0, 0.0 ) 9 | a.Normalize() 10 | 11 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( a.x, 1.0 ) ) 12 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( a.y, 0.0 ) ) 13 | 14 | var b = ext.math.fbext_Vector2( ((double)) )( 0.0, 100.0 ) 15 | b.Normalize() 16 | 17 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( b.x, 0.0 ) ) 18 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( b.y, 1.0 ) ) 19 | 20 | var c = ext.math.fbext_Vector2( ((double)) )( -100.0, 0.0 ) 21 | c.Normalize() 22 | 23 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( c.x, -1.0 ) ) 24 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( c.y, 0.0 ) ) 25 | 26 | var d = ext.math.fbext_Vector2( ((double)) )( 0.0, -100.0 ) 27 | d.Normalize() 28 | 29 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( d.x, 0.0 ) ) 30 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( d.y, -1.0 ) ) 31 | 32 | end sub 33 | 34 | private sub register constructor 35 | ext.tests.addSuite("ext-math-vector2-normalize") 36 | ext.tests.addTest("TestSimple", @TestSimple) 37 | end sub 38 | 39 | end namespace 40 | -------------------------------------------------------------------------------- /tests/math/vector3-dot.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/math/vector3.bi" 3 | 4 | namespace ext.tests.math 5 | 6 | type Vector as ext.math.fbext_Vector3( ((double)) ) 7 | 8 | private sub Test 9 | 10 | var a = Vector( 2.0, 3.0, 4.0 ) 11 | var b = Vector( 5.0, 6.0, 7.0 ) 12 | 13 | ext_assert_TRUE( FBEXT_FLOAT_EQUAL( 56.0, a.Dot(b) ) ) 14 | 15 | end sub 16 | 17 | private sub register constructor 18 | ext.tests.addSuite("ext-math-vector3-dot") 19 | ext.tests.addTest("Test", @Test) 20 | end sub 21 | 22 | end namespace 23 | -------------------------------------------------------------------------------- /tests/memory/allocator-string.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/memory/allocator.bi" 3 | 4 | namespace ext.tests.memory 5 | 6 | private sub test 7 | 8 | var alloc = ext.fbext_Allocator( ((string)) ) 9 | 10 | var p = alloc.Allocate(1) 11 | alloc.Construct(p, "text") 12 | 13 | ext_assert_STRING_EQUAL( "text", *p ) 14 | 15 | alloc.DeAllocate(p, 1) 16 | 17 | end sub 18 | 19 | private sub register constructor 20 | ext.tests.addSuite("ext-memory-allocator-string") 21 | ext.tests.addTest("test", @test) 22 | end sub 23 | 24 | end namespace 25 | -------------------------------------------------------------------------------- /tests/memory/scopedptr.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/memory/scopedptr.bi" 3 | 4 | namespace ext.tests.memory 5 | 6 | private sub test 7 | 8 | ' default construction.. 9 | var sp0 = fbext_ScopedPtr((integer)) 10 | 11 | ext_assert_TRUE( null = sp0.Get() ) 12 | 13 | ' construction with a pointer.. 14 | var ip = new integer(50) 15 | var sp1 = fbext_ScopedPtr((integer))(ip) 16 | 17 | ext_assert_TRUE( ip = sp1.Get() ) 18 | 19 | ' copy construction.. 20 | var sp2 = sp1 21 | 22 | ext_assert_TRUE( null = sp1.Get() ) 23 | ext_assert_TRUE( ip = sp2.Get() ) 24 | 25 | ' copy assignment.. 26 | sp2 = sp1 27 | 28 | ext_assert_TRUE( null = sp1.Get() ) 29 | ext_assert_TRUE( null = sp2.Get() ) 30 | 31 | end sub 32 | 33 | private sub register constructor 34 | ext.tests.addSuite("ext-memory-scopedptr") 35 | ext.tests.addTest("test", @test) 36 | end sub 37 | 38 | end namespace 39 | -------------------------------------------------------------------------------- /tests/memory/scopedptrarray.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/memory/scopedptrarray.bi" 3 | 4 | namespace ext.tests.memory 5 | 6 | private sub test 7 | 8 | ' default construction.. 9 | var sp0 = fbext_ScopedPtrArray((integer)) 10 | 11 | ext_assert_TRUE( null = sp0.Get() ) 12 | 13 | ' construction with a pointer.. 14 | var ip = new integer[10] 15 | var sp1 = fbext_ScopedPtrArray((integer))(ip) 16 | 17 | ext_assert_TRUE( ip = sp1.Get() ) 18 | 19 | ' copy construction.. 20 | var sp2 = sp1 21 | 22 | ext_assert_TRUE( null = sp1.Get() ) 23 | ext_assert_TRUE( ip = sp2.Get() ) 24 | 25 | ' copy assignment.. 26 | sp2 = sp1 27 | 28 | ext_assert_TRUE( null = sp1.Get() ) 29 | ext_assert_TRUE( null = sp2.Get() ) 30 | 31 | end sub 32 | 33 | private sub register constructor 34 | ext.tests.addSuite("ext-memory-scopedarray") 35 | ext.tests.addTest("test", @test) 36 | end sub 37 | 38 | end namespace 39 | -------------------------------------------------------------------------------- /tests/misc/uuid.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/misc.bi" 3 | 4 | namespace ext.tests.misc.uuid 5 | 6 | '' ::::: 7 | private sub null_check 8 | dim x as ext.misc.UUID 9 | var y = ext.misc.UUID("{00000000-0000-0000-0000-000000000000}") 10 | var z = ext.misc.UUID("1234") 11 | var valid = ext.misc.UUID("{12345678-1234-5678-1234-567812345678}") 12 | 13 | ext_assert_TRUE( x.isNull ) 14 | ext_assert_TRUE( y.isNull ) 15 | ext_assert_TRUE( z.isNull ) 16 | ext_assert_FALSE( valid.isNull ) 17 | 18 | 19 | end sub 20 | 21 | private sub string_conversion 22 | 23 | var y = ext.misc.UUID("{00000000-0000-0000-0000-000000000000}") 24 | var valid = ext.misc.UUID("{12345678-1234-5678-1234-567812345678}") 25 | 26 | ext_assert_STRING_NOT_EQUAL(y,valid) 27 | ext_assert_STRING_EQUAL("{12345678-1234-5678-1234-567812345678}",valid) 28 | ext_assert_STRING_EQUAL("{00000000-0000-0000-0000-000000000000}",y) 29 | 30 | end sub 31 | 32 | '' ::::: 33 | private sub register constructor 34 | ext.tests.addSuite("ext-misc-uuid") 35 | ext.tests.addTest("UUID Null Check", @null_check) 36 | ext.tests.addTest("UUID String Conversion",@string_conversion) 37 | end sub 38 | 39 | end namespace 40 | -------------------------------------------------------------------------------- /tests/php/addslashes.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/php.bi" 3 | 4 | namespace ext.tests.php_ 5 | 6 | '' ::::: 7 | private sub API 8 | dim result as string = ext.php.AddSlashes("") 9 | end sub 10 | 11 | '' ::::: 12 | private sub Test 13 | 14 | ' this is just a call to ext.php.AddCSlashes, so only the characters 15 | ' passed to it need checking (quote, double-qoute and backslash).. 16 | ext_assert_TRUE( !"[\\'] [\\\"] [\\\\]" = ext.php.AddSlashes(!"['] [\"] [\\]") ) 17 | 18 | end sub 19 | 20 | '' ::::: 21 | private sub register constructor 22 | ext.tests.addSuite("ext-php-addslashes") 23 | ext.tests.addTest("API", @API) 24 | ext.tests.addTest("Test", @Test) 25 | end sub 26 | 27 | end namespace 28 | -------------------------------------------------------------------------------- /tests/php/implode.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/php.bi" 3 | 4 | namespace ext.tests.php_ 5 | 6 | '' ::::: 7 | private sub API 8 | dim strings(0) as string 9 | dim result as string = ext.php.Implode("", strings()) 10 | end sub 11 | 12 | '' ::::: 13 | private sub TestSimple 14 | 15 | dim strings(2) as string 16 | strings(0) = "one" 17 | strings(1) = "two" 18 | strings(2) = "three" 19 | ext_assert_TRUE( "one::two::three" = ext.php.Implode("::", strings()) ) 20 | 21 | end sub 22 | 23 | '' ::::: 24 | private sub TestEmptyGlue 25 | 26 | dim strings(2) as string 27 | strings(0) = "one" 28 | strings(1) = "two" 29 | strings(2) = "three" 30 | ext_assert_TRUE( "onetwothree" = ext.php.Implode("", strings()) ) 31 | 32 | end sub 33 | 34 | '' ::::: 35 | private sub register constructor 36 | ext.tests.addSuite("ext-php-implode") 37 | ext.tests.addTest("API", @API) 38 | ext.tests.addTest("TestSimple", @TestSimple) 39 | ext.tests.addTest("TestEmptyGlue", @TestEmptyGlue) 40 | end sub 41 | 42 | end namespace 43 | -------------------------------------------------------------------------------- /tests/php/join.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/php.bi" 3 | 4 | namespace ext.tests.php_ 5 | 6 | ' ext.php.Join is an alias to ext.php.Implode, so only the API needs 7 | ' testing.. 8 | 9 | '' ::::: 10 | private sub API 11 | dim strings(0) as string 12 | dim result as string = ext.php.Join("", strings()) 13 | end sub 14 | 15 | '' ::::: 16 | private sub register constructor 17 | ext.tests.addSuite("ext-php-join") 18 | ext.tests.addTest("API", @API) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/php/strrchr.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/php.bi" 3 | 4 | namespace ext.tests.php_ 5 | 6 | '' ::::: 7 | private sub API 8 | dim result as string 9 | result = ext.php.StrRChr("some text", "t") 10 | result = ext.php.StrRChr("some text", asc("t")) 11 | end sub 12 | 13 | '' ::::: 14 | private sub TestSimple 15 | ext_assert_TRUE( ":123" = ext.php.StrRChr(":abc:123", asc(":")) ) 16 | ext_assert_TRUE( ":123" = ext.php.StrRChr(":abc:123", "::") ) 17 | end sub 18 | 19 | '' ::::: 20 | private sub TestEmptyChars 21 | ext_assert_TRUE( "" = ext.php.StrRChr("abc", "") ) 22 | end sub 23 | 24 | '' ::::: 25 | private sub TestEmptyText 26 | ext_assert_TRUE( "" = ext.php.StrRChr("", asc(":")) ) 27 | end sub 28 | 29 | '' ::::: 30 | private sub TestCharNotFound 31 | ext_assert_TRUE( "" = ext.php.StrRChr("abc", asc("x")) ) 32 | end sub 33 | 34 | '' ::::: 35 | private sub register constructor 36 | ext.tests.addSuite("ext-php-strrchr") 37 | ext.tests.addTest("API", @API) 38 | ext.tests.addTest("TestSimple", @TestSimple) 39 | ext.tests.addTest("TestEmptyChars", @TestEmptyChars) 40 | ext.tests.addTest("TestEmptyText", @TestEmptyText) 41 | ext.tests.addTest("TestCharNotFound", @TestCharNotFound) 42 | end sub 43 | 44 | end namespace 45 | -------------------------------------------------------------------------------- /tests/preprocessor/array-core.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/preprocessor/array/size.bi" 3 | # include once "ext/preprocessor/array/data.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.array_.size 7 | 8 | private sub test 9 | 10 | # define ARRAY0 (0, ()) 11 | # define ARRAY1 (1, (a)) 12 | # define ARRAY2 (2, (a, b)) 13 | 14 | ext_assert_TRUE( 0 = fbextPP_ArraySize(ARRAY0) ) 15 | ext_assert_TRUE( 1 = fbextPP_ArraySize(ARRAY1) ) 16 | ext_assert_TRUE( 2 = fbextPP_ArraySize(ARRAY2) ) 17 | 18 | end sub 19 | 20 | end namespace 21 | 22 | namespace ext.tests.preprocessor.array_.data_ 23 | 24 | private sub test 25 | 26 | # define ARRAY0 (0, ()) 27 | # define ARRAY1 (1, (a)) 28 | # define ARRAY2 (2, (a, b)) 29 | 30 | ext_assert_TRUE( "()" = FBEXT_PP_STRINGIZE(fbextPP_ArrayData(ARRAY0)) ) 31 | ext_assert_TRUE( "(a)" = FBEXT_PP_STRINGIZE(fbextPP_ArrayData(ARRAY1)) ) 32 | ext_assert_TRUE( "(a, b)" = FBEXT_PP_STRINGIZE(fbextPP_ArrayData(ARRAY2)) ) 33 | 34 | end sub 35 | 36 | end namespace 37 | 38 | namespace ext.tests.preprocessor.array_ 39 | 40 | private sub register constructor 41 | ext.tests.addSuite("ext-preprocessor-array-core") 42 | ext.tests.addTest("size.test", @size.test) 43 | ext.tests.addTest("data_.test", @data_.test) 44 | end sub 45 | 46 | end namespace 47 | -------------------------------------------------------------------------------- /tests/preprocessor/control-while.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/preprocessor/control/while.bi" 3 | # include once "ext/preprocessor/comparison/notequal.bi" 4 | # include once "ext/preprocessor/arithmetic/inc.bi" 5 | # include once "ext/preprocessor/stringize.bi" 6 | 7 | namespace ext.tests.preprocessor.control 8 | 9 | private sub test 10 | 11 | # define PRED(r, state) PRED_ state 12 | # define PRED_(value, limit) fbextPP_NotEqual(value, limit) 13 | 14 | # define OP(r, state) OP_ state 15 | # define OP_(value, limit) (fbextPP_Inc(value), limit) 16 | 17 | # define RESULT() RESULT_ fbextPP_While(PRED, OP, (1, 5)) 18 | # define RESULT_(value, limit) value 19 | 20 | ext_assert_TRUE( 5 = RESULT() ) 21 | 22 | end sub 23 | 24 | private sub testNoRepeat 25 | 26 | # define PRED(r, state) 0 27 | # define OP(r, state) 69 28 | # define RESULT() fbextPP_While(PRED, OP, 420) 29 | 30 | ext_assert_TRUE( 420 = RESULT() ) 31 | 32 | end sub 33 | 34 | private sub register constructor 35 | ext.tests.addSuite("ext-preprocessor-control-while") 36 | ext.tests.addTest("test", @test) 37 | ext.tests.addTest("testNoRepeat", @testNoRepeat) 38 | end sub 39 | 40 | end namespace 41 | -------------------------------------------------------------------------------- /tests/preprocessor/repetition-for.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/repetition/for.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.repetition.for_ 7 | 8 | private sub test 9 | 10 | # define PRED(r, state) fbextPP_LessThan(state, 4) 11 | # define OP(r, state) fbextPP_Inc(state) 12 | # define M(r, state) [state] 13 | 14 | ext_assert_TRUE( "[1] [2] [3]" = FBEXT_PP_STRINGIZE(fbextPP_For(1, PRED, OP, M)) ) 15 | 16 | end sub 17 | 18 | private sub register constructor 19 | ext.tests.addSuite("ext-preprocessor-repetition-for") 20 | ext.tests.addTest("test", @test) 21 | end sub 22 | 23 | end namespace 24 | -------------------------------------------------------------------------------- /tests/preprocessor/repetition-repeat.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/repetition/repeat.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define M(n, data) n##data 11 | 12 | ext_assert_TRUE( "0x 1x 2x 3x 4x" = FBEXT_PP_STRINGIZE(FBEXT_PP_REPEAT(5, M, x)) ) 13 | 14 | end sub 15 | 16 | private sub register constructor 17 | ext.tests.addSuite("ext-preprocessor-repeat") 18 | ext.tests.addTest("test", @test) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-cat.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/preprocessor/seq/cat.bi" 3 | # include once "ext/preprocessor/stringize.bi" 4 | 5 | namespace ext.tests.preprocessor.sequence 6 | 7 | private sub testCat 8 | 9 | # define SEQ (a)(b)(c)(d) 10 | 11 | ext_assert_TRUE( "abcd" = FBEXT_PP_STRINGIZE(fbextPP_SeqCat(SEQ)) ) 12 | 13 | end sub 14 | 15 | private sub testCatWithGlue 16 | 17 | # define SEQ (a)(b)(c)(d) 18 | 19 | ext_assert_TRUE( "a:b:c:d" = FBEXT_PP_STRINGIZE(fbextPP_SeqCatWithGlue(SEQ, :)) ) 20 | 21 | end sub 22 | 23 | private sub register constructor 24 | ext.tests.addSuite("ext-preprocessor-seq-cat") 25 | ext.tests.addTest("testCat", @testCat) 26 | ext.tests.addTest("testCatWithGlue", @testCatWithGlue) 27 | end sub 28 | 29 | end namespace 30 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-elem.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/elem.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | 12 | ext_assert_TRUE( "a" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_ELEM(0, SEQ)) ) 13 | ext_assert_TRUE( "b" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_ELEM(1, SEQ)) ) 14 | ext_assert_TRUE( "c" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_ELEM(2, SEQ)) ) 15 | ext_assert_TRUE( "d" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_ELEM(3, SEQ)) ) 16 | 17 | end sub 18 | 19 | private sub register constructor 20 | ext.tests.addSuite("ext-preprocessor-seq-elem") 21 | ext.tests.addTest("test", @test) 22 | end sub 23 | 24 | end namespace 25 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-enum.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/enum.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ ((a)(b)(c)(d)) 11 | 12 | ext_assert_STRING_EQUAL( "(a, b, c, d)", FBEXT_PP_STRINGIZE((FBEXT_PP_SEQ_ENUM(SEQ))) ) 13 | 14 | end sub 15 | 16 | private sub register constructor 17 | ext.tests.addSuite("ext-preprocessor-seq-enum") 18 | ext.tests.addTest("test", @test) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-firstn.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/firstn.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | 12 | ext_assert_TRUE( "(a)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_FIRSTN(1, SEQ)) ) 13 | ext_assert_TRUE( "(a)(b)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_FIRSTN(2, SEQ)) ) 14 | ext_assert_TRUE( "(a)(b)(c)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_FIRSTN(3, SEQ)) ) 15 | ext_assert_TRUE( "(a)(b)(c)(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_FIRSTN(4, SEQ)) ) 16 | 17 | end sub 18 | 19 | private sub register constructor 20 | ext.tests.addSuite("ext-preprocessor-seq-firstn") 21 | ext.tests.addTest("test", @test) 22 | end sub 23 | 24 | end namespace 25 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-foldleft.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/foldleft.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | # define OP(state, elem) state##elem 12 | 13 | ext_assert_STRING_EQUAL( "xabcd", FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_FOLDLEFT(OP, x, SEQ)) ) 14 | 15 | end sub 16 | 17 | private sub register constructor 18 | ext.tests.addSuite("ext-preprocessor-seq-foldleft") 19 | ext.tests.addTest("test", @test) 20 | end sub 21 | 22 | end namespace 23 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-foldright.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/foldright.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ ((a)(b)(c)(d)) 11 | # define OP(state, elem) state##elem 12 | 13 | ext_assert_STRING_EQUAL( "xdcba", FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_FOLDRIGHT(OP, x, SEQ)) ) 14 | 15 | end sub 16 | 17 | private sub register constructor 18 | ext.tests.addSuite("ext-preprocessor-seq-foldright") 19 | ext.tests.addTest("test", @test) 20 | end sub 21 | 22 | end namespace 23 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-foreach.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/foreach.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | # define M(data, elem) data##elem 12 | 13 | ext_assert_TRUE( "xa xb xc xd" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_FOREACH(M, x, SEQ)) ) 14 | 15 | end sub 16 | 17 | private sub register constructor 18 | ext.tests.addSuite("ext-preprocessor-seq-foreach") 19 | ext.tests.addTest("test", @test) 20 | end sub 21 | 22 | end namespace 23 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-foreachi.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/foreachi.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | # define M(data, i, elem) data##i##elem 12 | 13 | ext_assert_TRUE( "x0a x1b x2c x3d" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_FOREACHI(M, x, SEQ)) ) 14 | 15 | end sub 16 | 17 | private sub register constructor 18 | ext.tests.addSuite("ext-preprocessor-seq-foreachi") 19 | ext.tests.addTest("test", @test) 20 | end sub 21 | 22 | end namespace 23 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-fromvalue.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/fromvalue.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.seq.fromvalue 7 | 8 | private sub test 9 | 10 | ext_assert_TRUE( "(x)" = FBEXT_PP_STRINGIZE(fbextPP_SeqFromValue(1, x)) ) 11 | ext_assert_TRUE( "(x)(x)" = FBEXT_PP_STRINGIZE(fbextPP_SeqFromValue(2, x)) ) 12 | ext_assert_TRUE( "(x)(x)(x)" = FBEXT_PP_STRINGIZE(fbextPP_SeqFromValue(3, x)) ) 13 | 14 | end sub 15 | 16 | private sub register constructor 17 | ext.tests.addSuite("ext-preprocessor-seq-fromvalue") 18 | ext.tests.addTest("test", @test) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-head_tail.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/head.bi" 4 | # include once "ext/preprocessor/seq/tail.bi" 5 | # include once "ext/preprocessor/stringize.bi" 6 | 7 | namespace ext.tests.preprocessor 8 | 9 | private sub test_head 10 | 11 | # define SEQ (a)(b)(c)(d) 12 | 13 | ext_assert_TRUE( "a" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_HEAD(SEQ)) ) 14 | 15 | end sub 16 | 17 | private sub test_tail 18 | 19 | # define SEQ (a)(b)(c)(d) 20 | 21 | ext_assert_TRUE( "(b)(c)(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_TAIL(SEQ)) ) 22 | 23 | end sub 24 | 25 | private sub register constructor 26 | ext.tests.addSuite("ext-preprocessor-seq-head_tail") 27 | ext.tests.addTest("test_head", @test_head) 28 | ext.tests.addTest("test_tail", @test_tail) 29 | end sub 30 | 31 | end namespace 32 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-insert.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/insert.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | 12 | ext_assert_TRUE( "(x)(a)(b)(c)(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_INSERT(SEQ, 0, x)) ) 13 | ext_assert_TRUE( "(a)(x)(b)(c)(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_INSERT(SEQ, 1, x)) ) 14 | ext_assert_TRUE( "(a)(b)(x)(c)(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_INSERT(SEQ, 2, x)) ) 15 | ext_assert_TRUE( "(a)(b)(c)(x)(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_INSERT(SEQ, 3, x)) ) 16 | 17 | end sub 18 | 19 | private sub register constructor 20 | ext.tests.addSuite("ext-preprocessor-seq-insert") 21 | ext.tests.addTest("test", @test) 22 | end sub 23 | 24 | end namespace 25 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-popback.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/popback.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | 12 | ext_assert_TRUE( "(a)(b)(c)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_POPBACK(SEQ)) ) 13 | 14 | end sub 15 | 16 | private sub register constructor 17 | ext.tests.addSuite("ext-preprocessor-seq-popback") 18 | ext.tests.addTest("test", @test) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-popfront.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/popfront.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | 12 | ext_assert_TRUE( "(b)(c)(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_POPFRONT(SEQ)) ) 13 | 14 | end sub 15 | 16 | private sub register constructor 17 | ext.tests.addSuite("ext-preprocessor-seq-popfront") 18 | ext.tests.addTest("test", @test) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-pushback.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/pushback.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | 12 | ext_assert_TRUE( "(a)(b)(c)(d)(x)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_PUSHBACK(SEQ, x)) ) 13 | 14 | end sub 15 | 16 | private sub register constructor 17 | ext.tests.addSuite("ext-preprocessor-seq-pushback") 18 | ext.tests.addTest("test", @test) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-pushfront.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/pushfront.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | 12 | ext_assert_TRUE( "(x)(a)(b)(c)(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_PUSHFRONT(SEQ, x)) ) 13 | 14 | end sub 15 | 16 | private sub register constructor 17 | ext.tests.addSuite("ext-preprocessor-seq-pushfront") 18 | ext.tests.addTest("test", @test) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-replace.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/replace.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | 12 | ext_assert_TRUE( "(x)(b)(c)(d)" = FBEXT_PP_STRINGIZE(fbextPP_SeqReplace(SEQ, 0, x)) ) 13 | ext_assert_TRUE( "(a)(x)(c)(d)" = FBEXT_PP_STRINGIZE(fbextPP_SeqReplace(SEQ, 1, x)) ) 14 | ext_assert_TRUE( "(a)(b)(x)(d)" = FBEXT_PP_STRINGIZE(fbextPP_SeqReplace(SEQ, 2, x)) ) 15 | ext_assert_TRUE( "(a)(b)(c)(x)" = FBEXT_PP_STRINGIZE(fbextPP_SeqReplace(SEQ, 3, x)) ) 16 | 17 | end sub 18 | 19 | private sub register constructor 20 | ext.tests.addSuite("ext-preprocessor-seq-elem") 21 | ext.tests.addTest("test", @test) 22 | end sub 23 | 24 | end namespace 25 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-restn.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/restn.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | 12 | ext_assert_TRUE( "(a)(b)(c)(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_RESTN(0, SEQ)) ) 13 | ext_assert_TRUE( "(b)(c)(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_RESTN(1, SEQ)) ) 14 | ext_assert_TRUE( "(c)(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_RESTN(2, SEQ)) ) 15 | ext_assert_TRUE( "(d)" = FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_RESTN(3, SEQ)) ) 16 | 17 | end sub 18 | 19 | private sub register constructor 20 | ext.tests.addSuite("ext-preprocessor-seq-restn") 21 | ext.tests.addTest("test", @test) 22 | end sub 23 | 24 | end namespace 25 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-reverse.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/reverse.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ ((a)(b)(c)(d)) 11 | 12 | ext_assert_STRING_EQUAL( "(d)(c)(b)(a)", FBEXT_PP_STRINGIZE(FBEXT_PP_SEQ_REVERSE(SEQ)) ) 13 | 14 | end sub 15 | 16 | private sub register constructor 17 | ext.tests.addSuite("ext-preprocessor-seq-reverse") 18 | ext.tests.addTest("test", @test) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-size.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/size.bi" 4 | 5 | namespace ext.tests.preprocessor 6 | 7 | private sub test 8 | 9 | # define SEQ (a)(b)(c)(d) 10 | 11 | ext_assert_TRUE( 4 = FBEXT_PP_SEQ_SIZE(SEQ) ) 12 | 13 | end sub 14 | 15 | private sub register constructor 16 | ext.tests.addSuite("ext-preprocessor-seq-size") 17 | ext.tests.addTest("test", @test) 18 | end sub 19 | 20 | end namespace 21 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-totuple.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/totuple.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | 12 | ext_assert_TRUE( "(a, b, c, d)" = FBEXT_PP_STRINGIZE( FBEXT_PP_SEQ_TOTUPLE(SEQ)) ) 13 | 14 | end sub 15 | 16 | private sub register constructor 17 | ext.tests.addSuite("ext-preprocessor-seq-totuple") 18 | ext.tests.addTest("test", @test) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/preprocessor/seq-transform.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/seq/transform.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor 7 | 8 | private sub test 9 | 10 | # define SEQ (a)(b)(c)(d) 11 | # define M(data, elem) data##elem 12 | 13 | ext_assert_TRUE( "(xa)(xb)(xc)(xd)" = FBEXT_PP_STRINGIZE( FBEXT_PP_SEQ_TRANSFORM(M, x, SEQ)) ) 14 | 15 | end sub 16 | 17 | private sub register constructor 18 | ext.tests.addSuite("ext-preprocessor-seq-transform") 19 | ext.tests.addTest("test", @test) 20 | end sub 21 | 22 | end namespace 23 | -------------------------------------------------------------------------------- /tests/preprocessor/tuple-eat.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/tuple/eat.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | # include once "ext/preprocessor/cat.bi" 6 | 7 | namespace ext.tests.preprocessor.tuple_.eat 8 | 9 | private sub test1 10 | 11 | # define TUPLE (a) 12 | 13 | ext_assert_TRUE( ":" = FBEXT_PP_STRINGIZE(:FBEXT_PP_CAT(fbextPP_TupleEat(1), TUPLE))) 14 | 15 | end sub 16 | 17 | private sub test2 18 | 19 | # define TUPLE (a, b) 20 | 21 | ext_assert_TRUE( ":" = FBEXT_PP_STRINGIZE(:FBEXT_PP_CAT(fbextPP_TupleEat(2), TUPLE))) 22 | 23 | end sub 24 | 25 | private sub test3 26 | 27 | # define TUPLE (a, b, c) 28 | 29 | ext_assert_TRUE( ":" = FBEXT_PP_STRINGIZE(:FBEXT_PP_CAT(fbextPP_TupleEat(3), TUPLE))) 30 | 31 | end sub 32 | 33 | private sub register constructor 34 | ext.tests.addSuite("ext-preprocessor-tuple-eat") 35 | ext.tests.addTest("test1", @test1) 36 | ext.tests.addTest("test2", @test2) 37 | ext.tests.addTest("test3", @test3) 38 | end sub 39 | 40 | end namespace 41 | -------------------------------------------------------------------------------- /tests/preprocessor/tuple-elem.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/tuple/elem.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.tuple_.elem 7 | 8 | private sub test1 9 | 10 | # define TUPLE (a) 11 | 12 | ext_assert_TRUE( "a" = FBEXT_PP_STRINGIZE(fbextPP_TupleElem(1, 0, TUPLE)) ) 13 | 14 | end sub 15 | 16 | private sub test2 17 | 18 | # define TUPLE (a, b) 19 | 20 | ext_assert_TRUE( "a" = FBEXT_PP_STRINGIZE(fbextPP_TupleElem(2, 0, TUPLE)) ) 21 | ext_assert_TRUE( "b" = FBEXT_PP_STRINGIZE(fbextPP_TupleElem(2, 1, TUPLE)) ) 22 | 23 | end sub 24 | 25 | private sub test3 26 | 27 | # define TUPLE (a, b, c) 28 | 29 | ext_assert_TRUE( "a" = FBEXT_PP_STRINGIZE(fbextPP_TupleElem(3, 0, TUPLE)) ) 30 | ext_assert_TRUE( "b" = FBEXT_PP_STRINGIZE(fbextPP_TupleElem(3, 1, TUPLE)) ) 31 | ext_assert_TRUE( "c" = FBEXT_PP_STRINGIZE(fbextPP_TupleElem(3, 2, TUPLE)) ) 32 | 33 | end sub 34 | 35 | private sub register constructor 36 | ext.tests.addSuite("ext-preprocessor-tuple-elem") 37 | ext.tests.addTest("test1", @test1) 38 | ext.tests.addTest("test2", @test2) 39 | ext.tests.addTest("test3", @test3) 40 | end sub 41 | 42 | end namespace 43 | -------------------------------------------------------------------------------- /tests/preprocessor/tuple-enum.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/tuple/enum.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.tuple_.enum_ 7 | 8 | private sub test1 9 | 10 | # define TUPLE (a) 11 | 12 | ext_assert_TRUE( "(a)" = FBEXT_PP_STRINGIZE((fbextPP_TupleEnum(1, TUPLE))) ) 13 | 14 | end sub 15 | 16 | private sub test2 17 | 18 | # define TUPLE (a, b) 19 | 20 | ext_assert_TRUE( "(a, b)" = FBEXT_PP_STRINGIZE((fbextPP_TupleEnum(2, TUPLE))) ) 21 | 22 | end sub 23 | 24 | private sub test3 25 | 26 | # define TUPLE (a, b, c) 27 | 28 | ext_assert_TRUE( "(a, b, c)" = FBEXT_PP_STRINGIZE((fbextPP_TupleEnum(3, TUPLE))) ) 29 | 30 | end sub 31 | 32 | private sub register constructor 33 | ext.tests.addSuite("ext-preprocessor-tuple-enum") 34 | ext.tests.addTest("test1", @test1) 35 | ext.tests.addTest("test2", @test2) 36 | ext.tests.addTest("test3", @test3) 37 | end sub 38 | 39 | end namespace 40 | -------------------------------------------------------------------------------- /tests/preprocessor/tuple-foreach.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/tuple/foreach.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.tuple_.foreach 7 | 8 | # define M(elem) [elem] 9 | 10 | private sub test1 11 | 12 | # define TUPLE (a) 13 | 14 | ext_assert_TRUE( "[a]" = FBEXT_PP_STRINGIZE(fbextPP_TupleForEach(1, TUPLE, M)) ) 15 | 16 | end sub 17 | 18 | private sub test2 19 | 20 | # define TUPLE (a, b) 21 | 22 | ext_assert_TRUE( "[a] [b]" = FBEXT_PP_STRINGIZE(fbextPP_TupleForEach(2, TUPLE, M)) ) 23 | 24 | end sub 25 | 26 | private sub test3 27 | 28 | # define TUPLE (a, b, c) 29 | 30 | ext_assert_TRUE( "[a] [b] [c]" = FBEXT_PP_STRINGIZE(fbextPP_TupleForEach(3, TUPLE, M)) ) 31 | 32 | end sub 33 | 34 | private sub register constructor 35 | ext.tests.addSuite("ext-preprocessor-tuple-foreach") 36 | ext.tests.addTest("test1", @test1) 37 | ext.tests.addTest("test2", @test2) 38 | ext.tests.addTest("test3", @test3) 39 | end sub 40 | 41 | end namespace 42 | -------------------------------------------------------------------------------- /tests/preprocessor/tuple-foreachi.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/tuple/foreachi.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.tuple_.foreachi 7 | 8 | # define M(n, elem) [elem##n] 9 | 10 | private sub test1 11 | 12 | # define TUPLE (a) 13 | 14 | ext_assert_TRUE( "[a0]" = FBEXT_PP_STRINGIZE(fbextPP_TupleForEachI(1, TUPLE, M)) ) 15 | 16 | end sub 17 | 18 | private sub test2 19 | 20 | # define TUPLE (a, b) 21 | 22 | ext_assert_TRUE( "[a0] [b1]" = FBEXT_PP_STRINGIZE(fbextPP_TupleForEachI(2, TUPLE, M)) ) 23 | 24 | end sub 25 | 26 | private sub test3 27 | 28 | # define TUPLE (a, b, c) 29 | 30 | ext_assert_TRUE( "[a0] [b1] [c2]" = FBEXT_PP_STRINGIZE(fbextPP_TupleForEachI(3, TUPLE, M)) ) 31 | 32 | end sub 33 | 34 | private sub register constructor 35 | ext.tests.addSuite("ext-preprocessor-tuple-foreachi") 36 | ext.tests.addTest("test1", @test1) 37 | ext.tests.addTest("test2", @test2) 38 | ext.tests.addTest("test3", @test3) 39 | end sub 40 | 41 | end namespace 42 | -------------------------------------------------------------------------------- /tests/preprocessor/tuple-fromvalue.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/tuple/fromvalue.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.tuple_.fromvalue 7 | 8 | private sub test 9 | 10 | ext_assert_TRUE( "(x)" = FBEXT_PP_STRINGIZE(fbextPP_TupleFromValue(1, x)) ) 11 | ext_assert_TRUE( "(x,x)" = FBEXT_PP_STRINGIZE(fbextPP_TupleFromValue(2, x)) ) 12 | ext_assert_TRUE( "(x,x,x)" = FBEXT_PP_STRINGIZE(fbextPP_TupleFromValue(3, x)) ) 13 | 14 | end sub 15 | 16 | private sub register constructor 17 | ext.tests.addSuite("ext-preprocessor-tuple-fromvalue") 18 | ext.tests.addTest("test", @test) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/preprocessor/tuple-remove.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/tuple/remove.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.tuple_.remove 7 | 8 | private sub test1 9 | 10 | # define TUPLE (a) 11 | 12 | ext_assert_TRUE( "()" = FBEXT_PP_STRINGIZE(fbextPP_TupleRemove(1, 0, TUPLE)) ) 13 | 14 | end sub 15 | 16 | private sub test2 17 | 18 | # define TUPLE (a, b) 19 | 20 | ext_assert_TRUE( "(b)" = FBEXT_PP_STRINGIZE(fbextPP_TupleRemove(2, 0, TUPLE)) ) 21 | ext_assert_TRUE( "(a)" = FBEXT_PP_STRINGIZE(fbextPP_TupleRemove(2, 1, TUPLE)) ) 22 | 23 | end sub 24 | 25 | private sub test3 26 | 27 | # define TUPLE (a, b, c) 28 | 29 | ext_assert_TRUE( "(b, c)" = FBEXT_PP_STRINGIZE(fbextPP_TupleRemove(3, 0, TUPLE)) ) 30 | ext_assert_TRUE( "(a, c)" = FBEXT_PP_STRINGIZE(fbextPP_TupleRemove(3, 1, TUPLE)) ) 31 | ext_assert_TRUE( "(a, b)" = FBEXT_PP_STRINGIZE(fbextPP_TupleRemove(3, 2, TUPLE)) ) 32 | 33 | end sub 34 | 35 | private sub register constructor 36 | ext.tests.addSuite("ext-preprocessor-tuple-remove") 37 | ext.tests.addTest("test1", @test1) 38 | ext.tests.addTest("test2", @test2) 39 | ext.tests.addTest("test3", @test3) 40 | end sub 41 | 42 | end namespace 43 | -------------------------------------------------------------------------------- /tests/preprocessor/tuple-replace.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/tuple/replace.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.tuple_.replace 7 | 8 | private sub test1 9 | 10 | # define TUPLE (a) 11 | 12 | ext_assert_TRUE( "(x)" = FBEXT_PP_STRINGIZE(fbextPP_TupleReplace(1, 0, TUPLE, x)) ) 13 | 14 | end sub 15 | 16 | private sub test2 17 | 18 | # define TUPLE (a, b) 19 | 20 | ext_assert_TRUE( "(x, b)" = FBEXT_PP_STRINGIZE(fbextPP_TupleReplace(2, 0, TUPLE, x)) ) 21 | ext_assert_TRUE( "(a, x)" = FBEXT_PP_STRINGIZE(fbextPP_TupleReplace(2, 1, TUPLE, x)) ) 22 | 23 | end sub 24 | 25 | private sub test3 26 | 27 | # define TUPLE (a, b, c) 28 | 29 | ext_assert_TRUE( "(x, b, c)" = FBEXT_PP_STRINGIZE(fbextPP_TupleReplace(3, 0, TUPLE, x)) ) 30 | ext_assert_TRUE( "(a, x, c)" = FBEXT_PP_STRINGIZE(fbextPP_TupleReplace(3, 1, TUPLE, x)) ) 31 | ext_assert_TRUE( "(a, b, x)" = FBEXT_PP_STRINGIZE(fbextPP_TupleReplace(3, 2, TUPLE, x)) ) 32 | 33 | end sub 34 | 35 | private sub register constructor 36 | ext.tests.addSuite("ext-preprocessor-tuple-replace") 37 | ext.tests.addTest("test1", @test1) 38 | ext.tests.addTest("test2", @test2) 39 | ext.tests.addTest("test3", @test3) 40 | end sub 41 | 42 | end namespace 43 | -------------------------------------------------------------------------------- /tests/preprocessor/tuple-reverse.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/tuple/reverse.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.tuple_.reverse 7 | 8 | private sub test1 9 | 10 | # define TUPLE (a) 11 | 12 | ext_assert_TRUE( "(a)" = FBEXT_PP_STRINGIZE(fbextPP_TupleReverse(1, TUPLE)) ) 13 | 14 | end sub 15 | 16 | private sub test2 17 | 18 | # define TUPLE (a, b) 19 | 20 | ext_assert_TRUE( "(b, a)" = FBEXT_PP_STRINGIZE(fbextPP_TupleReverse(2, TUPLE)) ) 21 | 22 | end sub 23 | 24 | private sub test3 25 | 26 | # define TUPLE (a, b, c) 27 | 28 | ext_assert_TRUE( "(c, b, a)" = FBEXT_PP_STRINGIZE(fbextPP_TupleReverse(3, TUPLE)) ) 29 | 30 | end sub 31 | 32 | private sub register constructor 33 | ext.tests.addSuite("ext-preprocessor-tuple-reverse") 34 | ext.tests.addTest("test1", @test1) 35 | ext.tests.addTest("test2", @test2) 36 | ext.tests.addTest("test3", @test3) 37 | end sub 38 | 39 | end namespace 40 | -------------------------------------------------------------------------------- /tests/preprocessor/tuple-toseq.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/detail/common.bi" 3 | # include once "ext/preprocessor/tuple/toseq.bi" 4 | # include once "ext/preprocessor/stringize.bi" 5 | 6 | namespace ext.tests.preprocessor.tuple_.toseq 7 | 8 | private sub test1 9 | 10 | # define TUPLE (a) 11 | 12 | ext_assert_TRUE( "(a)" = FBEXT_PP_STRINGIZE(fbextPP_TupleToSeq(1, TUPLE)) ) 13 | 14 | end sub 15 | 16 | private sub test2 17 | 18 | # define TUPLE (a, b) 19 | 20 | ext_assert_TRUE( "(a)(b)" = FBEXT_PP_STRINGIZE(fbextPP_TupleToSeq(2, TUPLE)) ) 21 | 22 | end sub 23 | 24 | private sub test3 25 | 26 | # define TUPLE (a, b, c) 27 | 28 | ext_assert_TRUE( "(a)(b)(c)" = FBEXT_PP_STRINGIZE(fbextPP_TupleToSeq(3, TUPLE)) ) 29 | 30 | end sub 31 | 32 | private sub register constructor 33 | ext.tests.addSuite("ext-preprocessor-tuple-toseq") 34 | ext.tests.addTest("test1", @test1) 35 | ext.tests.addTest("test2", @test2) 36 | ext.tests.addTest("test3", @test3) 37 | end sub 38 | 39 | end namespace 40 | -------------------------------------------------------------------------------- /tests/sort/gnome.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/algorithms/gnomesort.bi" 3 | 4 | namespace ext.tests.algorithms 5 | 6 | private sub test_gnome 7 | 8 | dim as integer testarray1(0 to 9) 9 | 10 | for n as integer = 0 to 9 11 | 12 | testarray1(n) = 10 - n 13 | 14 | next 15 | 16 | ext.GnomeSort( testarray1() ) 17 | 18 | for n as integer = 1 to 10 19 | 20 | ext_assert_TRUE( testarray1(n-1) = n ) 21 | 22 | next 23 | 24 | 25 | end sub 26 | 27 | private sub register constructor 28 | ext.tests.addSuite("ext-algorithms-gnomesort") 29 | ext.tests.addTest("gnome", @test_gnome) 30 | end sub 31 | 32 | end namespace 33 | -------------------------------------------------------------------------------- /tests/sort/qsort.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/algorithms/quicksort.bi" 3 | 4 | namespace ext.tests.algorithms 5 | 6 | 7 | private sub test_quicksort 8 | 9 | dim as integer testarray1(0 to 9) 10 | 11 | for n as integer = 0 to 9 12 | 13 | testarray1(n) = 10 - n 14 | 15 | next 16 | 17 | ext.QuickSort( testarray1() ) 18 | 19 | for n as integer = 1 to 10 20 | 21 | ext_assert_TRUE( testarray1(n-1) = n ) 22 | 23 | next 24 | 25 | 26 | end sub 27 | 28 | private sub register constructor 29 | ext.tests.addSuite("ext-algorithms-quicksort") 30 | ext.tests.addTest("test_quicksort", @test_quicksort) 31 | end sub 32 | 33 | end namespace 34 | -------------------------------------------------------------------------------- /tests/strings/insert.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/strings.bi" 3 | 4 | namespace ext.tests.strings 5 | 6 | private sub test_insertinto 7 | 8 | ext_assert_TRUE("Ext insert rocks!" = ext.strings.InsertInto(" insert", "Ext rocks!", 3)) 9 | ext_assert_TRUE("You can even prepend strings!" = ext.strings.InsertInto("You can", " even prepend strings!", 0)) 10 | ext_assert_TRUE("Or even append them!" = ext.strings.InsertInto(" append them!", "Or even", 6)) 11 | ext_assert_TRUE("You can even use negative indexing!" = ext.strings.InsertInto(" negative", "You can even use indexing!", -10)) 12 | ext_assert_TRUE("Negative index can't go below zero when added to the string length" = ext.strings.InsertInto("Negative ", "index can't go below zero when added to the string length", -160)) 13 | 14 | end sub 15 | 16 | private sub register constructor 17 | ext.tests.addSuite("ext-strings-insertinto") 18 | ext.tests.addTest("InsertInto", @test_insertinto) 19 | end sub 20 | 21 | end namespace 22 | -------------------------------------------------------------------------------- /tests/strings/join.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/strings.bi" 3 | 4 | namespace ext.tests.strings 5 | 6 | private function test_result (byref a as string, byref b as string, byref c as string, byref glue as string, byref result as string) as ext.bool 7 | 8 | static array(2) as string 9 | 10 | array(0) = a 11 | array(1) = b 12 | array(2) = c 13 | 14 | return result = ext.strings.join(array(), glue) 15 | 16 | end function 17 | 18 | private sub test_join 19 | 20 | ' a b c glue res 21 | ext_assert_TRUE(test_result( "", "", "", "", "" )) 22 | ext_assert_TRUE(test_result( "a", "", "", "", "a" )) 23 | ext_assert_TRUE(test_result( "", "b", "", "", "b" )) 24 | ext_assert_TRUE(test_result( "", "", "c", "", "c" )) 25 | ext_assert_TRUE(test_result( "", "", "", " ", " " )) 26 | ext_assert_TRUE(test_result( "a", "b", "c", " ", "a b c" )) 27 | 28 | end sub 29 | 30 | private sub register constructor 31 | ext.tests.addSuite("ext-strings-join") 32 | ext.tests.addTest("join", @test_join) 33 | end sub 34 | 35 | end namespace 36 | -------------------------------------------------------------------------------- /tests/strings/repeat.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/strings.bi" 3 | 4 | namespace ext.tests.strings 5 | 6 | private sub test_string_repeat 7 | 8 | var res = "" 9 | 10 | res = ext.strings.repeat("abc", 0) 11 | ext_assert_STRING_EQUAL("", res) 12 | 13 | res = ext.strings.repeat("", 0) 14 | ext_assert_STRING_EQUAL("", res) 15 | 16 | res = ext.strings.repeat("", 3) 17 | ext_assert_STRING_EQUAL("", res) 18 | 19 | res = ext.strings.repeat("abc", 3) 20 | ext_assert_STRING_EQUAL("abcabcabc", res) 21 | 22 | end sub 23 | 24 | private sub test_char_repeat 25 | 26 | var res = "" 27 | 28 | res = ext.strings.repeat(asc("a"), 0) 29 | ext_assert_STRING_EQUAL("", res) 30 | 31 | res = ext.strings.repeat(asc("a"), 3) 32 | ext_assert_STRING_EQUAL("aaa", res) 33 | 34 | end sub 35 | 36 | private sub register constructor 37 | ext.tests.addSuite("ext-strings-repeat") 38 | ext.tests.addTest("string-repeat", @test_string_repeat) 39 | ext.tests.addTest("char-repeat", @test_char_repeat) 40 | end sub 41 | 42 | end namespace 43 | -------------------------------------------------------------------------------- /tests/strings/replace_copy.bas: -------------------------------------------------------------------------------- 1 | # include once "ext/tests.bi" 2 | # include once "ext/strings.bi" 3 | 4 | namespace ext.tests.strings 5 | 6 | private sub test_string_replacecopy 7 | 8 | var res = "" 9 | 10 | res = ext.strings.replacecopy("a", "a", "x") 11 | ext_assert_STRING_EQUAL("x", res) 12 | 13 | res = ext.strings.replacecopy("ab", "ab", "x") 14 | ext_assert_STRING_EQUAL("x", res) 15 | 16 | res = ext.strings.replacecopy("abab", "ab", "x") 17 | ext_assert_STRING_EQUAL("xx", res) 18 | 19 | res = ext.strings.replacecopy("abab", "abab", "x") 20 | ext_assert_STRING_EQUAL("x", res) 21 | 22 | res = ext.strings.replacecopy("ababab", "abab", "x") 23 | ext_assert_STRING_EQUAL("xab", res) 24 | 25 | end sub 26 | 27 | private sub register constructor 28 | ext.tests.addSuite("ext-strings-replacecopy") 29 | ext.tests.addTest("string-replacecopy", @test_string_replacecopy) 30 | end sub 31 | 32 | end namespace 33 | --------------------------------------------------------------------------------