Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit acfc252

Browse files
515 Support (tgstation#121)
1 parent 42fc793 commit acfc252

File tree

20 files changed

+61
-54
lines changed

20 files changed

+61
-54
lines changed

dmsrc/acreplace.dm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* * patterns - A non-associative list of strings to search for
99
* * replacements - Default replacements for this automaton, used with rustg_acreplace
1010
*/
11-
#define rustg_setup_acreplace(key, patterns, replacements) call(RUST_G, "setup_acreplace")(key, json_encode(patterns), json_encode(replacements))
11+
#define rustg_setup_acreplace(key, patterns, replacements) RUSTG_CALL(RUST_G, "setup_acreplace")(key, json_encode(patterns), json_encode(replacements))
1212

1313
/**
1414
* Sets up the Aho-Corasick automaton using supplied options.
@@ -20,7 +20,7 @@
2020
* * patterns - A non-associative list of strings to search for
2121
* * replacements - Default replacements for this automaton, used with rustg_acreplace
2222
*/
23-
#define rustg_setup_acreplace_with_options(key, options, patterns, replacements) call(RUST_G, "setup_acreplace")(key, json_encode(options), json_encode(patterns), json_encode(replacements))
23+
#define rustg_setup_acreplace_with_options(key, options, patterns, replacements) RUSTG_CALL(RUST_G, "setup_acreplace")(key, json_encode(options), json_encode(patterns), json_encode(replacements))
2424

2525
/**
2626
* Run the specified replacement engine with the provided haystack text to replace, returning replaced text.
@@ -29,7 +29,7 @@
2929
* * key - The key for the automaton
3030
* * text - Text to run replacements on
3131
*/
32-
#define rustg_acreplace(key, text) call(RUST_G, "acreplace")(key, text)
32+
#define rustg_acreplace(key, text) RUSTG_CALL(RUST_G, "acreplace")(key, text)
3333

3434
/**
3535
* Run the specified replacement engine with the provided haystack text to replace, returning replaced text.
@@ -39,4 +39,4 @@
3939
* * text - Text to run replacements on
4040
* * replacements - Replacements for this call. Must be the same length as the set-up patterns
4141
*/
42-
#define rustg_acreplace_with_replacements(key, text, replacements) call(RUST_G, "acreplace_with_replacements")(key, text, json_encode(replacements))
42+
#define rustg_acreplace_with_replacements(key, text, replacements) RUSTG_CALL(RUST_G, "acreplace_with_replacements")(key, text, json_encode(replacements))

dmsrc/cellularnoise.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
* * height: The height of the grid.
1313
*/
1414
#define rustg_cnoise_generate(percentage, smoothing_iterations, birth_limit, death_limit, width, height) \
15-
call(RUST_G, "cnoise_generate")(percentage, smoothing_iterations, birth_limit, death_limit, width, height)
15+
RUSTG_CALL(RUST_G, "cnoise_generate")(percentage, smoothing_iterations, birth_limit, death_limit, width, height)

dmsrc/dbpnoise.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
* * upper_range: upper bound of values selected for. (exclusive)
1313
*/
1414
#define rustg_dbp_generate(seed, accuracy, stamp_size, world_size, lower_range, upper_range) \
15-
call(RUST_G, "dbp_generate")(seed, accuracy, stamp_size, world_size, lower_range, upper_range)
15+
RUSTG_CALL(RUST_G, "dbp_generate")(seed, accuracy, stamp_size, world_size, lower_range, upper_range)
1616

dmsrc/dmi.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#define rustg_dmi_strip_metadata(fname) call(RUST_G, "dmi_strip_metadata")(fname)
2-
#define rustg_dmi_create_png(path, width, height, data) call(RUST_G, "dmi_create_png")(path, width, height, data)
3-
#define rustg_dmi_resize_png(path, width, height, resizetype) call(RUST_G, "dmi_resize_png")(path, width, height, resizetype)
1+
#define rustg_dmi_strip_metadata(fname) RUSTG_CALL(RUST_G, "dmi_strip_metadata")(fname)
2+
#define rustg_dmi_create_png(path, width, height, data) RUSTG_CALL(RUST_G, "dmi_create_png")(path, width, height, data)
3+
#define rustg_dmi_resize_png(path, width, height, resizetype) RUSTG_CALL(RUST_G, "dmi_resize_png")(path, width, height, resizetype)

dmsrc/file.dm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#define rustg_file_read(fname) call(RUST_G, "file_read")(fname)
2-
#define rustg_file_exists(fname) call(RUST_G, "file_exists")(fname)
3-
#define rustg_file_write(text, fname) call(RUST_G, "file_write")(text, fname)
4-
#define rustg_file_append(text, fname) call(RUST_G, "file_append")(text, fname)
5-
#define rustg_file_get_line_count(fname) text2num(call(RUST_G, "file_get_line_count")(fname))
6-
#define rustg_file_seek_line(fname, line) call(RUST_G, "file_seek_line")(fname, "[line]")
1+
#define rustg_file_read(fname) RUSTG_CALL(RUST_G, "file_read")(fname)
2+
#define rustg_file_exists(fname) RUSTG_CALL(RUST_G, "file_exists")(fname)
3+
#define rustg_file_write(text, fname) RUSTG_CALL(RUST_G, "file_write")(text, fname)
4+
#define rustg_file_append(text, fname) RUSTG_CALL(RUST_G, "file_append")(text, fname)
5+
#define rustg_file_get_line_count(fname) text2num(RUSTG_CALL(RUST_G, "file_get_line_count")(fname))
6+
#define rustg_file_seek_line(fname, line) RUSTG_CALL(RUST_G, "file_seek_line")(fname, "[line]")
77

88
#ifdef RUSTG_OVERRIDE_BUILTINS
99
#define file2text(fname) rustg_file_read("[fname]")

dmsrc/git.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#define rustg_git_revparse(rev) call(RUST_G, "rg_git_revparse")(rev)
2-
#define rustg_git_commit_date(rev) call(RUST_G, "rg_git_commit_date")(rev)
1+
#define rustg_git_revparse(rev) RUSTG_CALL(RUST_G, "rg_git_revparse")(rev)
2+
#define rustg_git_commit_date(rev) RUSTG_CALL(RUST_G, "rg_git_commit_date")(rev)

dmsrc/hash.dm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#define rustg_hash_string(algorithm, text) call(RUST_G, "hash_string")(algorithm, text)
2-
#define rustg_hash_file(algorithm, fname) call(RUST_G, "hash_file")(algorithm, fname)
3-
#define rustg_hash_generate_totp(seed) call(RUST_G, "generate_totp")(seed)
4-
#define rustg_hash_generate_totp_tolerance(seed, tolerance) call(RUST_G, "generate_totp_tolerance")(seed, tolerance)
1+
#define rustg_hash_string(algorithm, text) RUSTG_CALL(RUST_G, "hash_string")(algorithm, text)
2+
#define rustg_hash_file(algorithm, fname) RUSTG_CALL(RUST_G, "hash_file")(algorithm, fname)
3+
#define rustg_hash_generate_totp(seed) RUSTG_CALL(RUST_G, "generate_totp")(seed)
4+
#define rustg_hash_generate_totp_tolerance(seed, tolerance) RUSTG_CALL(RUST_G, "generate_totp_tolerance")(seed, tolerance)
55

66
#define RUSTG_HASH_MD5 "md5"
77
#define RUSTG_HASH_SHA1 "sha1"

dmsrc/http.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
#define RUSTG_HTTP_METHOD_PATCH "patch"
55
#define RUSTG_HTTP_METHOD_HEAD "head"
66
#define RUSTG_HTTP_METHOD_POST "post"
7-
#define rustg_http_request_blocking(method, url, body, headers, options) call(RUST_G, "http_request_blocking")(method, url, body, headers, options)
8-
#define rustg_http_request_async(method, url, body, headers, options) call(RUST_G, "http_request_async")(method, url, body, headers, options)
9-
#define rustg_http_check_request(req_id) call(RUST_G, "http_check_request")(req_id)
7+
#define rustg_http_request_blocking(method, url, body, headers, options) RUSTG_CALL(RUST_G, "http_request_blocking")(method, url, body, headers, options)
8+
#define rustg_http_request_async(method, url, body, headers, options) RUSTG_CALL(RUST_G, "http_request_async")(method, url, body, headers, options)
9+
#define rustg_http_check_request(req_id) RUSTG_CALL(RUST_G, "http_check_request")(req_id)

dmsrc/json.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define rustg_json_is_valid(text) (call(RUST_G, "json_is_valid")(text) == "true")
1+
#define rustg_json_is_valid(text) (RUSTG_CALL(RUST_G, "json_is_valid")(text) == "true")

dmsrc/log.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#define rustg_log_write(fname, text, format) call(RUST_G, "log_write")(fname, text, format)
2-
/proc/rustg_log_close_all() return call(RUST_G, "log_close_all")()
1+
#define rustg_log_write(fname, text, format) RUSTG_CALL(RUST_G, "log_write")(fname, text, format)
2+
/proc/rustg_log_close_all() return RUSTG_CALL(RUST_G, "log_close_all")()

0 commit comments

Comments
 (0)