/*- * wmQStat - WindowMaker/AfterStep/BB/FB/Waimea dockable front-end to * Steve Jankowski's qstat (http://www.qstat.org/). * * Copyright (c) 2003-2005 Alexey Dokuchaev. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $Id: proto.h,v 1.14 2005/02/27 14:28:47 danfe Exp $ */ #ifndef _PROTO_H_ #define _PROTO_H_ #include /* for FILE* */ #define MAX_PLAYER_NAME 32 #define MAX_SERVER_ADDR 64 #define MAX_SERVER_TYPE 4 #define MAX_MAP_NAME 16 //#define MAX_SERVER_NAME 64 #define TIME 0 #define PING 1 #define FRAGS 2 struct player { char name[MAX_PLAYER_NAME + 1]; int frags; int ping; int time; }; struct server { char type[MAX_SERVER_TYPE + 1]; /* q2s */ char address[MAX_SERVER_ADDR + 1]; /* regency */ //int flags; int npl; int maxpl; char map[MAX_MAP_NAME + 1]; /* ztn2dm3 */ //char name[MAX_SERVER_NAME + 1]; /* Regency Meltdown */ struct player *players; void (*query)(FILE *, struct player *); }; struct slist { struct server *srv; struct slist *next; }; #ifdef _WMQSTAT /* wmqstat.c */ static void update_stats(void); static char *parse_cmd_line(int, char **); static struct slist *spawn_servers(const char *); static void clean_up(struct slist *); static void draw_header(const struct server *); static void display_stats(const struct server *); static void wm_printf(int, const int, const char *, ...); static void usage(void); #endif /* !_WMQSTAT */ #if defined(_SRV_PROC) || defined(_WMQSTAT) /* srv_proc.c */ struct server *add_server(const char *, const char *); void kill_server(struct server *); int obtain_stats(struct server *); #endif /* !_SRV_PROC/_WMQSTAT */ #ifdef _SRV_PROC static void shut_down(struct server *, FILE *); #endif /* !_SRV_PROC */ #if defined(_SRV_QUERY) || defined(_SRV_PROC) /* srv_query.c */ void query_q_server(FILE *, struct player *); void query_qw_server(FILE *, struct player *); void query_q2_server(FILE *, struct player *); #if 0 void query_ut_server(FILE *, struct player *); void query_sg_server(FILE *, struct player *); #endif void query_hl_server(FILE *, struct player *); void query_trb_server(FILE *, struct player *); void query_trb2_server(FILE *, struct player *); void query_bfris_server(FILE *, struct player *); void query_dc3_server(FILE *, struct player *); void query_ghrec_server(FILE *, struct player *); void query_eye_server(FILE *, struct player *); #endif /* !_SRV_QUERY/_SRV_PROC */ #endif /* !_PROTO_H_ */