Debian Codegraph @

listings/chapter-2/client.c

raw
1 /***********************************************************************
2 * Code listing from "Advanced Linux Programming," by CodeSourcery LLC *
3 * Copyright (C) 2001 by New Riders Publishing *
4 * See COPYRIGHT for license information. *
5 ***********************************************************************/
6
7 #include <stdio.h>
8 #include <stdlib.h>
9
10 int main ()
11 {
12 char* server_name = getenv ("SERVER_NAME");
13 if (server_name == NULL)
14 /* The SERVER_NAME environment variable was not set. Use the
15 default. */
16 server_name = "server.my-company.com";
17
18 printf ("accessing server %s\n", server_name);
19 /* Access the server here... */
20
21 return 0;
22 }