Doxygen Source Code Documentation
xxx_inet.c File Reference
#include <stdio.h>#include <stdlib.h>#include <X11/Xlib.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <netdb.h>#include <arpa/inet.h>Go to the source code of this file.
Functions | |
| char * | xxx_name_to_inet (char *host) |
| int | main (int argc, char *argv[]) |
Variables | |
| Display * | theDisp |
Function Documentation
|
||||||||||||
|
Definition at line 10 of file xxx_inet.c. References argc, free, theDisp, and xxx_name_to_inet().
00011 {
00012 char * cpt ;
00013 char * nam = xxx_name_to_inet(argv[1]) ;
00014 printf("%s\n",nam) ; free(nam) ;
00015
00016 theDisp=XOpenDisplay(NULL) ;
00017 if( theDisp == NULL ) exit(1) ;
00018 nam = DisplayString(theDisp) ; printf("%s\n",nam) ;
00019 cpt = strstr(nam,":") ; *cpt = '\0' ;
00020 nam = xxx_name_to_inet(nam) ;
00021 printf("%s\n",nam) ; free(nam) ;
00022 exit(0) ;
00023 }
|
|
|
Definition at line 39 of file xxx_inet.c. References AFMALL. Referenced by add_TRUST_host(), main(), and self_to_inet().
00040 {
00041 struct hostent * hostp ;
00042 char * iname = NULL , * str ;
00043 int ll ;
00044
00045 if( host == NULL || host[0] == '\0' ) return NULL ;
00046
00047 hostp = gethostbyname(host) ; if( hostp == NULL ) return NULL ;
00048
00049 str = inet_ntoa(*((struct in_addr *)(hostp->h_addr))) ;
00050 if( str == NULL || str[0] == '\0' ) return NULL ;
00051
00052 ll = strlen(str) ; iname = AFMALL(char, ll+1) ; strcpy(iname,str) ;
00053 return iname ;
00054 }
|
Variable Documentation
|
|
Definition at line 8 of file xxx_inet.c. Referenced by main(). |