Commit graph

1484 commits

Author SHA1 Message Date
Daniel McCarney
e1cbe80494 util/indent: convert K&R xmalloc/xrealloc/chfont defs
Use traditional ANSI C function arguments. Additionally, correct the
type of the xrealloc ptr.
2026-02-15 17:10:27 +01:00
Daniel McCarney
2238b12fd2 util/xerq: add missing sig_child() int argument
Avoiding function declarations without parameters or explicit `void` arg
is required for building with modern language versions.
2026-02-15 17:10:27 +01:00
Daniel McCarney
427aa2e435 util/indent: add missing xmalloc/xrealloc/chfont args
Avoiding function declarations without parameters or explicit `void` arg
is required for building with modern language versions.
2026-02-15 17:10:27 +01:00
Daniel McCarney
0e231d223a util/xerq: prototype sig_child arg unconditionally
Remove the AIX-specific gating of the `sig_child()` definition that
takes an `int sig` arg. All modern platforms will use this parameter.
2026-02-15 17:10:27 +01:00
Daniel McCarney
fd6236047f util/indent: use stdlib.h getenv prototype
There's no need for an explicit prototype since stdlib.h is included via
indent_globs.h. Further, the explicit prototype was using an empty
parameter list missing the `name` argument that's present in the
stdlib.h prototype.
2026-02-15 17:10:27 +01:00
Stephan Weinberger
bc9bd31eca Update driver_info
fix typo
fix order of runtime_limits result
2026-02-15 17:03:26 +01:00
Aloy
fb82e4e568 update tamedhon settings 2026-02-15 17:02:06 +01:00
Aloy
fc87ac6772
Updated and sorted Tamedhon settings
Also added settings to README.
2025-08-23 12:37:02 +02:00
Aloy
539c6aa6a8 Anpassung Tamedhon settings 2025-08-01 21:01:50 +02:00
Zesstra
b152e3aebb Updates Morgengrauen settings
Structured the settings similar to Unitopia.
Enables enable_keyword_in, POSIX timers, use of c-ares and python package.
2025-07-09 21:02:33 +02:00
Alexander Motzkau
fe44895c05 Update build files for release of LDMud 3.6.8 2025-07-07 22:21:24 +02:00
Alexander Motzkau
831aaf0c05 Add iterators to variables and functions types
Allow iterating over function list, local and global variables. The
iterators will give the list of functions/variables in program order.
2025-07-07 22:14:05 +02:00
Alexander Motzkau
d0904f9913 Added str() operator to Python representation of LPC types
str(lpctype) returns the LPC code of the LPC type.
2025-07-07 22:14:05 +02:00
Alexander Motzkau
25ab0f48bc Added separate Python types for various closure types
Added LfunClosure, (Simul)EfunClosure, (Unbound/Bound)LambdaClosure and
OperatorClosure types for Python.
2025-07-07 22:14:05 +02:00
Alexander Motzkau
f7c95ae898 Add program_name member function to ldmud.Object object
To streamline Python representations for normal and lightweight objects
also add a program_name member function to normal objects.
2025-07-07 22:14:05 +02:00
Alexander Motzkau
1895ab4790 Make struct members iterable in Python
Add len and [] implementation to Python struct member list,
so they can be iterated over in definition order.
2025-07-07 22:14:05 +02:00
Alexander Motzkau
2c173d9322 Make Python representations of LPC values hashable
Add hash and eq function to all Python implementations,
so all LPC values can be used in Python dictionaries as keys.
2025-07-07 22:14:05 +02:00
Alexander Motzkau
8b3031d3b4 With pragma save_local_names save debugging info for local variables
Previously pragma save_local_names was only used to store information of
variables of coroutines to be inspected by Python code. Extend this to
all local variables.
2025-07-07 22:14:05 +02:00
Alexander Motzkau
eade730e47 Publish standard and Python registered structs
Standard struct definition where not usable in dynamic settings
(e.g. to_type()), as the definition was not registered to the corresponding
struct name and type.
2025-07-07 22:14:05 +02:00
Alexander Motzkau
15166819ed Implement Python-registered structs
Python can register global struct definitions via ldmud.register_struct().
Also added corresponding namespace ldmud.registered_structs that contains
all registered struct types.
2025-07-07 22:14:05 +02:00
Alexander Motzkau
0142ebbd27 Added abilities to Python integration to trace LPC program execution
Added BEFORE_INSTRUCTION hook to be called for every instruction.
Added call_stack property to query the current stack.
2025-07-07 22:14:05 +02:00
Alexander Motzkau
6ab27def56 Fix detection of inherited prototypes with optional arguments
Prototype-only functions are detected by looking at the first opcode of the
function. If the prototype has optional arguments, then the first bytes is
a jump table for argument initialization. The detection needs to look beyond
that.
2025-07-07 22:12:22 +02:00
Alexander Motzkau
629bb1bba9 Fix crash when calling an undefined function without optional arguments
For every prototype-only function the compiler creates a stub at the end that
throws the undefined function error. However this stub was missing the jump
table for optional arguments, writing the error opcode in its place instead.
This resulted in an invalid table and missing opcode after the table.
Both could result in a crash, depending on whether the function is called
with or without the optional argument.
2025-07-07 22:12:22 +02:00
Stephan Weinberger
2c4de6ccb8
Add simul-efuns for deprecated alist efuns
Provide two implementations: 

alists_sorted.c keeps alists with sorted key arrays. However this is restricted to LPC comparable types (numbers and strings) and homogeneous keys.

alists_unsorted.c implements alists without sorting the keys. If the Lib does not rely on ordered key arrays this implementation offers far superior performance for some operations.
2025-07-07 21:54:13 +02:00
Aloy
96b506c074 Enable MCCP in Tamedhon settings 2025-07-07 21:48:15 +02:00
Alexander Motzkau
a16c4c5b41 Email address updates in the CREDITS file 2025-06-27 17:22:48 +02:00
Aloy
4e9c261208 Tamedhon settings file 2025-05-30 14:04:25 +02:00
Stephan Weinberger
35fc2f5d0f
Merged updates for Beutelland settings (#97) 2025-05-29 09:51:17 +02:00
Alexander Motzkau
3a44b17698 Fixed several problems with parse_command()
The pattern leaked (Thanks, Daniel Nilsson for the fix).
An explicitly passed preposition array would leak.
Arguments were treated as unprotected lvalues, even though they are protected.
The cleanup routine was not called, thus leaking data in global variables.
2025-04-01 21:40:42 +02:00
Zesstra
8bbb6a7261 Documents format version 3.
Format version 3 was added in 3.5.0 and enables to save and restore
lvalue references.
2025-03-22 21:15:47 +01:00
Adam Michaud
657e3ccab1 Mention the file name on inherit-self errors
Adds the name of the file that is trying to inherit itself,
making it easier to track down circular inheritance issues.
2025-03-22 21:12:48 +01:00
Daniel McCarney
80b8834073 pkg-xml2: support libxml2 v2.12+
The v2.12.0 release of libxml2 changed the definition of the callback
used with `xmlSetStructuredErrorFunc()`. This commit adjusts
`pkg-xml2.c` to support both the 2.12.0+ definition, as well as the
older one.
2025-03-22 20:51:25 +01:00
Stephan Weinberger
c9a7282139 include DC_FILESYSTEM_ENCODING in configure_driver manpage 2025-03-21 22:43:38 +01:00
Stephan Weinberger
ec998924d1
document sqlite(C) (#91)
document sqlite(C)

Co-authored-by: Daniel McCarney <daniel@binaryparadox.net>
2025-03-21 22:42:34 +01:00
Michael Programs
ce4464c323 fix grammar typo in doc/efun/call_other 2025-03-21 22:35:25 +01:00
Stephan Weinberger
7283540b7d Added __JSON__ to predefined doc 2025-03-21 22:34:43 +01:00
Stephan Weinberger
edc780e305 Update invocation doc
randominit -> randomdevice
2025-03-21 22:28:21 +01:00
Alexander Motzkau
f7e47e3d79 Fix m_contains() to copy values as rvalues
If the mapping contains rvalue references (e.g. created by walk_mapping)
dereference them before copying them into the target lvalues.
2025-03-21 21:30:30 +01:00
Alexander Motzkau
9317cc0116 Fix compile error with pragma save_local_names
When pragma save_local_names was in effect, a former local variable could
lead to the compile error "Missing variable information" as the compiler
was trying to save that name as well.
2025-03-21 21:30:30 +01:00
Alexander Motzkau
2099fef5dd Github Actions: Update artifacts action to v4 2025-03-21 21:30:30 +01:00
Alexander Motzkau
55eab03df5 Execute the i386 workflow on Ubuntu 22.04
Ubuntu 24.04 removed important i386 libraries (libpcre3) from the
i386 repository, so we're using Ubuntu 22.04 for these actions.
2025-03-21 21:30:30 +01:00
Alexander Motzkau
6ee08ee180 Fix compiler warnings
In ed.c fix 'storing the address of local variable' by making the indentation
stack static. In bitstrings.c and comm.c fix 'variable set but not used'.
In md5.c GCC's warning of 'accessing 64 bytes in a region of size 15' seems
to be a false positivie, therefore disabling the warning there. In xalloc.c
disable GCC's warning of 'storing the address of local variable' as this
is intended for stack safety checks.
2025-03-21 21:30:30 +01:00
Alexander Motzkau
1eae5aa6a8 Fix sign issue when reading cross-definition offsets from function flags.
C23 changed the type of enumeration constants to be the same as the enum
type (instead of always being 'int'). This meant that now INHERIT_MASK is
regarded as being unsigned int, instead of (signed) int. As a consequence
functions that calculated the cross-definition offsets were losing the sign,
resulting in wrong offsets and potentially crashing.
2025-03-21 21:30:30 +01:00
Alexander Motzkau
305da9b5f1 Fix buffer size for to_type(str, [float])
A buffer that is needed for correct use of strtod() was allocated
one byte too small for the trailing null byte.
2025-03-21 21:30:30 +01:00
Alexander Motzkau
ef7dcc8ccf Fix conditional jump depending on uninitialised value
When an action cannot be registered, the corresponding sent object will
be freed, but the deallocation function reads an uninitialised value
(the sent type). Therefore initializing the type early.
2025-03-21 21:30:30 +01:00
Alexander Motzkau
e453976fdd Fix crash in Python's register_type() function
When a type was registered a second time, the cleanup function might call
xfree() on invalid pointers.
2025-03-21 21:30:30 +01:00
Alexander Motzkau
1359334924 Fix memory leak and information leakage in execute_command()
When execute_command() is called, the marker was not freed.
Also it added a byte from the previous invocation to the end of the command.
2025-03-21 21:30:30 +01:00
Alexander Motzkau
1dcd72d0cb Add tests for match_command() 2025-03-21 21:30:30 +01:00
Alexander Motzkau
b6e70a7e6c Fix crash when Python calls a destructed object
When calling an lfun from Python, the corresponding object was not
checked accordingly.
2025-03-21 21:30:30 +01:00
Alexander Motzkau
1b6c6c8147 Fix Python socket notification on exceptional conditions
A wrong variable was passed to Python for notification.
2025-03-21 21:30:30 +01:00