• allegro5.a5_display
  • allegro5.a5_file
  • allegro5.a5_font
  • allegro5.a5_image
  • allegro5.a5_joystick
  • allegro5.a5_main
  • allegro5.a5_misc
  • allegro5.a5_opengl
  • allegro5.a5_shader
  • allegro5.a5_sound
  • allegro5.a5_thread
  • allegro5.a5_triangles
  • animation
  • array
  • atlas
  • buffer
  • color
  • common
  • csg.csg_aabb
  • csg.csg
  • csg.csg_octree
  • csg.csg_shapes
  • csg.csg_test
  • data
  • display
  • exception
  • file
  • font
  • glsl
  • grid
  • hash
  • image
  • image_op
  • index
  • ini
  • isometric
  • joystick
  • keyboard
  • land
  • layer
  • list
  • log
  • main
  • map
  • mem
  • mouse
  • net
  • noise
  • openglutil
  • perlin
  • pixelmask
  • plasma
  • pool
  • protobuf
  • queue
  • random
  • runner
  • shader
  • sound
  • sprite
  • thread
  • tilegrid
  • triangles
  • util2d
  • util3d
  • util
  • view
  • voronoi
  • widget.base
  • widget.board
  • widget.book
  • widget.box
  • widget.button
  • widget.checkbox
  • widget.container
  • widget.edit
  • widget.gul
  • widget.hbox
  • widget.layout
  • widget
  • widget.menu
  • widget.mover
  • widget.panel
  • widget.scrollbar
  • widget.scrolling
  • widget.sizer
  • widget.slider
  • widget.spin
  • widget.text
  • widget.theme
  • widget.vbox
  • widget.widget_list
  • yaml.external
  • yaml.internal
  • yaml
  • yaml.xml

land.util

char

land_read_text

Parameters: char const * filename

Returns: char*

land_utf8_char

Parameters: char * (* pos)

Returns: int

Return the unicode value at the given pointer position, and advance the pointer to the start of the next code point.

land_utf8_char_back

Parameters: char * (* pos)

Returns: int

Adjust the pointer back to the previous code point and return its value.

land_utf8_char_const

Parameters: char const * (* pos)

Returns: int

land_utf8_encode

Parameters: int c, char * s

Returns: int

land_utf8_realloc_insert

Parameters: char * s, int pos, int c

Returns: char*

(abc, 3, d) -> abcd

land_utf8_realloc_remove

Parameters: char * s, int pos

Returns: char*

(abc, 1) -> ac

land_utf8_count

Parameters: char const * s

Returns: int

land_utf8_copy

Parameters: char * target, int size, char const * source

land_fnmatch

Parameters: char const * pattern, char const * name

Returns: bool

land_string_copy

Parameters: char * target, char const * source, int size

Returns: char*

size is the size of target in bytes (including the terminating 0)

Returns target.

land_equals

Parameters: char const * s, char const * s2

Returns: bool

land_ends_with

Parameters: char const * s, char const * end

Returns: bool

land_starts_with

Parameters: char const * s, char const * start

Returns: bool

land_concatenate

Parameters: char * (* s), char const * cat

land_appendv

Parameters: char * (* s), str format, va_list args

land_append

Parameters: char * (* s), str format, …

land_concatenate_with_separator

Parameters: char * (* s), char const * cat, char const * sep

land_prepend

Parameters: char * (* s), char const * pre

land_replace

Parameters: char * (* s), int off, char const * wat, char const * wit

Returns: int

Given a pointer to a string, replaces the string with a new string and deletes the original one. The new string will have the first occurence of “wat” replaced with “wit”, starting at byte offset off.

land_contains

Parameters: str hay, str needle

Returns: bool

land_find

Parameters: str hay, str needle

Returns: int

land_find_from_back

Parameters: str hay, str needle

Returns: int

land_count

Parameters: str hay, str needle

Returns: int

land_replace_all

Parameters: char * (* s), char const * wat, char const * wit

Returns: int

Like land_replace but replaces all occurences. Returns the number of replacements performed.

land_lowercase_copy

Parameters: str s

Returns: char*

land_shorten

Parameters: char * (* s), int start, int end

Shorten a string so it starts at stat and ends before end.

land_shorten("abcd", 1, 3) -> "bc"
land_shorten("abcd", 1, -1) -> "bc"

land_cut

Parameters: char * (* s), int start, int end

Cut the given sequence from start to before end out of the string.

land_substring

Parameters: char const * s, int a, int b

Returns: char*

land_strip

Parameters: char * (* s)

land_filelist

Parameters: char const * dir, int(* filter)(char const , bool is_dir, void data), int flags, void * data

Returns: LandArray*

Returns an array of files in the given directory. Before a file is added, the filter function is called, with the name about to be added and an indication whether it is a filename or a directory.

If flags is LAND_FULL_PATH files are returned as a full path, if
LAND_RELATIVE_PATH relative to dir, otherwise as
only the filename.

The return value of the filter decides what is done with the name:
0 - Discard it.
1 - Append it to the returned list.
2 - If it is a directory, recurse into it.
3 - Like 1 and 2 combined.

land_split_path_name_ext

Parameters: char const * filename

Returns: LandArray*

Returns a LandArray with three elements, for example:

data/blah/tree.png -> ["data/blah", "tree", "png"]
test.txt -> [None, "test", "txt"]
/etc/passwd -> ["/etc", "passwd", None]

The return value can most conveniently be freed like this:

a = land_split_path_name_ext(filename)
...
land_array_destroy_with_strings(a)

land_split

Parameters: char const * text, str c

Returns: LandArray*

Returns an array of strings which you should destroy with

land_array_destroy_with_strings

land_split_two

Parameters: str text, str sep, char * (* a), char * (* b)

Returns: bool

land_split_lines

Parameters: char const * text

Returns: LandArray*

land_null_or_empty

Parameters: str text

Returns: bool


Generated: Thu 27 Feb 2020 10:49:37 PM EST