Last change
on this file was
5132,
checked in by westram, 17 years ago
|
|
-
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 | |
---|
5 | struct 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 | |
---|
12 | extern AN_main *aisc_main; |
---|
13 | void names_server_shutdown(void) __ATTR__NORETURN; |
---|
14 | int names_server_save(void); |
---|
15 | |
---|
16 | #ifdef __cplusplus |
---|
17 | extern "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 | |
---|
33 | int names_init_socket(AN_local *THIS) |
---|
34 | { |
---|
35 | aisc_add_destroy_callback((aisc_callback_func)names_destroy_locs,(long)THIS); |
---|
36 | return 0; |
---|
37 | } |
---|
38 | void names_destroy_socket(AN_local *) |
---|
39 | { |
---|
40 | aisc_remove_destroy_callback(); |
---|
41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.