Commit 0563a7a9 authored by Yang Tse's avatar Yang Tse
Browse files

ares_getopt() command-line parser function does not belong to actual

c-ares library. It is just a convinience source code helper function
for use in example programs adig.c and ahost.c
parent 945ba7cb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ ares_timeout.c ares_destroy.c ares_mkquery.c ares_version.c \
ares_expand_name.c ares_parse_a_reply.c windows_port.c			\
ares_expand_string.c ares_parse_ptr_reply.c ares_parse_aaaa_reply.c	\
ares_getnameinfo.c inet_net_pton.c bitncmp.c inet_ntop.c		\
ares_parse_ns_reply.c ares_getopt.c
ares_parse_ns_reply.c

HHEADERS = ares.h ares_private.h setup.h ares_dns.h ares_version.h          \
           nameser.h inet_net_pton.h inet_ntop.h ares_ipv6.h bitncmp.h      \
+5 −7
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ OBJECTS = $(OBJ_DIR)\ares_fds.obj \
          $(OBJ_DIR)\ares__read_line.obj       \
          $(OBJ_DIR)\ares_gethostbyname.obj    \
          $(OBJ_DIR)\ares_getnameinfo.obj      \
          $(OBJ_DIR)\ares_getopt.obj           \
          $(OBJ_DIR)\ares_strerror.obj         \
          $(OBJ_DIR)\ares_cancel.obj           \
          $(OBJ_DIR)\ares_init.obj             \
@@ -122,15 +121,14 @@ $(DEF_FILE): $(OBJECTS) Makefile.VC6
       @echo   ares_inet_pton         >> $@
       @echo   ares_writev            >> $@
       @echo   ares_getnameinfo       >> $@
       @echo   ares_getopt            >> $@
       @echo   ares_gettimeofday      >> $@
       @echo   ares_parse_aaaa_reply  >> $@

ahost.exe: $(OBJ_DIR) $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\getopt.obj cares_imp.lib
       link $(LDFLAGS) -out:$@ $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\getopt.obj cares_imp.lib $(EX_LIBS)
ahost.exe: $(OBJ_DIR) $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
       link $(LDFLAGS) -out:$@ $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)

adig.exe: $(OBJ_DIR) $(OBJ_DIR)\adig.obj $(OBJ_DIR)\getopt.obj cares_imp.lib
       link $(LDFLAGS) -out:$@ $(OBJ_DIR)\adig.obj $(OBJ_DIR)\getopt.obj cares_imp.lib $(EX_LIBS)
adig.exe: $(OBJ_DIR) $(OBJ_DIR)\adig.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
       link $(LDFLAGS) -out:$@ $(OBJ_DIR)\adig.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)

clean:
       - del $(OBJ_DIR)\*.obj *.ilk *.pdb *.pbt *.pbi *.pbo *._xe *.map
@@ -232,4 +230,4 @@ $(OBJ_DIR)\bitncmp.obj: bitncmp.c bitncmp.h
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h setup_once.h nameser.h           \
  ares_ipv6.h inet_ntop.h

$(OBJ_DIR)\ares_getopt.obj: ares_getopt.c setup.h setup_once.h ares.h
$(OBJ_DIR)\ares_getopt.obj: ares_getopt.c ares_getopt.h
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@
#include "ares.h"
#include "ares_dns.h"
#include "inet_ntop.h"
#include "ares_getopt.h"

#ifdef WATT32
#undef WIN32  /* Redefined in MingW headers */
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#include "ares_dns.h"
#include "inet_ntop.h"
#include "inet_net_pton.h"
#include "ares_getopt.h"

#ifndef optind
extern int   optind;
+0 −1
Original line number Diff line number Diff line
@@ -218,7 +218,6 @@ int ares_parse_ns_reply(const unsigned char *abuf, int alen,
void ares_free_string(void *str);
void ares_free_hostent(struct hostent *host);
const char *ares_strerror(int code);
int ares_getopt(int nargc, char * const nargv[], const char *ostr);

#ifdef  __cplusplus
}
Loading