defined hio_bcstrtoskad()/hio_ucstrtoskad()

This commit is contained in:
hyung-hwan 2021-08-18 06:34:50 +00:00
parent 6767e34768
commit e99289b902
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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");