00001
00004 #ifndef GALE_CLIENT_H
00005 #define GALE_CLIENT_H
00006
00007 #include "gale/core.h"
00008 #include "gale/misc.h"
00009 #include "oop.h"
00010
00013
00014 struct gale_location;
00015
00022 typedef void *gale_call_location(struct gale_text name,
00023 struct gale_location *loc,void *user);
00024
00025 void gale_find_location(
00026 oop_source *,struct gale_text,
00027 gale_call_location *,void *user);
00028 void gale_find_exact_location(
00029 oop_source *,struct gale_text,
00030 gale_call_location *,void *user);
00031 void gale_find_default_location(
00032 oop_source *,gale_call_location *,void *user);
00033
00034 struct gale_text gale_location_name(struct gale_location *loc);
00035 struct gale_key *gale_location_key(struct gale_location *loc);
00036 const struct gale_map *gale_location_members(struct gale_location *loc);
00037
00038 int gale_location_receive_ok(struct gale_location *loc);
00039 int gale_location_send_ok(struct gale_location *loc);
00040
00042 struct gale_message {
00044 struct gale_location **from;
00046 struct gale_location **to;
00048 struct gale_group data;
00049 };
00050
00056 typedef void *gale_call_packet(struct gale_packet *msg,void *user);
00057
00058 void gale_pack_message(oop_source *oop,
00059 struct gale_message *msg,
00060 gale_call_packet *call,void *user);
00061
00067 typedef void *gale_call_message(struct gale_message *msg,void *user);
00068
00069 void gale_unpack_message(oop_source *oop,
00070 struct gale_packet *pack,
00071 gale_call_message *func,void *user);
00072
00073 struct gale_text gale_pack_subscriptions(
00074 struct gale_location **list,
00075 int *positive);
00080
00081 struct gale_error_queue;
00082
00083 struct gale_error_queue *gale_make_queue(oop_source *);
00084 void gale_on_queue(struct gale_error_queue *,gale_call_message *,void *);
00085 gale_call_error gale_queue_error;
00086
00091
00106 struct gale_server *gale_make_server(
00107 oop_source *oop,struct gale_link *link,
00108 struct gale_text server,int avoid_port);
00109
00114 void gale_close(struct gale_server *serv);
00115
00121 typedef void *gale_call_disconnect(struct gale_server *serv,void *user);
00122
00130 typedef void *gale_call_connect(struct gale_server *serv,
00131 struct gale_text host,struct sockaddr_in addr,void *);
00132
00142 void gale_on_connect(struct gale_server *serv,gale_call_connect *func,void *user);
00143
00154 void gale_on_disconnect(struct gale_server *,gale_call_disconnect *func,void *user);
00155
00158
00159
00160 void gale_add_id(struct gale_group *group,struct gale_text terminal);
00161
00162 #endif