Skip to main content

DPUTS

Macro DPUTS 

Source
macro_rules! DPUTS {
    ($x:expr, $y:expr) => { ... };
}
Expand description

Port of #define DPUTS(X, Y) macro from Src/zsh.h:2918 (macro).

C body (DEBUG defined, c:2918):

# define DPUTS(X,Y) if (!(X)) {;} else dputs(ERRMSG(Y))

where ERRMSG(x) is (__FILE__ ":" STRINGIFY(__LINE__) ": " x) (c:2917). Without DEBUG (c:2923) the macro expands to nothing.

The Rust port routes through crate::ported::utils::dputs (port of dputs at Src/utils.c:253) under #[cfg(feature = "zsh-debug")] — Rust’s analogue to C’s #ifdef DEBUG (set by configure’s --enable-zsh-debug). Stock zsh ships with DEBUG un-set, so the default zshrs build (without --features zsh-debug) is silent too. The file:line prefix uses file!() / line!() to mirror __FILE__:__LINE__.