PSI_MACRO(int IN6_IS_ADDR_MC_ORGLOCAL, [(const struct in6_addr *a)])
PSI_MACRO(int IN6_IS_ADDR_MC_GLOBAL, [(const struct in6_addr *a)])
- PSI_EXTVAR(struct in6_addr in6addr_loopback)
+ PSI_MACRO(struct in6_addr in6addr_loopback)
}
PSI_DECL(int sigignore, [(int sig)])
PSI_DECL(int siginterrupt, [(int sig, int flag)])
PSI_DECL(int sigismember, [(const sigset_t *set, int signum)])
- PSI_DECL(sighandler_t signal, [(int sig, sighandler_t *func)])
+ PSI_DECL(sighandler_t signal, [(int sig, sighandler_t func)])
PSI_DECL(int sigpause, [(int sig)])
PSI_DECL(int sigpending, [(sigset_t *set)])
PSI_DECL(int sigprocmask, [(int how, const sigset_t *set, sigset_t *oset)])
PSI_DECL(int timer_settime, [(timer_t t, int flags, struct itimerspec *value, struct itimerspec *ovalue)], [], [-lrt])
PSI_DECL(void tzset, [()])
+ PSI_MACRO(int getdate_err)
PSI_EXTVAR(int daylight)
PSI_EXTVAR(long timezone)
PSI_EXTVAR(char **tzname)
dnl PSI_MACRO(macro, decl args, action-if-true)
AC_DEFUN(PSI_MACRO, [
AC_CHECK_DECL(PSI_VAR_NAME($1)$2, [
- $3
macro_type="PSI_VAR_TYPE($1)"
macro_name="PSI_VAR_NAME($1)"
m4_case([$2],
[(void)], [
macro_decl="(void)"
macro_call="()"
+ macro_action=call
],
[()], [
macro_decl="()"
macro_call="()"
+ macro_action=call
],
[], [
macro_decl="()"
macro_call=""
+ macro_action=get
],
[
macro_decl="$2"
macro_call="(m4_map_args_sep([PSI_VAR_NAME(], [)], [, ], m4_bregexp($2, [(\(.*\))], [\1])))"
+ macro_action=call
]
)
ifelse(PSI_VAR_TYPE($1), [void], [
], [
macro_body="return $macro_name$macro_call;"
])
- psi_add_macro "$macro_type _psi_redir_$macro_name$macro_decl { $macro_body }"
- PSI_REDIR($macro_name, _psi_redir_$macro_name)
+ $3
+ psi_add_macro "$macro_type _psi_${macro_action}_$macro_name$macro_decl { $macro_body }"
+ PSI_REDIR($macro_name, _psi_${macro_action}_$macro_name)
], [], PSI_INCLUDES)
])
dnl PSI_EXTVAR(type var)
-AC_DEFUN(PSI_EXTVAR, [PSI_MACRO($1)])
+AC_DEFUN(PSI_EXTVAR, [
+ dnl just a getter
+ PSI_MACRO($1, [], [
+ PSI_DECL_ARGS($1)
+ psi_add_decl "$psi_decl_args"
+ dnl explicit getter & setter
+ PSI_REDIR([${macro_name}_get], [_psi_get_$macro_name])
+ PSI_DECL_ARGS($1_get)
+ psi_add_decl "$psi_decl_args"
+ psi_add_macro "void _psi_set_${macro_name}($macro_type value) { memcpy(&$macro_name, &value, sizeof(value)); }"
+ PSI_REDIR([${macro_name}_set], [_psi_set_${macro_name}])
+ PSI_DECL_ARGS([void PSI_VAR_NAME($1)_set], [(PSI_VAR_TYPE($1) _v)])
+ psi_add_decl "$psi_decl_args"
+ ])
+])