forked from ldmud/ldmud
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '368preparations' into unitopia
- Loading branch information
Showing
76 changed files
with
4,504 additions
and
1,094 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
SYNOPSIS | ||
int coroutinep(mixed arg) | ||
|
||
DESCRIPTION | ||
Returns 1 if the argument is a coroutine. | ||
|
||
HISTORY | ||
Introduced in LDMud 3.6.5. | ||
|
||
SEE ALSO | ||
bytesp(E), clonep(E), closurep(E), floatp(E), intp(E), lpctypep(E), | ||
lwobjectp(E), mappingp(E), objectp(E), pointerp(E), referencep(E), | ||
stringp(E), structp(E), symbolp(E) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
SYNOPSIS | ||
int lpctypep(mixed arg) | ||
|
||
DESCRIPTION | ||
Returns 1 if the argument is an LPC type. | ||
|
||
HISTORY | ||
Introduced in LDMud 3.6.7. | ||
|
||
SEE ALSO | ||
bytesp(E), clonep(E), closurep(E), coroutinep(E), floatp(E), intp(E), | ||
lwobjectp(E), mappingp(E), objectp(E), pointerp(E), referencep(E), | ||
stringp(E), structp(E), symbolp(E) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
SYNOPSIS | ||
mixed to_type(mixed value, lpctype type) | ||
mixed to_type(mixed value, lpctype type, struct to_type_options options) | ||
|
||
DESCRIPTION | ||
Converts <value> to <type>. This efun will apply any type conversions | ||
recursively to make <value> conform to <type>. The following | ||
conversions are available: | ||
|
||
source type target types | ||
------------- ---------------------------------------- | ||
array (int) string, bytes | ||
array (mixed) quoted array, struct, mapping | ||
bytes string, int* | ||
closure object, lwobject, int, string | ||
coroutine string | ||
int float, string | ||
float int, string | ||
lpctype lpctype*, mapping, string | ||
lwobject string | ||
mapping struct, mixed* | ||
object string | ||
quoted array mixed* | ||
string symbol, int, float, lpctype, object, bytes, int* | ||
struct struct, mapping, mixed*, string | ||
symbol string, int* | ||
|
||
If multiple conversions are possible (e.g. to_type("10", <int|int*>) | ||
the conversion will be selected in order as given in the table above. | ||
If multiple array or struct types are given, the order is undefined. | ||
Conversions, where elements (e.g. from an array, mapping or struct) | ||
need to be discarded, are not considered. | ||
|
||
Optionally the function accepts a struct with additional options. | ||
All entries in this struct are optional. These are the members: | ||
|
||
source_encoding: | ||
The encoding (given as string) for conversion from bytes to | ||
string. If not given, such a conversion will not be performed. | ||
|
||
target_encoding: | ||
The encoding (given as string) for conversion from string to | ||
bytes. If not given, such a conversion will not be performed. | ||
|
||
keep_zero: | ||
If set (integer != 0) a zero will not be converted. If unset, | ||
a zero will be converted to string or float if requested, | ||
for all other types it will stay zero. | ||
|
||
EXAMPLES | ||
to_type(({ "10", "20" }), [int*]) -> ({ 10, 20 }) | ||
|
||
HISTORY | ||
Introduced in LDMud 3.6.8. | ||
|
||
SEE ALSO | ||
to_array(E), to_bytes(E), to_float(E), to_int(E), to_lpctype(E), | ||
to_object(E), to_string(E), to_struct(E), to_text(E) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ DEFINITION | |
int compile_expression; | ||
int compile_block; | ||
int as_async; | ||
|
||
int detect_end; | ||
}; | ||
|
||
DESCRIPTION | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
NAME | ||
to_type_options | ||
|
||
DEFINITION | ||
struct to_type_options | ||
{ | ||
string source_encoding; | ||
string target_encoding; | ||
|
||
int keep_zero; | ||
}; | ||
|
||
DESCRIPTION | ||
This struct is used for passing options to the to_type() efun. | ||
|
||
SEE ALSO | ||
to_type(E) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* This sefun is to provide a replacement for the efun allocate_mapping(). | ||
* Feel free to add it to your mudlibs, if you have much code relying on that. | ||
*/ | ||
#if ! __EFUN_DEFINED__(allocate_mapping) | ||
|
||
mapping allocate_mapping(int size, int width = 1) | ||
{ | ||
return m_allocate(size, width); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* This sefun is to provide a replacement for the efun copy_mapping(). | ||
* Feel free to add it to your mudlibs, if you have much code relying on that. | ||
*/ | ||
|
||
#if ! __EFUN_DEFINED__(copy_mapping) | ||
|
||
mapping copy_mapping(mapping m) | ||
{ | ||
return copy(m); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* This sefun is to provide a replacement for the efun extract(). | ||
* Feel free to add it to your mudlibs, if you have much code relying on that. | ||
*/ | ||
|
||
#if ! __EFUN_DEFINED__(extract) | ||
|
||
string extract(string str, int from, int to = -1) | ||
{ | ||
return str[>from..>to]; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* This sefun is to provide a replacement for the efun file_name(). | ||
* Feel free to add it to your mudlibs, if you have much code relying on that. | ||
*/ | ||
|
||
#if ! __EFUN_DEFINED__(file_name) | ||
|
||
string file_name(object ob = previous_object()) | ||
{ | ||
return object_name(ob); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* This sefun is to provide a replacement for the efun filter_array(). | ||
* Feel free to add it to your mudlibs, if you have much code relying on that. | ||
*/ | ||
|
||
#if ! __EFUN_DEFINED__(filter_array) | ||
|
||
mixed* filter_array(mixed *arr, string|closure|mapping f, varargs mixed* args) | ||
{ | ||
if (efun::extern_call()) | ||
efun::set_this_object(efun::previous_object()); | ||
|
||
return filter(arr, f, args...); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* This sefun is to provide a replacement for the efun filter_mapping(). | ||
* Feel free to add it to your mudlibs, if you have much code relying on that. | ||
*/ | ||
|
||
#if ! __EFUN_DEFINED__(filter_mapping) | ||
|
||
mapping filter_mapping(mapping m, string|closure|mapping f, varargs mixed* args) | ||
{ | ||
if (efun::extern_call()) | ||
efun::set_this_object(efun::previous_object()); | ||
|
||
return filter_indices(m, f, args...); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* This sefun is to provide a replacement for the efun map_array(). | ||
* Feel free to add it to your mudlibs, if you have much code relying on that. | ||
*/ | ||
|
||
#if ! __EFUN_DEFINED__(map_array) | ||
|
||
mixed* map_array(mixed *arr, string|closure|mapping f, varargs mixed* args) | ||
{ | ||
if (efun::extern_call()) | ||
efun::set_this_object(efun::previous_object()); | ||
|
||
return map(arr, f, args...); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* This sefun is to provide a replacement for the efun map_mapping(). | ||
* Feel free to add it to your mudlibs, if you have much code relying on that. | ||
*/ | ||
|
||
#if ! __EFUN_DEFINED__(map_mapping) | ||
|
||
mapping map_mapping(mapping m, string|closure|mapping f, varargs mixed* args) | ||
{ | ||
if (efun::extern_call()) | ||
efun::set_this_object(efun::previous_object()); | ||
|
||
return map_indices(m, f, args...); | ||
} | ||
|
||
#endif |
Oops, something went wrong.