Finish uncrustifying

This commit is contained in:
Gergely Polonkai 2016-06-22 18:26:02 +02:00
parent bdf518f37f
commit 9bded1b722
13 changed files with 186 additions and 142 deletions

View File

@ -67,6 +67,7 @@ typedef struct _ConfigData {
extern ConfigData *active_config; extern ConfigData *active_config;
gboolean wmud_config_init(ConfigData **config_data, GError **err); gboolean wmud_config_init(ConfigData **config_data,
GError **err);
#endif /* __WMUD_CONFIGURATION_H__ */ #endif /* __WMUD_CONFIGURATION_H__ */

View File

@ -43,16 +43,26 @@ typedef enum {
gboolean wmud_db_init(GError **err); gboolean wmud_db_init(GError **err);
gboolean wmud_db_load_players(GError **err); gboolean wmud_db_load_players(GError **err);
gboolean wmud_db_save_player(WmudPlayer *player, GError **err); gboolean wmud_db_save_player(WmudPlayer *player,
gboolean wmud_db_load_planes(GSList **planes, GError **err); GError **err);
gboolean wmud_db_load_planets(GSList **planets, GError **err); gboolean wmud_db_load_planes(GSList **planes,
gboolean wmud_db_load_directions(GSList **directions, GError **err); GError **err);
gboolean wmud_db_load_areas(GSList **areas, GError **err); gboolean wmud_db_load_planets(GSList **planets,
gboolean wmud_db_load_rooms(GSList **rooms, GError **err); GError **err);
gboolean wmud_db_load_exits(GSList **exits, GError **err); gboolean wmud_db_load_directions(GSList **directions,
gboolean wmud_db_load_planet_planes(GSList **planet_planes, GError **err); GError **err);
gboolean wmud_db_load_menu(GSList **menu_items, GError **err); gboolean wmud_db_load_areas(GSList **areas,
gboolean wmud_db_update_player_password(WmudPlayer *player, gchar *crypted_password, GError **err); GError **err);
gboolean wmud_db_load_rooms(GSList **rooms,
GError **err);
gboolean wmud_db_load_exits(GSList **exits,
GError **err);
gboolean wmud_db_load_planet_planes(GSList **planet_planes,
GError **err);
gboolean wmud_db_load_menu(GSList **menu_items,
GError **err);
gboolean wmud_db_update_player_password(WmudPlayer *player,
gchar *crypted_password,
GError **err);
#endif /* __WMUD__DB_H__ */ #endif /* __WMUD__DB_H__ */

View File

@ -62,8 +62,13 @@
extern GSList *clients; extern GSList *clients;
gboolean wmud_networking_init(guint port_number, GMainContext *game_context, GSList *menu_items, GError **err); gboolean wmud_networking_init(guint port_number,
void wmud_client_quitanswer(WmudClient *client, gboolean answer); GMainContext *game_context,
void wmud_client_newchar_answer(WmudClient *client, gboolean answer); GSList *menu_items,
GError **err);
void wmud_client_quitanswer(WmudClient *client,
gboolean answer);
void wmud_client_newchar_answer(WmudClient *client,
gboolean answer);
#endif #endif

View File

@ -19,7 +19,7 @@
#ifndef __WMUD_GAME_H__ #ifndef __WMUD_GAME_H__
#define __WMUD_GAME_H__ #define __WMUD_GAME_H__
gboolean wmud_game_init(GThread **game_thread, GMainContext **game_context); gboolean wmud_game_init(GThread **game_thread,
GMainContext **game_context);
#endif /* __WMUD_GAME_H__ */ #endif /* __WMUD_GAME_H__ */

View File

@ -58,8 +58,8 @@ typedef enum {
WMUD_INTERPRETER_ERROR_DUPCMD WMUD_INTERPRETER_ERROR_DUPCMD
} wmudInterpreterError; } wmudInterpreterError;
gboolean wmud_interpreter_check_directions(GSList *directions, GError **err); gboolean wmud_interpreter_check_directions(GSList *directions,
GError **err);
void wmud_interpret_game_command(WmudClient *client); void wmud_interpret_game_command(WmudClient *client);
#endif /* __WMUD_INTERPRETER_H__ */ #endif /* __WMUD_INTERPRETER_H__ */

View File

@ -63,10 +63,13 @@ GSList *game_menu;
#define WMUD_MENU_ERROR wmud_menu_error_quark() #define WMUD_MENU_ERROR wmud_menu_error_quark()
GQuark wmud_menu_error_quark(); GQuark wmud_menu_error_quark();
gboolean wmud_menu_init(GSList **menu); gboolean wmud_menu_init(GSList **menu);
gboolean wmud_menu_items_check(GSList *menu_items, GError **err); gboolean wmud_menu_items_check(GSList *menu_items,
GError **err);
void wmud_menu_items_free(GSList **menu_items); void wmud_menu_items_free(GSList **menu_items);
gchar *wmud_menu_get_command_by_menuchar(gchar menuchar, GSList *game_menu); gchar *wmud_menu_get_command_by_menuchar(gchar menuchar,
void wmud_menu_execute_command(WmudClient *client, gchar *command); GSList *game_menu);
void wmud_menu_execute_command(WmudClient *client,
gchar *command);
void wmud_menu_present(WmudClient *client); void wmud_menu_present(WmudClient *client);
#endif /* __WMUD_MENU_H__ */ #endif /* __WMUD_MENU_H__ */

View File

@ -22,6 +22,7 @@
#include "wmudclient.h" #include "wmudclient.h"
void wmud_texts_init(void); void wmud_texts_init(void);
void wmud_text_send_to_client(gchar *text, WmudClient *client); void wmud_text_send_to_client(gchar *text,
WmudClient *client);
#endif /* __WMUD_TEXTS_H__ */ #endif /* __WMUD_TEXTS_H__ */

View File

@ -50,39 +50,47 @@ typedef struct _WmudClientPrivate WmudClientPrivate;
*/ */
typedef void (*WmudClientYesnoCallback)(WmudClient *client, gboolean answer); typedef void (*WmudClientYesnoCallback)(WmudClient *client, gboolean answer);
struct _WmudClient struct _WmudClient {
{
/*< private >*/ /*< private >*/
GObject parent_instance; GObject parent_instance;
WmudClientPrivate *priv; WmudClientPrivate *priv;
}; };
struct _WmudClientClass struct _WmudClientClass {
{
GObjectClass parent_class; GObjectClass parent_class;
}; };
GType wmud_client_get_type(void); GType wmud_client_get_type(void);
WmudClient *wmud_client_new(void); WmudClient *wmud_client_new(void);
void wmud_client_set_socket(WmudClient *client, GSocket *socket); void wmud_client_set_socket(WmudClient *client,
GSocket *socket);
GSocket *wmud_client_get_socket(WmudClient *client); GSocket *wmud_client_get_socket(WmudClient *client);
GSource *wmud_client_get_socket_source(WmudClient *client); GSource *wmud_client_get_socket_source(WmudClient *client);
void wmud_client_send(WmudClient *client, const gchar *fmt, ...); void wmud_client_send(WmudClient *client,
void wmud_client_close(WmudClient *self, gboolean send_goodbye); const gchar *fmt,
...);
void wmud_client_close(WmudClient *self,
gboolean send_goodbye);
GString *wmud_client_get_buffer(WmudClient *client); GString *wmud_client_get_buffer(WmudClient *client);
gsize wmud_client_get_buffer_length(WmudClient *client); gsize wmud_client_get_buffer_length(WmudClient *client);
void wmud_client_set_state(WmudClient *client, WmudClientState state); void wmud_client_set_state(WmudClient *client,
WmudClientState state);
WmudClientState wmud_client_get_state(WmudClient *client); WmudClientState wmud_client_get_state(WmudClient *client);
void wmud_client_set_player(WmudClient *client, WmudPlayer *player); void wmud_client_set_player(WmudClient *client,
WmudPlayer *player);
WmudPlayer *wmud_client_get_player(WmudClient *client); WmudPlayer *wmud_client_get_player(WmudClient *client);
void wmud_client_set_yesno_callback(WmudClient *client, WmudClientYesnoCallback yesno_callback); void wmud_client_set_yesno_callback(WmudClient *client,
WmudClientYesnoCallback yesno_callback);
WmudClientYesnoCallback wmud_client_get_yesno_callback(WmudClient *client); WmudClientYesnoCallback wmud_client_get_yesno_callback(WmudClient *client);
void wmud_client_set_authenticated(WmudClient *client, gboolean authenticated); void wmud_client_set_authenticated(WmudClient *client,
gboolean authenticated);
void wmud_client_increase_login_fail_count(WmudClient *client); void wmud_client_increase_login_fail_count(WmudClient *client);
gint wmud_client_get_login_fail_count(WmudClient *client); gint wmud_client_get_login_fail_count(WmudClient *client);
void wmud_client_set_bademail(WmudClient *client, gboolean bademail); void wmud_client_set_bademail(WmudClient *client,
gboolean bademail);
gboolean wmud_client_get_bademail(WmudClient *client); gboolean wmud_client_get_bademail(WmudClient *client);
guint32 wmud_client_get_last_recv_age(WmudClient *client); guint32 wmud_client_get_last_recv_age(WmudClient *client);
void wmud_client_set_context(WmudClient *client, GMainContext *context); void wmud_client_set_context(WmudClient *client,
GMainContext *context);
#endif /* __WMUD_WMUDCLIENT_H__ */ #endif /* __WMUD_WMUDCLIENT_H__ */

View File

@ -37,4 +37,3 @@ typedef enum {
} WmudClientState; } WmudClientState;
#endif /* __WMUD_CLIENT_STATE_H__ */ #endif /* __WMUD_CLIENT_STATE_H__ */

View File

@ -34,8 +34,7 @@ typedef struct _WmudPlayer WmudPlayer;
typedef struct _WmudPlayerClass WmudPlayerClass; typedef struct _WmudPlayerClass WmudPlayerClass;
typedef struct _WmudPlayerPrivate WmudPlayerPrivate; typedef struct _WmudPlayerPrivate WmudPlayerPrivate;
struct _WmudPlayer struct _WmudPlayer {
{
/*< private >*/ /*< private >*/
GObject parent_instance; GObject parent_instance;
@ -43,28 +42,32 @@ struct _WmudPlayer
WmudPlayerPrivate *priv; WmudPlayerPrivate *priv;
}; };
struct _WmudPlayerClass struct _WmudPlayerClass {
{
GObjectClass parent_class; GObjectClass parent_class;
}; };
GType wmud_player_get_type(void); GType wmud_player_get_type(void);
WmudPlayer *wmud_player_new(void); WmudPlayer *wmud_player_new(void);
void wmud_player_set_cpassword(WmudPlayer *player, const gchar *cpassword); void wmud_player_set_cpassword(WmudPlayer *player,
const gchar *cpassword);
gchar *wmud_player_get_cpassword(WmudPlayer *player); gchar *wmud_player_get_cpassword(WmudPlayer *player);
void wmud_player_set_registered(WmudPlayer *player, gboolean registered); void wmud_player_set_registered(WmudPlayer *player,
gboolean registered);
gboolean wmud_player_get_registered(WmudPlayer *player); gboolean wmud_player_get_registered(WmudPlayer *player);
void wmud_player_set_player_name(WmudPlayer *player, const gchar *name); void wmud_player_set_player_name(WmudPlayer *player,
const gchar *name);
gchar *wmud_player_get_player_name(WmudPlayer *player); gchar *wmud_player_get_player_name(WmudPlayer *player);
gint wmud_player_get_fail_count(WmudPlayer *player); gint wmud_player_get_fail_count(WmudPlayer *player);
void wmud_player_increase_fail_count(WmudPlayer *player); void wmud_player_increase_fail_count(WmudPlayer *player);
void wmud_player_reset_fail_count(WmudPlayer *player); void wmud_player_reset_fail_count(WmudPlayer *player);
void wmud_player_set_email(WmudPlayer *player, const gchar *email); void wmud_player_set_email(WmudPlayer *player,
const gchar *email);
gchar *wmud_player_get_email(WmudPlayer *player); gchar *wmud_player_get_email(WmudPlayer *player);
void wmud_player_set_id(WmudPlayer *player, guint32 id); void wmud_player_set_id(WmudPlayer *player,
guint32 id);
guint32 wmud_player_get_id(WmudPlayer *player); guint32 wmud_player_get_id(WmudPlayer *player);
WmudPlayer *wmud_player_dup(WmudPlayer *player); WmudPlayer *wmud_player_dup(WmudPlayer *player);
gboolean wmud_player_password_valid(WmudPlayer *player, const gchar *password); gboolean wmud_player_password_valid(WmudPlayer *player,
const gchar *password);
#endif /* __WMUD_WMUDPLAYER_H__ */ #endif /* __WMUD_WMUDPLAYER_H__ */

View File

@ -39,15 +39,13 @@ typedef struct _WmudWorld WmudWorld;
typedef struct _WmudWorldClass WmudWorldClass; typedef struct _WmudWorldClass WmudWorldClass;
typedef struct _WmudWorldPrivate WmudWorldPrivate; typedef struct _WmudWorldPrivate WmudWorldPrivate;
struct _WmudWorld struct _WmudWorld {
{
/*<private>*/ /*<private>*/
GObject parent_instance; GObject parent_instance;
WmudWorldPrivate *priv; WmudWorldPrivate *priv;
}; };
struct _WmudWorldClass struct _WmudWorldClass {
{
GObjectClass parent_class; GObjectClass parent_class;
}; };

View File

@ -134,18 +134,34 @@ typedef struct _wmudPlanetPlaneAssoc {
guint plane_id; guint plane_id;
} wmudPlanetPlaneAssoc; } wmudPlanetPlaneAssoc;
gboolean wmud_world_check_planes(GSList *planes, GError **err); gboolean wmud_world_check_planes(GSList *planes,
gboolean wmud_world_check_planets(GSList *planets, GError **err); GError **err);
gboolean wmud_world_check_areas(GSList *areas, GError **err); gboolean wmud_world_check_planets(GSList *planets,
gboolean wmud_world_check_rooms(GSList *rooms, GError **err); GError **err);
gboolean wmud_world_check_exits(GSList *exits, GSList *directions, GSList *rooms, GError **err); gboolean wmud_world_check_areas(GSList *areas,
GError **err);
gboolean wmud_world_check_rooms(GSList *rooms,
GError **err);
gboolean wmud_world_check_exits(GSList *exits,
GSList *directions,
GSList *rooms,
GError **err);
gboolean wmud_world_assoc_planets_planes(GSList *planets, GSList *planes, GSList *planet_planes, GError **err); gboolean wmud_world_assoc_planets_planes(GSList *planets,
gboolean wmud_world_assoc_rooms_areas(GSList *rooms, GSList *areas, GError **err); GSList *planes,
gboolean wmud_world_assoc_rooms_planets(GSList *rooms, GSList *planets, GError **err); GSList *planet_planes,
void wmud_world_assoc_exits_rooms(GSList *exits, GSList *directions, GSList *rooms, GError **err); GError **err);
gboolean wmud_world_assoc_rooms_areas(GSList *rooms,
GSList *areas,
GError **err);
gboolean wmud_world_assoc_rooms_planets(GSList *rooms,
GSList *planets,
GError **err);
void wmud_world_assoc_exits_rooms(GSList *exits,
GSList *directions,
GSList *rooms,
GError **err);
gboolean wmud_world_load(GError **err); gboolean wmud_world_load(GError **err);
#endif /* __WMUD_WORLD_H__ */ #endif /* __WMUD_WORLD_H__ */