string_find renamed to string_pos + header update

- Renamed get_clamped to math_clamp for consistency (libs should use namespace prefixes)
- Nuked above/below macros and renamed unsigned_comp to insigned_int_compare, because it doesn't work with floats
- Replaced sprintf2 and string_pos with macros (due to new metarules)
- Add a few entries to functions.yml
This commit is contained in:
phobos2077
2023-07-04 21:06:35 +02:00
parent 74ef65335d
commit 664fb84dc5
7 changed files with 33 additions and 76 deletions
+19 -3
View File
@@ -599,7 +599,7 @@
opcode: 0x8212
- name: Math
parent: Variables
parent: Utility
items:
- name: log
detail: float log(float x)
@@ -1068,7 +1068,7 @@
`fixedParam`: the value that is passed to the `timed_event_p_proc` procedure for the `fixed_param` function
macro: sfall.h
- name: Variables
- name: Utility
items:
- name: sprintf
detail: string sprintf(string format, any value)
@@ -1088,7 +1088,7 @@
opcode: 0x8238
- name: Strings
parent: Variables
parent: Utility
items:
- name: string_split
detail: array string_split(string text, split)
@@ -1116,12 +1116,28 @@
(DEPRECATED) Returns a pointer to a string variable or to a text
- __NOTE:__ this function is intended for use only in `HOOK_DESCRIPTIONOBJ`. Starting from sfall 4.4/3.8.40, you can return normal strings directly in the hook without calling the function
macro: sfall.h
- name: string_pos
detail: string string_pos(string haystack, string needle)
doc: Returns position of a first occurance of a needle string in a haystack string, or -1 if not found.
macro: sfall.h
- name: string_pos_from
detail: string string_pos_from(string haystack, string needle, int pos)
doc: Returns position of a first occurance of a needle string in a haystack string (starting from a given 0-based position), or -1 if not found.
macro: sfall.h
- name: string_format
detail: string string_format(string format, any val1, any val2, ...)
doc: |
Formats given values using standard syntax of C `printf` function (google "printf" for format details). However, it is limited to formatting up to 7 values.
- The format string is limited to 1024 characters
macro: sfall.h
- name: string_format_array
detail: string string_format_array(string format, int array)
doc: The same as string_format, but accepts an array of parameters.
macro: lib.strings.h
- name: string_replace
detail: string string_replace(string str, string search, string replace)
doc: Replaces all occurances of a given search string in a string with a given replacement string.
macro: lib.strings.h
- name: string_to_case
detail: string sfall_func2("string_to_case", string text, int toCase)
doc: |