From e99289b9021308b30fdca7c726e53cbeae640c98 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 18 Aug 2021 06:34:50 +0000 Subject: [PATCH] defined hio_bcstrtoskad()/hio_ucstrtoskad() --- hio/lib/hio-skad.h | 5 +++-- hio/lib/skad.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hio/lib/hio-skad.h b/hio/lib/hio-skad.h index 26821bc..f8c412e 100644 --- a/hio/lib/hio-skad.h +++ b/hio/lib/hio-skad.h @@ -136,9 +136,8 @@ HIO_EXPORT int hio_bcharstoskad ( hio_skad_t* skad ); -#define hio_bcstrtoskad(hio,str,skad) hio_bcharstoskad(hio, str, hio_count_bcstr(str), skad) #define hio_ucstrtoskad(hio,str,skad) hio_ucharstoskad(hio, str, hio_count_ucstr(str), skad) - +#define hio_bcstrtoskad(hio,str,skad) hio_bcharstoskad(hio, str, hio_count_bcstr(str), skad) HIO_EXPORT hio_oow_t hio_skadtoucstr ( hio_t* hio, @@ -157,9 +156,11 @@ HIO_EXPORT hio_oow_t hio_skadtobcstr ( ); #if defined(HIO_OOCH_IS_UCH) +# define hio_oocstrtoskad hio_ucstrtoskad # define hio_oocharstoskad hio_ucharstoskad # define hio_skadtooocstr hio_skadtoucstr #else +# define hio_oocstrtoskad hio_bcstrtoskad # define hio_oocharstoskad hio_bcharstoskad # define hio_skadtooocstr hio_skadtobcstr #endif diff --git a/hio/lib/skad.c b/hio/lib/skad.c index 1d42dde..1b714b7 100644 --- a/hio/lib/skad.c +++ b/hio/lib/skad.c @@ -649,7 +649,7 @@ int hio_bcharstoskad (hio_t* hio, const hio_bch_t* str, hio_oow_t len, hio_skad_ #if defined(AF_UNIX) && (HIO_SIZEOF_STRUCT_SOCKADDR_UN > 0) /* @aaa, @/tmp/aaa ... */ hio_copy_bchars_to_bcstr (skad->un.sun_path, HIO_COUNTOF(skad->un.sun_path), str + 1, len - 1); - skad->un.sun_family = HIO_AF_UNIX; + skad->un.sun_family = AF_UNIX; return 0; #else hio_seterrbfmt (hio, HIO_ENOIMPL, "unix address not supported");