~ubuntu-branches/ubuntu/raring/libcaca/raring

« back to all changes in this revision

Viewing changes to src/cacaserver.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hocevar (Debian packages)
  • Date: 2007-10-13 20:10:44 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071013201044-35yldy9w3xe7iy2j
Tags: 0.99.beta12.debian-3
* debian/control:
  + Build-depend on texlive instead of all the other texlive-* packages so
    that we have the proper fonts at build time (Closes: #445797).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *                2006 Sam Hocevar <sam@zoy.org>
5
5
 *                All Rights Reserved
6
6
 *
7
 
 *  $Id: cacaserver.c 1005 2006-11-09 17:24:29Z sam $
 
7
 *  $Id: cacaserver.c 1117 2007-06-27 13:03:31Z sam $
8
8
 *
9
 
 *  This program is free software; you can redistribute it and/or
10
 
 *  modify it under the terms of the Do What The Fuck You Want To
11
 
 *  Public License, Version 2, as published by Sam Hocevar. See
 
9
 *  This program is free software. It comes without any warranty, to
 
10
 *  the extent permitted by applicable law. You can redistribute it
 
11
 *  and/or modify it under the terms of the Do What The Fuck You Want
 
12
 *  To Public License, Version 2, as published by Sam Hocevar. See
12
13
 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13
14
 */
14
15
 
20
21
#include <stdlib.h>
21
22
#if defined(HAVE_ARPA_INET_H)
22
23
#   include <arpa/inet.h>
 
24
#   if defined(USE_COCOA) && defined(HAVE_NETINET_IN_H)
 
25
/* for sockaddr_in (not included from arpa/inet.h in 10.3.9 SDK) */
 
26
#       include <netinet/in.h>
 
27
#   endif
23
28
#elif defined(HAVE_NETINET_IN_H)
24
29
#   include <netinet/in.h>
25
30
#elif defined(HAVE_WINSOCK2_H)
26
31
#   include <winsock2.h>
27
32
#   include <ws2tcpip.h>
 
33
#   define USE_WINSOCK 1
28
34
#endif
29
35
#if defined(HAVE_UNISTD_H)
30
36
#   include <unistd.h>
36
42
#include <errno.h>
37
43
#include <stdarg.h>
38
44
 
 
45
#ifndef USE_WINSOCK
 
46
#   define USE_WINSOCK 0
 
47
#endif
 
48
 
39
49
#include "cucul.h"
40
50
 
41
51
#define BACKLOG 1337     /* Number of pending connections */
124
134
    struct server *server;
125
135
    char *tmp;
126
136
 
127
 
#ifdef HAVE_WINDOWS_H
128
 
        WORD winsockVersion;
129
 
        WSADATA wsaData;
130
 
        winsockVersion = MAKEWORD(1, 1);
 
137
#if USE_WINSOCK
 
138
    WORD winsockVersion;
 
139
    WSADATA wsaData;
 
140
    winsockVersion = MAKEWORD(1, 1);
131
141
 
132
 
        WSAStartup(winsockVersion, &wsaData);
 
142
    WSAStartup(winsockVersion, &wsaData);
133
143
#endif
134
144
    server = malloc(sizeof(struct server));
135
145
 
286
296
 
287
297
    free(server);
288
298
 
289
 
#ifdef HAVE_WINDOWS_H
 
299
#if USE_WINSOCK
290
300
    WSACleanup();
291
301
#endif
292
302
    return 0;