summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-04-07 20:25:22 +0000
committerNick Mathewson <nickm@torproject.org>2005-04-07 20:25:22 +0000
commitb897cb1ec31f2404ecfdddf9da8ad2e106b72278 (patch)
tree0886ec32a4b7c0b471b6ae6c04552a8b0b9648f9 /src/or/or.h
parent3a0fb0f00775b961e282d1c4a7ec034bee3cdb14 (diff)
downloadtor-b897cb1ec31f2404ecfdddf9da8ad2e106b72278.tar.gz
tor-b897cb1ec31f2404ecfdddf9da8ad2e106b72278.zip
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
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h7
1 files changed, 2 insertions, 5 deletions
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);