X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/1d08c1e0c0de0d321883ece1c36bce851fe893c7..eda0cc87eedfbbe5a15a91a59489e31f69e30998:/h/mh.h?ds=sidebyside diff --git a/h/mh.h b/h/mh.h index d88df07f..67b71702 100644 --- a/h/mh.h +++ b/h/mh.h @@ -25,10 +25,10 @@ #define NMH_BUFSIZ (BUFSIZ>=8192 ? BUFSIZ : 8192) #ifndef FALSE -#define FALSE 0 +#define FALSE false #endif #ifndef TRUE -#define TRUE 1 +#define TRUE true #endif typedef unsigned char boolean; /* not int so we can pack in a structure */ @@ -43,6 +43,13 @@ typedef unsigned char boolean; /* not int so we can pack in a structure */ #define NMH_UNUSED(i) i #endif +/* DIM gives the number of elements in the one-dimensional array a. */ +#define DIM(a) (sizeof (a) / sizeof (*(a))) + +/* LEN gives the strlen() of string constant s, excluding the + * terminating NUL. */ +#define LEN(s) (sizeof (s) - 1) + /* * char array that keeps track of size in both bytes and characters * Usage note: @@ -392,12 +399,7 @@ typedef struct m_getfld_state *m_getfld_state_t; /* * credentials management */ -struct nmh_creds { - char *host; - char *user; - char *password; -}; - +struct nmh_creds; typedef struct nmh_creds *nmh_creds_t; /*