<commit_before>/**
 * @brief NDR 'standard' common utilites
 *   Enduro Execution system platform library
 *
 * @file nstdutil.h
 */
/* -----------------------------------------------------------------------------
 * Enduro/X Middleware Platform for Distributed Transaction Processing
 * Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
 * Copyright (C) 2017-2019, Mavimax, Ltd. All Rights Reserved.
 * This software is released under one of the following licenses:
 * AGPL (with Java and Go exceptions) or Mavimax's license for commercial use.
 * See LICENSE file for full text.
 * -----------------------------------------------------------------------------
 * AGPL license:
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License, version 3 as published
 * by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE. See the GNU Affero General Public License, version 3
 * for more details.
 *
 * You should have received a copy of the GNU Affero General Public License along 
 * with this program; if not, write to the Free Software Foundation, Inc., 
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * -----------------------------------------------------------------------------
 * A commercial use license is available from Mavimax, Ltd
 * <EMAIL>
 * -----------------------------------------------------------------------------
 */
#ifndef NSTDUTIL_H
#define	NSTDUTIL_H

#ifdef	__cplusplus
extern "C" {
#endif
/*---------------------------Includes-----------------------------------*/
#include <ndrx_config.h>
#include <stdint.h>
#include <unistd.h>
#include <exhash.h>
#include <arpa/inet.h>
/*---------------------------Externs------------------------------------*/
/*---------------------------Macros-------------------------------------*/
    
/**
 * Quick env subst. via static buffer
 */
#define NDRX_QENV_SUBST(t, p) strncpy(t, p, sizeof(t)-1);\
                t[sizeof(t)-1] = (char)0;\
                ndrx_str_env_subs_len(t, sizeof(t));

   
/**
 * Access the GROWLIST element by index and cast to the type
 * @param LIST__ pointer to growlist
 * @param INDEX__ index to be accessed
 * @param TYPE__ pointer type
 */
#define NDRX_GROWLIST_ACCESS(LIST__, INDEX__, TYPE__) \
    (TYPE__*)(((char *)(LIST__)->mem) + (INDEX__) * (LIST__)->size)
            
#define NDRX_LOCALE_STOCK_DECSEP        '.'    /**< default decimal seperator */
    
/**
 * @defgroup argsgrp Value types for ndrx_args_ functions
 * @{
 */
#define NDRX_ARGS_BOOL                  1     /**< boolean type               */
#define NDRX_ARGS_INT                   2     /**< integer type               */
/** @} */ /* end of argsgrp */
    
    
#define NDRX_STOR_KBYTE                 1024    /**< number of bytes in KB    */

#if __BIG_ENDIAN__

#ifndef htonll
# define htonll(x) (x)
#endif

#ifndef ntohll
# define ntohll(x) (x)
#endif

#else
#ifndef htonll
# define htonll(x) (((uint64_t)htonl( (x) & 0xFFFFFFFF) << 32) | htonl( (x) >> 32))
#endif
#ifndef ntohll
# define ntohll(x) (((uint64_t)ntohl( (x) & 0xFFFFFFFF) << 32) | ntohl( (x) >> 32))
#endif
#endif
<commit_msg>Fixes for rpi<commit_after>/**
 * @brief NDR 'standard' common utilites
 *   Enduro Execution system platform library
 *
 * @file nstdutil.h
 */
/* -----------------------------------------------------------------------------
 * Enduro/X Middleware Platform for Distributed Transaction Processing
 * Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
 * Copyright (C) 2017-2019, Mavimax, Ltd. All Rights Reserved.
 * This software is released under one of the following licenses:
 * AGPL (with Java and Go exceptions) or Mavimax's license for commercial use.
 * See LICENSE file for full text.
 * -----------------------------------------------------------------------------
 * AGPL license:
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License, version 3 as published
 * by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE. See the GNU Affero General Public License, version 3
 * for more details.
 *
 * You should have received a copy of the GNU Affero General Public License along 
 * with this program; if not, write to the Free Software Foundation, Inc., 
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * -----------------------------------------------------------------------------
 * A commercial use license is available from Mavimax, Ltd
 * <EMAIL>
 * -----------------------------------------------------------------------------
 */
#ifndef NSTDUTIL_H
#define	NSTDUTIL_H

#ifdef	__cplusplus
extern "C" {
#endif
/*---------------------------Includes-----------------------------------*/
#include <ndrx_config.h>
#include <stdint.h>
#include <unistd.h>
#include <exhash.h>
#include <arpa/inet.h>
/*---------------------------Externs------------------------------------*/
/*---------------------------Macros-------------------------------------*/
    
/**
 * Quick env subst. via static buffer
 */
#define NDRX_QENV_SUBST(t, p) strncpy(t, p, sizeof(t)-1);\
                t[sizeof(t)-1] = (char)0;\
                ndrx_str_env_subs_len(t, sizeof(t));

   
/**
 * Access the GROWLIST element by index and cast to the type
 * @param LIST__ pointer to growlist
 * @param INDEX__ index to be accessed
 * @param TYPE__ pointer type
 */
#define NDRX_GROWLIST_ACCESS(LIST__, INDEX__, TYPE__) \
    (TYPE__*)(((char *)(LIST__)->mem) + (INDEX__) * (LIST__)->size)
            
#define NDRX_LOCALE_STOCK_DECSEP        '.'    /**< default decimal seperator */
    
/**
 * @defgroup argsgrp Value types for ndrx_args_ functions
 * @{
 */
#define NDRX_ARGS_BOOL                  1     /**< boolean type               */
#define NDRX_ARGS_INT                   2     /**< integer type               */
/** @} */ /* end of argsgrp */
    
    
#define NDRX_STOR_KBYTE                 1024    /**< number of bytes in KB    */


#if EX_SIZEOF_LONG==4 && EX_SIZEOF_INT==4

# define htonll(x) htonl(x)
# define ntohll(x) ntohl(x)

#else

#if __BIG_ENDIAN__

#ifndef htonll
# define htonll(x) (x)
#endif

#ifndef ntohll
# define ntohll(x) (x)
#endif

#else
#ifndef htonll
# define htonll(x) (((uint64_t)htonl( (x) & 0xFFFFFFFF) << 32) | htonl( (x) >> 32))
#endif
#ifndef ntohll
# define ntohll(x) (((uint64_t)ntohl( (x) & 0xFFFFFFFF) << 32) | ntohl( (x) >> 32))
#endif
#endif

#endif

{'fraction_non_alphanumeric': 0.24463077375698736, 'fraction_numerical': 0.016475433951162105, 'mean_word_length': 1.8188225538971807, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '1830054', 'n_tokens_mistral': 2055, 'n_tokens_neox': 1939, 'n_words': 671}