<commit_before>/*
 * $Id$
 *
 * Copyright (c) 2014, Juniper Networks, Inc.
 * All rights reserved.
 * This SOFTWARE is licensed under the LICENSE provided in the
 * ../Copyright file. By downloading, installing, copying, or otherwise
 * using the SOFTWARE, you agree to be bound by the terms of that
 * LICENSE.
 */
#define DB_FULL_NS "http://xml.libslax.org/db"
#define DB_NAME_SIZE 12

#define DB_DRIVER_INIT_NAME "db_driver_init"
#define DB_DRIVER_VERSION 1


/*
 * Various status codes returned from database drivers. We take action and
 * provide information to the user based on the return code received from
 * driver callback
 */
typedef enum db_ret_e {
    DB_DATA,    /* DB engine returned data to the user */
    DB_DONE,    /* No more data */
    DB_ERROR,   /* Error occured. See message in *out */
    DB_FAIL,    /* Unknown failure */
    DB_OK       /* Operation succeded with no return data */
} db_ret_t;

/*
 * Structure that holds input from user
 */
typedef struct db_input_s {
    char *di_engine;            /* Database engine name */
    char *di_database;          /* Database name */
    char *di_collection;        /* Table name */
    unsigned int di_limit;      /* Limit for result instances */
    unsigned int di_skip;       /* skip over these number of instances */
    xmlNodePtr di_access;       /* Connection parameters to the database */
    xmlNodePtr di_fields;       /* Fields when creating table */
    xmlNodePtr di_instance;     /* Row that need to be inserted */
    xmlNodePtr di_instances;    /* Rows that need to be inserted */
    xmlNodePtr di_conditions;   /* Conditions when inserting/finding data */
    xmlNodePtr di_constraints;  /* Constraints when creating sql table */
    xmlNodePtr di_sort;         /* Result sorting order */
    xmlNodePtr di_retrieve;     /* Subset of fields to retrieve */
    xmlNodePtr di_update;       /* New data to update instances with */
    xmlNodePtr di_access;       /* Access details for database engine */
    slax_printf_buffer_t di_buf;/* Hold a string buffer */
} db_input_t;

/*
 * Forward declare db_handle_s
 */
typedef struct db_handle_s db_handle_t;<commit_msg>Remove duplicate di_access entry<commit_after>/*
 * $Id$
 *
 * Copyright (c) 2014, Juniper Networks, Inc.
 * All rights reserved.
 * This SOFTWARE is licensed under the LICENSE provided in the
 * ../Copyright file. By downloading, installing, copying, or otherwise
 * using the SOFTWARE, you agree to be bound by the terms of that
 * LICENSE.
 */
#define DB_FULL_NS "http://xml.libslax.org/db"
#define DB_NAME_SIZE 12

#define DB_DRIVER_INIT_NAME "db_driver_init"
#define DB_DRIVER_VERSION 1


/*
 * Various status codes returned from database drivers. We take action and
 * provide information to the user based on the return code received from
 * driver callback
 */
typedef enum db_ret_e {
    DB_DATA,    /* DB engine returned data to the user */
    DB_DONE,    /* No more data */
    DB_ERROR,   /* Error occured. See message in *out */
    DB_FAIL,    /* Unknown failure */
    DB_OK       /* Operation succeded with no return data */
} db_ret_t;

/*
 * Structure that holds input from user
 */
typedef struct db_input_s {
    char *di_engine;            /* Database engine name */
    char *di_database;          /* Database name */
    char *di_collection;        /* Table name */
    unsigned int di_limit;      /* Limit for result instances */
    unsigned int di_skip;       /* skip over these number of instances */
    xmlNodePtr di_access;       /* Connection parameters to the database */
    xmlNodePtr di_fields;       /* Fields when creating table */
    xmlNodePtr di_instance;     /* Row that need to be inserted */
    xmlNodePtr di_instances;    /* Rows that need to be inserted */
    xmlNodePtr di_conditions;   /* Conditions when inserting/finding data */
    xmlNodePtr di_constraints;  /* Constraints when creating sql table */
    xmlNodePtr di_sort;         /* Result sorting order */
    xmlNodePtr di_retrieve;     /* Subset of fields to retrieve */
    xmlNodePtr di_update;       /* New data to update instances with */
    slax_printf_buffer_t di_buf;/* Hold a string buffer */
} db_input_t;

/*
 * Forward declare db_handle_s
 */
typedef struct db_handle_s db_handle_t;
{'fraction_non_alphanumeric': 0.08372420262664165, 'fraction_numerical': 0.003283302063789869, 'mean_word_length': 2.7978628673196795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 21}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1741482', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1183, 'n_words': 463}