file: use enum for state

Makes debugging easier.
pull/3201/head
Victor Julien 8 years ago
parent 3a2e4614d0
commit ce08a43bda

@ -64,7 +64,7 @@ typedef enum FileState_ {
typedef struct File_ {
uint16_t flags;
uint16_t name_len;
int16_t state;
FileState state;
StreamingBuffer *sb;
uint64_t txid; /**< tx this file is part of */
uint32_t file_track_id; /**< id used by protocol parser. Optional

@ -803,6 +803,14 @@ static int LuaCallbackFileStatePushToStackFromFile(lua_State *luastate, const Fi
case FILE_STATE_ERROR:
state = "ERROR";
break;
case FILE_STATE_OPENED:
state = "OPENED";
break;
case FILE_STATE_NONE:
state = "NONE";
break;
case FILE_STATE_MAX:
break;
}
lua_pushstring (luastate, state);

Loading…
Cancel
Save