<commit_before>#ifndef _HAD_ZIP_H
#define _HAD_ZIP_H

#include <sys/types.h>
#include <stdio.h>
#include <zlib.h>

enum zip_state { ZIP_ST_UNCHANGED, ZIP_ST_DELETED, ZIP_ST_REPLACED,
		 ZIP_ST_ADDED, ZIP_ST_RENAMED };
enum zip_cmd { ZIP_CMD_INIT, ZIP_CMD_READ, ZIP_CMD_META, ZIP_CMD_CLOSE };

/* flags for zip_open */
#define ZIP_CREATE           1
#define ZIP_EXCL             2
#define ZIP_CHECKCONS        4

int zip_err; /* global variable for errors returned by the low-level
		library */

#define ZERR_OK               0  /* no error */
#define ZERR_MULTIDISK        1  /* multi-disk zip-files not supported */
#define ZERR_RENAME           2  /* replacing zipfile with tempfile failed */
#define ZERR_CLOSE            3  /* closing zipfile failed */
#define ZERR_SEEK             4  /* seek error */
#define ZERR_READ             5  /* read error */
#define ZERR_WRITE            6  /* write error */
#define ZERR_CRC              7  /* CRC error */
#define ZERR_ZIPCLOSED        8  /* containing zip file was closed */
#define ZERR_NOENT            9  /* no such file */
#define ZERR_EXISTS          10  /* file already exists */
#define ZERR_OPEN            11  /* can't open file */
#define ZERR_TMPOPEN         12  /* failure to create temporary file */
#define ZERR_ZLIB            13  /* zlib error */
#define ZERR_MEMORY          14  /* malloc failure */
#define ZERR_CHANGED         15  /* entry has been changed */
#define ZERR_COMPNOTSUPP     16  /* compression method not supported */
#define ZERR_EOF             17  /* premature EOF */
#define ZERR_INVAL           18  /* invalid argument */
#define ZERR_NOZIP           19  /* not a zip file */

extern char *zip_err_str[];

/* zip file */

typedef int (*zip_read_func)(void *state, void *data,
			     int len, enum zip_cmd cmd);

struct zip {
    char *zn;
    FILE *zp;
    unsigned short comlen, changes;
    unsigned int cd_size, cd_offset;
    char *com;
    int nentry, nentry_alloc;
    struct zip_entry *entry;
    int nfile, nfile_alloc;
    struct zip_file **file;
};

/* file in zip file */

struct zip_file {
    struct zip *zf;
    char *name;
    int flags; /* -1: eof, >0: error */<commit_msg>*** empty log message ***<commit_after>#ifndef _HAD_ZIP_H
#define _HAD_ZIP_H

#include <sys/types.h>
#include <stdio.h>
#include <zlib.h>

enum zip_state { ZIP_ST_UNCHANGED, ZIP_ST_DELETED, ZIP_ST_REPLACED,
		 ZIP_ST_ADDED, ZIP_ST_RENAMED };
enum zip_cmd { ZIP_CMD_INIT, ZIP_CMD_READ, ZIP_CMD_META, ZIP_CMD_CLOSE };

/* flags for zip_open */
#define ZIP_CREATE           1
#define ZIP_EXCL             2
#define ZIP_CHECKCONS        4

int zip_err; /* global variable for errors returned by the low-level
		library */

#define ZERR_OK               0  /* no error */
#define ZERR_MULTIDISK        1  /* multi-disk zip-files not supported */
#define ZERR_RENAME           2  /* replacing zipfile with tempfile failed */
#define ZERR_CLOSE            3  /* closing zipfile failed */
#define ZERR_SEEK             4  /* seek error */
#define ZERR_READ             5  /* read error */
#define ZERR_WRITE            6  /* write error */
#define ZERR_CRC              7  /* CRC error */
#define ZERR_ZIPCLOSED        8  /* containing zip file was closed */
#define ZERR_NOENT            9  /* no such file */
#define ZERR_EXISTS          10  /* file already exists */
#define ZERR_OPEN            11  /* can't open file */
#define ZERR_TMPOPEN         12  /* failure to create temporary file */
#define ZERR_ZLIB            13  /* zlib error */
#define ZERR_MEMORY          14  /* malloc failure */
#define ZERR_CHANGED         15  /* entry has been changed */
#define ZERR_COMPNOTSUPP     16  /* compression method not supported */
#define ZERR_EOF             17  /* premature EOF */
#define ZERR_INVAL           18  /* invalid argument */
#define ZERR_NOZIP           19  /* not a zip file */
#define ZERR_INTERNAL        20  /* internal error */

extern char *zip_err_str[];

/* zip file */

typedef int (*zip_read_func)(void *state, void *data,
			     int len, enum zip_cmd cmd);

struct zip {
    char *zn;
    FILE *zp;
    unsigned short comlen, changes;
    unsigned int cd_size, cd_offset;
    char *com;
    int nentry, nentry_alloc;
    struct zip_entry *entry;
    int nfile, nfile_alloc;
    struct zip_file **file;
};

/* file in zip file */

struct zip_file {
    struct zip *zf;
    char *name;
    int flags; /* -1: eof, >0: error */
{'fraction_non_alphanumeric': 0.09602349751468595, 'fraction_numerical': 0.016267510167193855, 'mean_word_length': 2.2841246290801185, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4752123', 'n_tokens_mistral': 1517, 'n_tokens_neox': 1467, 'n_words': 465}