+static int _lmo_convert_entry(lua_State *L, int idx) {
+ lmo_luaentry_t *le = luaL_checkudata(L, idx, LMO_ENTRY_META);
+
+ lua_pushlstring(L,
+ &le->archive->mmap[le->entry->offset],
+ le->entry->length
+ );
+
+ return 1;
+}
+
+static int lmo_L_entry__tostring(lua_State *L) {
+ return _lmo_convert_entry(L, 1);
+}
+
+static int lmo_L_entry__concat(lua_State *L) {
+ if( lua_isuserdata(L, 1) )
+ _lmo_convert_entry(L, 1);
+ else
+ lua_pushstring(L, lua_tostring(L, 1));
+
+ if( lua_isuserdata(L, 2) )
+ _lmo_convert_entry(L, 2);
+ else
+ lua_pushstring(L, lua_tostring(L, 2));
+
+ lua_concat(L, 2);
+
+ return 1;
+}
+
+static int lmo_L_entry__len(lua_State *L) {
+ lmo_luaentry_t *le = luaL_checkudata(L, 1, LMO_ENTRY_META);
+ lua_pushinteger(L, le->entry->length);
+ return 1;
+}
+
+static int lmo_L_entry__gc(lua_State *L) {
+ lmo_luaentry_t *le = luaL_checkudata(L, 1, LMO_ENTRY_META);
+ le->archive = NULL;
+ le->entry = NULL;
+ return 0;
+}
+
+
+/* lmo method table */