Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Thursday, June 13, 2019
 
 

idn_comparenames (3)

Name

idn_comparenames - compare two internationzalized domain names

Synopsis

#include <idn/api.h>

idn_result_t
idn_comparenames(idn_action_t actions, const char *name1,
const char *name2);

idn_result_t
idn_comparenames2(idn_action_t actions1, const char *name1,
idn_action_t actions2, const char *name2);

Description

idn_comparenames(3)        Library Functions Manual        idn_comparenames(3)



NAME
       idn_comparenames,  idn_decodename2  -  compare  two  internationzalized
       domain names

SYNOPSIS
       #include <idn/api.h>

       idn_result_t
       idn_comparenames(idn_action_t actions, const char *name1,
           const char *name2);

       idn_result_t
       idn_comparenames2(idn_action_t actions1, const char *name1,
           idn_action_t actions2, const char *name2);


DESCRIPTION
       The function idn_comparenames() encodes domain names name1 and name2 as
       idn_encodename() does, and then compares them.  If they are equivalent,
       it returns idn_success.  Otherwise, it returns idn_neq.  When an  error
       occurs  in the encoding processes, the function returns the correspond-
       ing error code (see idn_result_tostring(3) for details).

       The function idn_comparenames2() works same as idn_comparenames(),  but
       it  performs  actions1  when  it encodes name1 and it performs actions2
       when it encodes name2 respectively.

       In addition with action macros for idn_encodename() (e.g.  IDN_UNICODE-
       CONV),  the  following  macros are available for idn_comparenames() and
       idn_comparenames2().

           IDN_COMPARE_REGIST
                  Encode a domain name with  IDNA2008  registration  protocol,
                  before  comparison.   Currently,  its  value  is the same as
                  IDN_ENCODE_REGIST.

           IDN_COMPARE_LOOKUP
                  Encode a domain name with IDNA2008 lookup  protocol,  before
                  comparison.    Currently,   its   value   is   the  same  as
                  IDN_ENCODE_LOOKUP.

EXAMPLES
       The program below shows an example of idn_comparenames().

           idn_result_t r;
           ...
           r = idn_comparenames(IDN_COMPARE_LOOKUP, name1, name2);
           if (r == idn_success)
               fprintf(stderr, "'%s' == '%s'\n", name1, name2);
           else if (r == idn_neq)
               fprintf(stderr, "'%s' != '%s'\n", name1, name2);
           else
               fprintf(stderr, "error: %s\n", idn_result_tostring(r));
           ...


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+------------------------------+
       |ATTRIBUTE TYPE |       ATTRIBUTE VALUE        |
       +---------------+------------------------------+
       |Availability   | library/idnkit/header-idnkit |
       +---------------+------------------------------+
       |Stability      | Committed                    |
       +---------------+------------------------------+
SEE ALSO
       idncmp(1),    libidnkit(3),     idn_encodename(3),     idn_nameinit(3),
       idn_result_tostring(3), idn.conf(5)



NOTES
       This     software     was    built    from    source    available    at
       https://github.com/oracle/solaris-userland.   The  original   community
       source was downloaded from  https://jprs.co.jp/idn/idnkit-2.3.tar.bz2

       Further information about this software can be found on the open source
       community website at https://jprs.co.jp/idn.



                                 Sep 21, 2012              idn_comparenames(3)