From b897cb1ec31f2404ecfdddf9da8ad2e106b72278 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 7 Apr 2005 20:25:22 +0000 Subject: Change conn_(type|state)_to_string from const arrays to switch functions so we (I) will not make Tor crash the next time we (I) add a new state. svn:r4045 --- src/or/or.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/or/or.h') diff --git a/src/or/or.h b/src/or/or.h index 09b1fbc5a1..ac3ceb81c7 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1252,11 +1252,8 @@ int save_current_config(void); /********************************* connection.c ***************************/ -#define CONN_TYPE_TO_STRING(t) (((t) < _CONN_TYPE_MIN || (t) > _CONN_TYPE_MAX) ? \ - "Unknown" : conn_type_to_string[(t)]) - -extern const char *conn_type_to_string[]; -extern const char *conn_state_to_string[][_CONN_TYPE_MAX+1]; +const char *conn_type_to_string(int type); +const char *conn_state_to_string(int type, int state); connection_t *connection_new(int type); void connection_unregister(connection_t *conn); -- cgit v1.2.3-54-g00ecf