Commit 607753a2 607753a27c22aa1fb47ba50acb6445f3e2a6edd8 by Sergey Poznyakoff

Keep the namespace clean.

1 parent 18590880
......@@ -441,7 +441,7 @@ refile (struct mh_whatnow_env *wh, int argc, char **argv, int *status)
/* Send action */
static int
send (struct mh_whatnow_env *wh, int argc, char **argv, int *status)
call_send (struct mh_whatnow_env *wh, int argc, char **argv, int *status)
{
if (invoke ("sendproc", MHBINDIR "/send", argc, argv, wh->file, NULL) == 0)
annotate (wh);
......@@ -541,7 +541,7 @@ static struct action_tab whatnow_tab[] = {
{ "push", push },
{ "quit", quit },
{ "refile", refile },
{ "send", send },
{ "send", call_send },
{ "whom", whom },
{ NULL }
};
......
......@@ -696,7 +696,7 @@ _action_send (void *item, void *data)
}
static int
send (int argc, char **argv)
do_send (int argc, char **argv)
{
int i, rc;
char *p;
......@@ -762,5 +762,5 @@ main (int argc, char **argv)
argc = 1;
}
return send (argc, argv);
return do_send (argc, argv);
}
......
......@@ -61,7 +61,7 @@ do_mysql_query (mu_sql_connection_t conn, char *query)
/* Interface routines */
static int
init (mu_sql_connection_t conn)
mu_mysql_init (mu_sql_connection_t conn)
{
struct mu_mysql_data *mp = calloc (1, sizeof (*mp));
if (!mp)
......@@ -71,7 +71,7 @@ init (mu_sql_connection_t conn)
}
static int
destroy (mu_sql_connection_t conn)
mu_mysql_destroy (mu_sql_connection_t conn)
{
struct mu_mysql_data *mp = conn->data;
free (mp->mysql);
......@@ -82,7 +82,7 @@ destroy (mu_sql_connection_t conn)
static int
connect (mu_sql_connection_t conn)
mu_mysql_connect (mu_sql_connection_t conn)
{
struct mu_mysql_data *mp = conn->data;
char *host, *socket_name = NULL;
......@@ -115,7 +115,7 @@ connect (mu_sql_connection_t conn)
}
static int
disconnect (mu_sql_connection_t conn)
mu_mysql_disconnect (mu_sql_connection_t conn)
{
struct mu_mysql_data *mp = conn->data;
......@@ -126,7 +126,7 @@ disconnect (mu_sql_connection_t conn)
}
static int
query (mu_sql_connection_t conn, char *query)
mu_mysql_query (mu_sql_connection_t conn, char *query)
{
if (do_mysql_query (conn, query))
return MU_ERR_SQL;
......@@ -135,7 +135,7 @@ query (mu_sql_connection_t conn, char *query)
static int
store_result (mu_sql_connection_t conn)
mu_mysql_store_result (mu_sql_connection_t conn)
{
struct mu_mysql_data *mp = conn->data;
if (!(mp->result = mysql_store_result (mp->mysql)))
......@@ -148,7 +148,7 @@ store_result (mu_sql_connection_t conn)
}
static int
release_result (mu_sql_connection_t conn)
mu_mysql_release_result (mu_sql_connection_t conn)
{
struct mu_mysql_data *mp = conn->data;
mysql_free_result (mp->result);
......@@ -157,7 +157,7 @@ release_result (mu_sql_connection_t conn)
}
static int
num_columns (mu_sql_connection_t conn, size_t *np)
mu_mysql_num_columns (mu_sql_connection_t conn, size_t *np)
{
struct mu_mysql_data *mp = conn->data;
*np = mysql_num_fields (mp->result);
......@@ -165,7 +165,7 @@ num_columns (mu_sql_connection_t conn, size_t *np)
}
static int
num_tuples (mu_sql_connection_t conn, size_t *np)
mu_mysql_num_tuples (mu_sql_connection_t conn, size_t *np)
{
struct mu_mysql_data *mp = conn->data;
*np = mysql_num_rows (mp->result);
......@@ -173,7 +173,8 @@ num_tuples (mu_sql_connection_t conn, size_t *np)
}
static int
get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol, char **pdata)
mu_mysql_get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol,
char **pdata)
{
struct mu_mysql_data *mp = conn->data;
MYSQL_ROW row;
......@@ -191,7 +192,8 @@ get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol, char **pdata)
}
static int
get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno)
mu_mysql_get_field_number (mu_sql_connection_t conn, const char *fname,
size_t *fno)
{
struct mu_mysql_data *mp = conn->data;
MYSQL_FIELD *fields;
......@@ -212,7 +214,7 @@ get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno)
}
static const char *
errstr (mu_sql_connection_t conn)
mu_mysql_errstr (mu_sql_connection_t conn)
{
struct mu_mysql_data *mp = conn->data;
return mysql_error (mp->mysql);
......@@ -355,17 +357,17 @@ mu_check_mysql_scrambled_password (const char *scrambled, const char *message)
MU_DECL_SQL_DISPATCH_T(mysql) = {
"mysql",
3306,
init,
destroy,
connect,
disconnect,
query,
store_result,
release_result,
num_tuples,
num_columns,
get_column,
get_field_number,
errstr,
mu_mysql_init,
mu_mysql_destroy,
mu_mysql_connect,
mu_mysql_disconnect,
mu_mysql_query,
mu_mysql_store_result,
mu_mysql_release_result,
mu_mysql_num_tuples,
mu_mysql_num_columns,
mu_mysql_get_column,
mu_mysql_get_field_number,
mu_mysql_errstr,
};
......
......@@ -60,7 +60,7 @@ mu_odbc_diag(struct mu_odbc_data *dp,
/* Interface routines */
static int
init (mu_sql_connection_t conn)
odbc_init (mu_sql_connection_t conn)
{
struct mu_odbc_data *dp = calloc (1, sizeof (*dp));
if (!dp)
......@@ -70,7 +70,7 @@ init (mu_sql_connection_t conn)
}
static int
destroy (mu_sql_connection_t conn)
odbc_destroy (mu_sql_connection_t conn)
{
struct mu_odbc_data *dp = conn->data;
free (dp->err.msg);
......@@ -83,7 +83,7 @@ destroy (mu_sql_connection_t conn)
}
static int
connect (mu_sql_connection_t conn)
odbc_connect (mu_sql_connection_t conn)
{
struct mu_odbc_data *dp = conn->data;
long rc;
......@@ -124,7 +124,7 @@ connect (mu_sql_connection_t conn)
}
static int
disconnect (mu_sql_connection_t conn)
odbc_disconnect (mu_sql_connection_t conn)
{
struct mu_odbc_data *dp = conn->data;
SQLDisconnect (dp->dbc);
......@@ -133,7 +133,7 @@ disconnect (mu_sql_connection_t conn)
}
static int
query (mu_sql_connection_t conn, char *query)
odbc_query (mu_sql_connection_t conn, char *query)
{
struct mu_odbc_data *dp = conn->data;
long rc;
......@@ -171,7 +171,7 @@ query (mu_sql_connection_t conn, char *query)
}
static int
store_result (mu_sql_connection_t conn)
odbc_store_result (mu_sql_connection_t conn)
{
struct mu_odbc_data *dp = conn->data;
mu_list_create (&dp->result);
......@@ -179,17 +179,17 @@ store_result (mu_sql_connection_t conn)
}
static int
free_char_data (void *item, void *data MU_ARG_UNUSED)
odbc_free_char_data (void *item, void *data MU_ARG_UNUSED)
{
free (item);
return 0;
}
static int
release_result (mu_sql_connection_t conn)
odbc_release_result (mu_sql_connection_t conn)
{
struct mu_odbc_data *dp = conn->data;
mu_list_do (dp->result, free_char_data, NULL);
mu_list_do (dp->result, odbc_free_char_data, NULL);
mu_list_destroy (&dp->result);
mu_argcv_free (dp->fcount, dp->fnames);
dp->fcount = 0;
......@@ -198,7 +198,7 @@ release_result (mu_sql_connection_t conn)
}
static int
num_columns (mu_sql_connection_t conn, size_t *np)
odbc_num_columns (mu_sql_connection_t conn, size_t *np)
{
struct mu_odbc_data *dp = conn->data;
SQLSMALLINT count;
......@@ -217,7 +217,7 @@ num_columns (mu_sql_connection_t conn, size_t *np)
}
static int
num_tuples (mu_sql_connection_t conn, size_t *np)
odbc_num_tuples (mu_sql_connection_t conn, size_t *np)
{
struct mu_odbc_data *dp = conn->data;
SQLINTEGER count;
......@@ -232,7 +232,8 @@ num_tuples (mu_sql_connection_t conn, size_t *np)
}
static int
get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol, char **pdata)
odbc_get_column (mu_sql_connection_t conn,
size_t nrow, size_t ncol, char **pdata)
{
struct mu_odbc_data *dp = conn->data;
char buffer[1024];
......@@ -258,7 +259,8 @@ get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol, char **pdata)
/* FIXME: untested */
static int
get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno)
odbc_get_field_number (mu_sql_connection_t conn, const char *fname,
size_t *fno)
{
size_t count;
struct mu_odbc_data *dp = conn->data;
......@@ -268,7 +270,7 @@ get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno)
{
int rc;
rc = num_columns (conn, &count);
rc = odbc_num_columns (conn, &count);
if (rc)
return rc;
dp->fnames = calloc(count + 1, sizeof dp->fnames[0]);
......@@ -335,7 +337,7 @@ get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno)
#define DEFAULT_ERROR_BUFFER_SIZE 1024
static const char *
errstr (mu_sql_connection_t conn)
odbc_errstr (mu_sql_connection_t conn)
{
struct mu_odbc_data *dp = conn->data;
char state[16];
......@@ -380,16 +382,16 @@ errstr (mu_sql_connection_t conn)
MU_DECL_SQL_DISPATCH_T(odbc) = {
"odbc",
0,
init,
destroy,
connect,
disconnect,
query,
store_result,
release_result,
num_tuples,
num_columns,
get_column,
get_field_number,
errstr,
odbc_init,
odbc_destroy,
odbc_connect,
odbc_disconnect,
odbc_query,
odbc_store_result,
odbc_release_result,
odbc_num_tuples,
odbc_num_columns,
odbc_get_column,
odbc_get_field_number,
odbc_errstr,
};
......
......@@ -46,7 +46,7 @@ struct mu_pgsql_data
static int
init (mu_sql_connection_t conn)
postgres_init (mu_sql_connection_t conn)
{
struct mu_pgsql_data *dp = calloc (1, sizeof (*dp));
if (!dp)
......@@ -56,7 +56,7 @@ init (mu_sql_connection_t conn)
}
static int
destroy (mu_sql_connection_t conn)
postgres_destroy (mu_sql_connection_t conn)
{
struct mu_pgsql_data *dp = conn->data;
free (dp);
......@@ -65,7 +65,7 @@ destroy (mu_sql_connection_t conn)
}
static int
connect (mu_sql_connection_t conn)
postgres_connect (mu_sql_connection_t conn)
{
struct mu_pgsql_data *dp = conn->data;
char portbuf[16];
......@@ -88,7 +88,7 @@ connect (mu_sql_connection_t conn)
}
static int
disconnect (mu_sql_connection_t conn)
postgres_disconnect (mu_sql_connection_t conn)
{
struct mu_pgsql_data *dp = conn->data;
PQfinish (dp->pgconn);
......@@ -96,7 +96,7 @@ disconnect (mu_sql_connection_t conn)
}
static int
query (mu_sql_connection_t conn, char *query)
postgres_query (mu_sql_connection_t conn, char *query)
{
struct mu_pgsql_data *dp = conn->data;
ExecStatusType stat;
......@@ -114,13 +114,13 @@ query (mu_sql_connection_t conn, char *query)
}
static int
store_result (mu_sql_connection_t conn)
postgres_store_result (mu_sql_connection_t conn)
{
return 0;
}
static int
release_result (mu_sql_connection_t conn)
postgres_release_result (mu_sql_connection_t conn)
{
struct mu_pgsql_data *dp = conn->data;
PQclear (dp->res);
......@@ -129,7 +129,7 @@ release_result (mu_sql_connection_t conn)
}
static int
num_columns (mu_sql_connection_t conn, size_t *np)
postgres_num_columns (mu_sql_connection_t conn, size_t *np)
{
struct mu_pgsql_data *dp = conn->data;
if (!dp->res)
......@@ -139,7 +139,7 @@ num_columns (mu_sql_connection_t conn, size_t *np)
}
static int
num_tuples (mu_sql_connection_t conn, size_t *np)
postgres_num_tuples (mu_sql_connection_t conn, size_t *np)
{
struct mu_pgsql_data *dp = conn->data;
if (!dp->res)
......@@ -149,7 +149,8 @@ num_tuples (mu_sql_connection_t conn, size_t *np)
}
static int
get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol, char **pdata)
postgres_get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol,
char **pdata)
{
struct mu_pgsql_data *dp = conn->data;
if (!dp->res)
......@@ -159,7 +160,8 @@ get_column (mu_sql_connection_t conn, size_t nrow, size_t ncol, char **pdata)
}
static int
get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno)
postgres_get_field_number (mu_sql_connection_t conn, const char *fname,
size_t *fno)
{
struct mu_pgsql_data *dp = conn->data;
if (!dp->res)
......@@ -170,7 +172,7 @@ get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno)
}
static const char *
errstr (mu_sql_connection_t conn)
postgres_errstr (mu_sql_connection_t conn)
{
struct mu_pgsql_data *dp = conn->data;
return PQerrorMessage (dp->pgconn);
......@@ -180,18 +182,18 @@ errstr (mu_sql_connection_t conn)
MU_DECL_SQL_DISPATCH_T(postgres) = {
"postgres",
5432,
init,
destroy,
connect,
disconnect,
query,
store_result,
release_result,
num_tuples,
num_columns,
get_column,
get_field_number,
errstr,
postgres_init,
postgres_destroy,
postgres_connect,
postgres_disconnect,
postgres_query,
postgres_store_result,
postgres_release_result,
postgres_num_tuples,
postgres_num_columns,
postgres_get_column,
postgres_get_field_number,
postgres_errstr,
};
#endif
......