aboutsummaryrefslogtreecommitdiff
path: root/src/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol')
-rw-r--r--src/protocol/ArgParser.cxx (renamed from src/protocol/argparser.c)18
-rw-r--r--src/protocol/ArgParser.hxx (renamed from src/protocol/argparser.h)20
-rw-r--r--src/protocol/Result.cxx (renamed from src/protocol/result.c)12
-rw-r--r--src/protocol/Result.hxx (renamed from src/protocol/result.h)19
4 files changed, 34 insertions, 35 deletions
diff --git a/src/protocol/argparser.c b/src/protocol/ArgParser.cxx
index d20437cb..6bd53a35 100644
--- a/src/protocol/argparser.c
+++ b/src/protocol/ArgParser.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,14 +18,14 @@
*/
#include "config.h"
-#include "argparser.h"
-#include "result.h"
+#include "ArgParser.hxx"
+#include "Result.hxx"
#include <glib.h>
#include <stdlib.h>
bool
-check_uint32(struct client *client, uint32_t *dst, const char *s)
+check_uint32(Client *client, uint32_t *dst, const char *s)
{
char *test;
@@ -39,7 +39,7 @@ check_uint32(struct client *client, uint32_t *dst, const char *s)
}
bool
-check_int(struct client *client, int *value_r, const char *s)
+check_int(Client *client, int *value_r, const char *s)
{
char *test;
long value;
@@ -64,7 +64,7 @@ check_int(struct client *client, int *value_r, const char *s)
}
bool
-check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
+check_range(Client *client, unsigned *value_r1, unsigned *value_r2,
const char *s)
{
char *test, *test2;
@@ -134,7 +134,7 @@ check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
}
bool
-check_unsigned(struct client *client, unsigned *value_r, const char *s)
+check_unsigned(Client *client, unsigned *value_r, const char *s)
{
unsigned long value;
char *endptr;
@@ -157,7 +157,7 @@ check_unsigned(struct client *client, unsigned *value_r, const char *s)
}
bool
-check_bool(struct client *client, bool *value_r, const char *s)
+check_bool(Client *client, bool *value_r, const char *s)
{
long value;
char *endptr;
@@ -174,7 +174,7 @@ check_bool(struct client *client, bool *value_r, const char *s)
}
bool
-check_float(struct client *client, float *value_r, const char *s)
+check_float(Client *client, float *value_r, const char *s)
{
float value;
char *endptr;
diff --git a/src/protocol/argparser.h b/src/protocol/ArgParser.hxx
index e88aea47..b6feb3e6 100644
--- a/src/protocol/argparser.h
+++ b/src/protocol/ArgParser.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,33 +17,33 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_PROTOCOL_ARGPARSER_H
-#define MPD_PROTOCOL_ARGPARSER_H
+#ifndef MPD_PROTOCOL_ARGPARSER_HXX
+#define MPD_PROTOCOL_ARGPARSER_HXX
#include "check.h"
#include <stdbool.h>
#include <stdint.h>
-struct client;
+class Client;
bool
-check_uint32(struct client *client, uint32_t *dst, const char *s);
+check_uint32(Client *client, uint32_t *dst, const char *s);
bool
-check_int(struct client *client, int *value_r, const char *s);
+check_int(Client *client, int *value_r, const char *s);
bool
-check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
+check_range(Client *client, unsigned *value_r1, unsigned *value_r2,
const char *s);
bool
-check_unsigned(struct client *client, unsigned *value_r, const char *s);
+check_unsigned(Client *client, unsigned *value_r, const char *s);
bool
-check_bool(struct client *client, bool *value_r, const char *s);
+check_bool(Client *client, bool *value_r, const char *s);
bool
-check_float(struct client *client, float *value_r, const char *s);
+check_float(Client *client, float *value_r, const char *s);
#endif
diff --git a/src/protocol/result.c b/src/protocol/Result.cxx
index 30cd0a26..e10a731c 100644
--- a/src/protocol/result.c
+++ b/src/protocol/Result.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,8 +18,8 @@
*/
#include "config.h"
-#include "result.h"
-#include "client.h"
+#include "Result.hxx"
+#include "Client.hxx"
#include <assert.h>
@@ -27,13 +27,13 @@ const char *current_command;
int command_list_num;
void
-command_success(struct client *client)
+command_success(Client *client)
{
client_puts(client, "OK\n");
}
void
-command_error_v(struct client *client, enum ack error,
+command_error_v(Client *client, enum ack error,
const char *fmt, va_list args)
{
assert(client != NULL);
@@ -48,7 +48,7 @@ command_error_v(struct client *client, enum ack error,
}
void
-command_error(struct client *client, enum ack error, const char *fmt, ...)
+command_error(Client *client, enum ack error, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
diff --git a/src/protocol/result.h b/src/protocol/Result.hxx
index 8b9e44bf..99d9a2fa 100644
--- a/src/protocol/result.h
+++ b/src/protocol/Result.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,28 +17,27 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_PROTOCOL_RESULT_H
-#define MPD_PROTOCOL_RESULT_H
+#ifndef MPD_PROTOCOL_RESULT_HXX
+#define MPD_PROTOCOL_RESULT_HXX
#include "check.h"
+#include "gcc.h"
#include "ack.h"
-#include <glib.h>
-
-struct client;
+class Client;
extern const char *current_command;
extern int command_list_num;
void
-command_success(struct client *client);
+command_success(Client *client);
void
-command_error_v(struct client *client, enum ack error,
+command_error_v(Client *client, enum ack error,
const char *fmt, va_list args);
-G_GNUC_PRINTF(3, 4)
+gcc_fprintf_
void
-command_error(struct client *client, enum ack error, const char *fmt, ...);
+command_error(Client *client, enum ack error, const char *fmt, ...);
#endif