Skip to content

Commit

Permalink
doveadm: Rename client_connection_type to doveadm_client_connection_type
Browse files Browse the repository at this point in the history
Move it to doveadm.h to allow plugins use doveadm-cmd.h
  • Loading branch information
cmouse committed Oct 28, 2017
1 parent d29c679 commit 2ba5e7d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/doveadm/client-connection-private.h
Expand Up @@ -7,7 +7,7 @@ bool doveadm_client_is_allowed_command(const struct doveadm_settings *set,
const char *cmd_name);

int client_connection_init(struct client_connection *conn,
enum client_connection_type type, pool_t pool, int fd);
enum doveadm_client_connection_type type, pool_t pool, int fd);
void client_connection_destroy(struct client_connection **_conn);

void client_connection_set_proctitle(struct client_connection *conn,
Expand Down
2 changes: 1 addition & 1 deletion src/doveadm/client-connection.c
Expand Up @@ -59,7 +59,7 @@ static int client_connection_read_settings(struct client_connection *conn)
}

int client_connection_init(struct client_connection *conn,
enum client_connection_type type, pool_t pool, int fd)
enum doveadm_client_connection_type type, pool_t pool, int fd)
{
const char *ip;

Expand Down
8 changes: 1 addition & 7 deletions src/doveadm/client-connection.h
Expand Up @@ -5,15 +5,9 @@

#define DOVEADM_LOG_CHANNEL_ID 'L'

enum client_connection_type {
CLIENT_CONNECTION_TYPE_CLI = 0,
CLIENT_CONNECTION_TYPE_TCP,
CLIENT_CONNECTION_TYPE_HTTP,
};

struct client_connection {
pool_t pool;
enum client_connection_type type;
enum doveadm_client_connection_type type;
const char *name;

struct ip_addr local_ip, remote_ip;
Expand Down
3 changes: 1 addition & 2 deletions src/doveadm/doveadm-cmd.h
Expand Up @@ -2,7 +2,6 @@
#define DOVEADM_CMD_H

#include "net.h"
#include "client-connection.h"

#define DOVEADM_CMD_PARAMS_START .parameters = (const struct doveadm_cmd_param[]){
#define DOVEADM_CMD_PARAM(optP, nameP, typeP, flagP ) { .short_opt = optP, .name = nameP, .type = typeP, .flags = flagP },
Expand Down Expand Up @@ -80,7 +79,7 @@ struct doveadm_cmd_context {
struct ip_addr local_ip, remote_ip;
in_port_t local_port, remote_port;

enum client_connection_type conn_type;
enum doveadm_client_connection_type conn_type;
struct istream *input;
struct ostream *output;
};
Expand Down
2 changes: 1 addition & 1 deletion src/doveadm/doveadm-kick.c
Expand Up @@ -28,7 +28,7 @@ struct kick_pid {
struct kick_context {
struct who_context who;
HASH_TABLE(void *, struct kick_pid *) pids;
enum client_connection_type conn_type;
enum doveadm_client_connection_type conn_type;
bool force_kick;
ARRAY(const char *) kicked_users;
};
Expand Down
9 changes: 8 additions & 1 deletion src/doveadm/doveadm.h
Expand Up @@ -3,7 +3,6 @@

#include <sysexits.h>
#include "doveadm-util.h"
#include "doveadm-cmd.h"
#include "doveadm-settings.h"

#define USAGE_CMDNAME_FMT " %-12s"
Expand All @@ -12,6 +11,14 @@
#define DOVEADM_EX_NOTPOSSIBLE EX_DATAERR
#define DOVEADM_EX_UNKNOWN -1

enum doveadm_client_connection_type {
CLIENT_CONNECTION_TYPE_CLI = 0,
CLIENT_CONNECTION_TYPE_TCP,
CLIENT_CONNECTION_TYPE_HTTP,
};

#include "doveadm-cmd.h"

extern bool doveadm_verbose_proctitle;
extern int doveadm_exit_code;

Expand Down

0 comments on commit 2ba5e7d

Please sign in to comment.