`c/frontend/tokenizer`:
add proper "Example:" header to demo example code,
removed empty lines.
`container/bit_array`:
moved comment before package;
aligned narrative lines to left margin;
converted case lines into bulleted lines ("- ");
converted individual examples to single-tab-indented preformatted text.
`dynlib`:
removed "//+build ignore" line;
added newline at EOF.
`image/netpmb`:
converted indented lines of "Reading", "Wrting" and "Some syntax..." into bulleted lists;
"Formats" indented lines kept as they are as the preformatted text seems relevant to keep the alignments;
doubly indented lines kept as single-indented to keep them different (as the format does not allow for two-level bulleted lists);
removed empy lines.
`os/os2`: WIP, not modified
`sys/info`:
removed "//+build ignore" line;
converted tab-indented initial description into regular left-margin comment;
moved uncommented sample code within the doc comment as an "Example:";
moved simple- and double-tabbed separate comments with sample Windows and macOS outputs within the doc comment as bulleted headlines with preformatted output listings;
removed now empty comments and blank lines after the package line.
`text/i18n`:
removed "//+build ignore" line;
moved the pacakge line at the end;
de-indented the tab-indented introductory narrative;
moved sample code comments into the doc comment as tab-indented code with a proper "Example:" heading;
removed "```" MD attempts at code formatting.
`text/table`:
unindented the comment lines of a descriptive kind;
headlines of major subdivisions are marked as bold;
kept code samples as tab-indented preformatted text (as there are several of them, the standard "Example:" and "Output:" headings cannot be used) removing the "```" MD attempts at code formatting;
removed in-between blank lines.
```
package example
import "core:dynlib"
import "core:fmt"
Symbols :: struct {
// `foo_` is prefixed, so we look for the symbol `foo_add`.
add: proc "c" (int, int) -> int,
// We use the tag here to override the symbol to look for, namely `bar_sub`.
sub: proc "c" (int, int) -> int `dynlib:"bar_sub"`,
// Exported global (if exporting an i32, the type must be ^i32 because the symbol is a pointer to the export.)
// If it's not a pointer or procedure type, we'll skip the struct field.
hellope: ^i32,
// Handle to free library.
// We can have more than one of these so we can match symbols for more than one DLL with one struct.
_my_lib_handle: dynlib.Library,
}
main :: proc() {
sym: Symbols
// Load symbols from `lib.dll` into Symbols struct.
// Each struct field is prefixed with `foo_` before lookup in the DLL's symbol table.
// The library's Handle (to unload) will be stored in `sym._my_lib_handle`. This way you can load multiple DLLs in one struct.
count := dynlib.initialize_symbols(&sym, "lib.dll", "foo_", "_my_lib_handle")
defer dynlib.unload_library(sym._my_lib_handle)
fmt.printf("%v symbols loaded from lib.dll (%p).\n", count, sym._my_lib_handle)
if count > 0 {
fmt.println("42 + 42 =", sym.add(42, 42))
fmt.println("84 - 13 =", sym.sub(84, 13))
fmt.println("hellope =", sym.hellope^)
}
}
```