source: tags/arb_5.3/NAMES_COM/names_extern.c

Last change on this file was 5132, checked in by westram, 16 years ago
  • double include
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 865 bytes
Line 
1#include <stdio.h>
2#include <stdlib.h>
3#include "names_server.h"
4
5struct sigcontext;
6#include "C/server.h"
7
8#include <aisc_server_proto.h>
9#include <aisc_server_extern.h>
10#include <import_proto.h>
11
12extern AN_main *aisc_main;
13void names_server_shutdown(void) __ATTR__NORETURN;
14int names_server_save(void);
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19   
20    int names_destroy_locs(AN_local *THIS) {
21        /* called when client closes connection */
22        destroy_AN_local(THIS);
23        if (aisc_main->ploc_st.cnt <= 0) { /* last client disconnected */
24            names_server_save();
25        }
26        return 0;
27    }
28
29#ifdef __cplusplus
30}
31#endif
32
33int names_init_socket(AN_local *THIS)
34{
35    aisc_add_destroy_callback((aisc_callback_func)names_destroy_locs,(long)THIS);
36    return 0;
37}
38void names_destroy_socket(AN_local *)
39{
40    aisc_remove_destroy_callback();
41}
Note: See TracBrowser for help on using the repository browser.