summaryrefslogtreecommitdiffstats
path: root/syslog.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-23 06:24:54 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-23 06:24:54 -0700
commitad4e4e79ac6b9fcb182f3cd834120ec79512ac9a (patch)
tree44aae8e017bc51f526fded0d85bf3a63ba00ad8f /syslog.c
parenteed035b792cb3b1b2723fa2b1ca0dd7fb5e5fe31 (diff)
downloadtxr-ad4e4e79ac6b9fcb182f3cd834120ec79512ac9a.tar.gz
txr-ad4e4e79ac6b9fcb182f3cd834120ec79512ac9a.tar.bz2
txr-ad4e4e79ac6b9fcb182f3cd834120ec79512ac9a.zip
c_str now takes a self argument.
Adding a self parameter to c_str so that when a non-string occurs, the error is reported against a function. Legend: A - Pass existing self to c_str. B - Define self and pass to c_str and possibly other functions. C - Take new self parameter and pass to c_str and possibly other functions. D - Pass existing self to c_str and/or other functions. E - Define self and pass to other functions, not c_str. X - Pass nil to c_str. * buf.c (buf_strm_put_string, buf_str): B. * chksum.c (sha256_str, md5_str): C. (sha256_hash, md5_hash): D. * eval.c (load): D. * ffi.c (ffi_varray_dynsize, ffi_str_put, ffi_wstr_put, ffi_bstr_put): A. (ffi_char_array_put, ffi_wchar_array_put): C. (ffi_bchar_array_put): A. (ffi_array_put, ffi_array_out, ffi_varray_put): D. * ftw.c (ftw_wrap): A. * glob.c (glob_wrap): A. * lib.c (copy_str, length_str, coded_length,split_str_set, list_str, cmp_str, num_str, out_json_str, out_json_rec, display_width): B. (upcase_str, downcase_str, string_extend, search_str, do_match_str, do_rmatch_str, sub_str, replace_str, cat_str_append, split_str_keep, trim_str, int_str, chr_str, span_str, compl_span_str, break_str, length_str_gt, length_str_ge, length_str_lt, length_str_le, find, rfind, pos, rpos, mismatch, rmismatch): A. (c_str): Add self parameter and use in type mismatch diagnostic. If the parameter is nil, use "internal error". (flo_str): B, and correction to "flot-str" typo. (out_lazy_str, out_quasi_str, obj_print_impl): D. * lib.h (c_str): Declaration updated. * match.c (dump_var): X. (v_load): D. * parser.c (open_txr_file): C. (load_rcfile): E. (find_matching_syms, provide_atom): X. (hist_save, repl): B. * parser.h (open_txr_file): Declaration updated. * parser.y (chrlit): X. * regex.c (search_regex): A. * socket.c (getaddrinfo_wrap, sockaddr_pack): A. (dgram_put_string): B. (open_sockfd): D. (sock_connect): E. * stream.c (stdio_put_string, tail_strategy, vformat_str, open_directory, open_file, open_tail, remove_path, rename_path, tmpfile_wrap, mkdtemp_wrap, mkstemp_wrap): B. (do_parse_mode, parse_mode, make_string_byte_input_stream): B. (normalize_mode, normalize_mode_no_bin): E. (string_out_put_string, formatv, put_string, open_fileno, open_subprocess, open_command, base_name, dir_name, short_suffix, long_suffix): A. (run): D. (win_escape_cmd, win_escape_arg): X. * stream.h (parse_mode, normalize_mode, normalize_mode_no_bin): Declarations updated. * sysif.c (mkdir_wrap, do_utimes, dlopen_wrap, dlsym_wrap, dlvsym_wrap): A. (do_stat, do_lstat): C. (mkdir_nothrow_exists, ensure_dir): E. (chdir_wrap, rmdir_wrap, mkfifo_wrap, chmod_wrap, symlink_wrap, link_wrap, readlink_wrap, exec_wrap, getenv_wrap, setenv_wrap, unsetenv_wrap, getpwnam_wrap, getgrnam_wrap, crypt_wrap, fnmatch_wrap, realpath_wrap, opendir_wrap): B. (stat_impl): statfn pointer-to-function argument now takes self parameter. When calling it, we pass name. * syslog.c (openlog_wrap, syslog_wrapv): A. * time.c (time_string_local, time_string_utc, time_string_meth, time_parse_meth): A. (strptime_wrap): B. * txr.c (txr_main): D. * y.tab.c.shipped: Updated.
Diffstat (limited to 'syslog.c')
-rw-r--r--syslog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/syslog.c b/syslog.c
index efe20565..2ed83e9f 100644
--- a/syslog.c
+++ b/syslog.c
@@ -95,7 +95,7 @@ val openlog_wrap(val wident, val optmask, val facility)
cnum cfacility = c_num(default_arg(facility, num_fast(LOG_USER)), self);
char *old_ident = ident;
- ident = utf8_dup_to(c_str(wident));
+ ident = utf8_dup_to(c_str(wident, self));
openlog(ident, coptmask, cfacility);
@@ -115,7 +115,7 @@ val syslog_wrapv(val prio, val fmt, struct args *args)
val self = lit("syslog");
val text = formatv(nil, fmt, args);
cnum cprio = c_num(prio, self);
- char *u8text = utf8_dup_to(c_str(text));
+ char *u8text = utf8_dup_to(c_str(text, self));
syslog(cprio, "%s", u8text);
return nil;
}