diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-20 16:36:39 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-20 16:45:20 +0300 |
commit | 65d790e09a96dd8319a9a3399ce85b40c7b57e77 (patch) | |
tree | bb8456b57c62a363f597c9d6cbde1ca2ff0832c6 /src/main.c | |
parent | b189ed18ab94d156076cc57f0efecde7d17b59a5 (diff) | |
download | mailfromd-65d790e09a96dd8319a9a3399ce85b40c7b57e77.tar.gz mailfromd-65d790e09a96dd8319a9a3399ce85b40c7b57e77.tar.bz2 |
New macros and functions for registering function cleanup sequence in environments.
Cleanup sequence holds pointers to data created within the function along
with the corresponding functions for their disposal. When the function
terminates or raises an exception, the sequence is executed thereby freeing
the temporary data.
* mflib/mfh.awk: Convert # comments to C-style.
* src/builtin/io.bi (REDIRECT_STDOUT_P): Remove useless comparison.
* src/builtin/snarf.m4 (MF_VAR_STRING): New macro
(END): Call env_function_cleanup_flush.
(MF_DCL_CLEANUP,MF_CLEANUP): New macros.
* src/builtin/spf.bi (spf_check_host)
(spf_test_record): Use MF_VAR_STRING to initialize q.exp_prefix.
* src/prog.c (environ_cleanup_closure): New struct.
(eval_environ)<cleanup_list>: New member.
(env_create_cleanup_list): New static function.
(env_function_cleanup_flush)
(env_function_cleanup_add): New function.
(env_throw_0): Call env_function_cleanup_flush.
(create_environment): Create cleanup_list.
(destroy_environment): Destroy it.
* src/prog.h (env_function_cleanup_add)
(env_function_cleanup_flush): New protos.
Diffstat (limited to 'src/main.c')
0 files changed, 0 insertions, 0 deletions