home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / tcpiptk / sampdll / myprog.c next >
Text File  |  1999-05-11  |  2KB  |  48 lines

  1. /********************************************************copyrite.xic********/
  2. /*                                                                          */
  3. /*   Licensed Materials - Property of IBM                                   */
  4. /*   IBM TCP/IP for OS/2                                                    */
  5. /*   (C) Copyright IBM Corporation. 1990.                                   */
  6. /*                                                                          */
  7. /*   All rights reserved.                                                   */
  8. /*                                                                          */
  9. /*   US Government Users Restricted Rights -                                */
  10. /*   Use, duplication or disclosure restricted by GSA ADP Schedule          */
  11. /*   Contract with IBM Corp.                                                */
  12. /*                                                                          */
  13. /*--------------------------------------------------------------------------*/
  14. /*                                                                          */
  15. /*  DISCLAIMER OF WARRANTIES.  The following [enclosed] code is             */
  16. /*  sample code created by IBM Corporation. This sample code is not         */
  17. /*  part of any standard or IBM product and is provided to you solely       */
  18. /*  for  the purpose of assisting you in the development of your            */
  19. /*  applications.  The code is provided "AS IS", without                    */
  20. /*  warranty of any kind.  IBM shall not be liable for any damages          */
  21. /*  arising out of your use of the sample code, even if they have been      */
  22. /*  advised of the possibility of such damages.                             */
  23. /*--------------------------------------------------------------------------*/
  24. #include <stdio.h>
  25. #include <stdlib.h>
  26.  
  27. char * s_gethostbyname(char *);
  28.  
  29. main(argc, argv)
  30.    int argc;
  31.    char *argv[];
  32.  
  33. {
  34.  
  35.     char  *hostnm;
  36.  
  37.     if (argc != 2)
  38.     {
  39.         fprintf(stderr, "Usage: %s hostname \n", argv[0]);
  40.         exit(1);
  41.     }
  42.  
  43.     hostnm = s_gethostbyname(argv[1]);
  44.  
  45.     printf(" Internet address is : %s\n", hostnm);
  46.  
  47. }
  48.