private void enumerateOneSegment(byte[] dir_chunk) throws ChmParsingException, TikaException {
//        try {
        if (dir_chunk != null) {
            int header_len;
            if (startsWith(dir_chunk, ChmConstants.CHM_PMGI_MARKER)) {
                header_len = ChmConstants.CHM_PMGI_LEN;
                return; //skip PMGI
            } else if (startsWith(dir_chunk, ChmConstants.PMGL)) {
                header_len = ChmConstants.CHM_PMGL_LEN;
            } else {
                throw new ChmParsingException("Bad dir entry block.");
            }

            placeHolder = header_len;
            //setPlaceHolder(header_len);
            while (placeHolder > 0 && placeHolder < dir_chunk.length - PMGLheader.getFreeSpace()
                /*&& dir_chunk[placeHolder - 1] != 115*/) {
                //get entry name length
                int strlen = 0;// = getEncint(data);
                byte temp;
                while ((temp = dir_chunk[placeHolder++]) >= 0x80) {
                    strlen <<= 7;
                    strlen += temp & 0x7f;
                }

                strlen = (strlen << 7) + temp & 0x7f;

                if (strlen > dir_chunk.length) {
                    throw new ChmParsingException("Bad data of a string length.");
                }

                DirectoryListingEntry dle = new DirectoryListingEntry();
                dle.setNameLength(strlen);
                dle.setName(new String(ChmCommons
                        .copyOfRange(dir_chunk, placeHolder, (placeHolder + dle.getNameLength())),
                        UTF_8));

                checkControlData(dle);
                checkResetTable(dle);
                setPlaceHolder(placeHolder + dle.getNameLength());

                /* Sets entry type */
                if (placeHolder < dir_chunk.length && dir_chunk[placeHolder] == 0) {
                    dle.setEntryType(ChmCommons.EntryType.UNCOMPRESSED);
                } else {
                    dle.setEntryType(ChmCommons.EntryType.COMPRESSED);
                }

                setPlaceHolder(placeHolder + 1);
                dle.setOffset(getEncint(dir_chunk));
                dle.setLength(getEncint(dir_chunk));
                getDirectoryListingEntryList().add(dle);
            }

//                int indexWorkData = ChmCommons.indexOf(dir_chunk,
//                        "::".getBytes(UTF_8));
//                int indexUserData = ChmCommons.indexOf(dir_chunk,
//                        "/".getBytes(UTF_8));
//
//                if (indexUserData>=0 && indexUserData < indexWorkData)
//                    setPlaceHolder(indexUserData);
//                else if (indexWorkData>=0) {
//                    setPlaceHolder(indexWorkData);
//                }
//                else {
//                    setPlaceHolder(indexUserData);
//                }
//
//                if (placeHolder > 0 && placeHolder < dir_chunk.length - PMGLheader.getFreeSpace()
//                        && dir_chunk[placeHolder - 1] != 115) {// #{
//                    do {
//                        if (dir_chunk[placeHolder - 1] > 0) {
//                            DirectoryListingEntry dle = new DirectoryListingEntry();
//
//                            // two cases: 1. when dir_chunk[placeHolder -
//                            // 1] == 0x73
//                            // 2. when dir_chunk[placeHolder + 1] == 0x2f
//                            doNameCheck(dir_chunk, dle);
//
//                            // dle.setName(new
//                            // String(Arrays.copyOfRange(dir_chunk,
//                            // placeHolder, (placeHolder +
//                            // dle.getNameLength()))));
//                            dle.setName(new String(ChmCommons.copyOfRange(
//                                    dir_chunk, placeHolder,
//                                    (placeHolder + dle.getNameLength())), UTF_8));
//                            checkControlData(dle);
//                            checkResetTable(dle);
//                            setPlaceHolder(placeHolder
//                                    + dle.getNameLength());
//
//                            /* Sets entry type */
//                            if (placeHolder < dir_chunk.length
//                                    && dir_chunk[placeHolder] == 0)
//                                dle.setEntryType(ChmCommons.EntryType.UNCOMPRESSED);
//                            else
//                                dle.setEntryType(ChmCommons.EntryType.COMPRESSED);
//
//                            setPlaceHolder(placeHolder + 1);
//                            dle.setOffset(getEncint(dir_chunk));
//                            dle.setLength(getEncint(dir_chunk));
//                            getDirectoryListingEntryList().add(dle);
//                        } else
//                            setPlaceHolder(placeHolder + 1);
//
//                    } while (nextEntry(dir_chunk));
//                }
        }

//        } catch (Exception e) {
//                LOG.warn("problem parsing", e);
//        }
    }
Enumerates chm directory listing entries in single chm segment

@param dir_chunk
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/chm/ChmDirectoryListingSet.java