driver: move type-definitions up top
Keep the normal order with type definitions first, then static
variables, followed by function definitions.
#include "peer.h"
#include "socket.h"
+typedef struct DriverMethod DriverMethod;
+typedef int (*DriverMethodFn) (Peer *peer, CDVar *var_in, CDVar *var_out);
+
+struct DriverMethod {
+ const char *name;
+ DriverMethodFn fn;
+ const CDVarType *in;
+ const CDVarType *out;
+};
+
/*
* This macro defines a c-dvar type for DBus Messages. It evaluates to:
*
@@ -150,16 +160,6 @@ static const CDVarType driver_type_out_apsv[] = {
)
};
-typedef struct DriverMethod DriverMethod;
-typedef int (*DriverMethodFn) (Peer *peer, CDVar *var_in, CDVar *var_out);
-
-struct DriverMethod {
- const char *name;
- DriverMethodFn fn;
- const CDVarType *in;
- const CDVarType *out;
-};
-
static void driver_write_bytes(CDVar *var, char *bytes, size_t n_bytes) {
/* XXX: check how the dbus daemon deals with this potentially including a zero byte */
