<commit_before>/**
 * \file popt/system.h
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS 1
#endif


#if defined (__GLIBC__) && defined(__LCLINT__)
/*@-declundef@*/
/*@unchecked@*/
extern __const __int32_t *__ctype_tolower;
/*@unchecked@*/
extern __const __int32_t *__ctype_toupper;
/*@=declundef@*/
#endif

#include <ctype.h>


#ifdef __GNUC__
# undef alloca
# define alloca __builtin_alloca
#else
# ifdef HAVE_ALLOCA_H
#  include <alloca.h>
# else
#  ifndef _AIX
/* AIX alloca decl has to be the first thing in the file, bletch! */
char *alloca ();
#  endif
# endif
#endif


/* XXX isspace(3) has i18n encoding signednesss issues on Solaris. */
#define	_isspaceptr(_chp)	isspace((int)(*(unsigned char *)(_chp)))

#include <errno.h>
#include <fcntl.h>
#include <limits.h>

#ifdef HAVE_MCHECK_H
#include <mcheck.h>
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#if defined(HAVE_UNISTD_H) && !defined(__LCLINT__)
#include <unistd.h>
#endif

#ifdef _MSC_VER
#include <io.h>
#include <malloc.h>
#endif

#ifdef __NeXT
/* access macros are not declared in non posix mode in unistd.h -
 don't try to use posix on NeXTstep 3.3 ! */
#include <libc.h>
#endif


#if defined(_MSC_VER) || defined(__STDC__)
#  define inline __inline
#endif /* _MSC_VER */


#ifdef _MSC_VER

#define F_OK 0
#define R_OK 4
#define W_OK 2
#define X_OK 1

#define S_IRWXG 00000070
#define S_IRWXO 00000007
#define S_ISUID 00040000
#define S_ISGID 00020000
#define S_ISVTX 00010000


/* CHECKME */
#define S_IWGRP 00000020
#define S_IWOTH 00000002

#define S_ISREG(m) ((m)&_S_IFREG)


/* Documentation claims these are in limits.h, but it seems to be a lie */
/* Microsoft documentation http://msdn.microsoft.com/en-us/library/k15zsh48.aspx */

#if !defined(FLT_MIN)
#define FLT_MIN 1.175494351e-38F
#endif

#if !defined(FLT_MAX)
#define FLT_MAX 3.402823466e+38F
#endif

typedef int uid_t;

#ifdef _WIN64
typedef __int64 ssize_t;
#else
typedef int ssize_t;
#endif /* _WIN64 */

#define srandom srand
#define random rand
#define access _access
#define strdup _strdup
#define execvp _execvp
#define strtoll _strtoi64
#define read _read
#define open _open
#define close _close
#define lseek _lseek

/* Pretend to be root to replace these */
inline int setuid(int x) { return 1; }
inline int getuid(void) { return 0; }

inline int seteuid(int x) { return 1; }
inline int geteuid(void) { return 0; }

inline int setgid(int x) { return 1; }
inline int getgid(void) { return 0; }

inline int setegid(int x) { return 1; }

#endif /* _MSC_VER */


/*@-incondefs@*/
/*@mayexit@*/ /*@only@*/ /*@out@*/ /*@unused@*/
void * xmalloc (size_t size)
	/*@globals errno @*/
	/*@ensures maxSet(result) == (size - 1) @*/
	/*@modifies errno @*/;

/*@mayexit@*/ /*@only@*/ /*@unused@*/
void * xcalloc (size_t nmemb, size_t size)
	/*@ensures maxSet(result) == (nmemb - 1) @*/
	/*@*/;

/*@mayexit@*/ /*@only@*/ /*@unused@*/
void * xrealloc (/*@null@*/ /*@only@*/ void * ptr, size_t size)
	/*@ensures maxSet(result) == (size - 1) @*/
	/*@modifies *ptr @*/;

/*@mayexit@*/ /*@only@*/ /*@unused@*/
char * xstrdup (const char *str)
	/*@*/;
/*@=incondefs@*/

#if !defined(HAVE_STPCPY)
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST.  */<commit_msg>Put all the ifdef _MSC_VER in one place. Keep the inline function for now<commit_after>/**
 * \file popt/system.h
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif



#if defined (__GLIBC__) && defined(__LCLINT__)
/*@-declundef@*/
/*@unchecked@*/
extern __const __int32_t *__ctype_tolower;
/*@unchecked@*/
extern __const __int32_t *__ctype_toupper;
/*@=declundef@*/
#endif

#include <ctype.h>


#ifdef __GNUC__
# undef alloca
# define alloca __builtin_alloca
#else
# ifdef HAVE_ALLOCA_H
#  include <alloca.h>
# else
#  ifndef _AIX
/* AIX alloca decl has to be the first thing in the file, bletch! */
char *alloca ();
#  endif
# endif
#endif


/* XXX isspace(3) has i18n encoding signednesss issues on Solaris. */
#define	_isspaceptr(_chp)	isspace((int)(*(unsigned char *)(_chp)))

#include <errno.h>
#include <fcntl.h>
#include <limits.h>

#ifdef HAVE_MCHECK_H
#include <mcheck.h>
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#if defined(HAVE_UNISTD_H) && !defined(__LCLINT__)
#include <unistd.h>
#endif

#ifdef _MSC_VER
#  define inline __inline
#define _CRT_SECURE_NO_WARNINGS 1
#include <io.h>
#include <malloc.h>
#define F_OK 0
#define R_OK 4
#define W_OK 2
#define X_OK 1

#define S_IRWXG 00000070
#define S_IRWXO 00000007
#define S_ISUID 00040000
#define S_ISGID 00020000
#define S_ISVTX 00010000


/* CHECKME */
#define S_IWGRP 00000020
#define S_IWOTH 00000002

#define S_ISREG(m) ((m)&_S_IFREG)


/* Documentation claims these are in limits.h, but it seems to be a lie */
/* Microsoft documentation http://msdn.microsoft.com/en-us/library/k15zsh48.aspx */

#if !defined(FLT_MIN)
#define FLT_MIN 1.175494351e-38F
#endif

#if !defined(FLT_MAX)
#define FLT_MAX 3.402823466e+38F
#endif

typedef int uid_t;

#ifdef _WIN64
typedef __int64 ssize_t;
#else
typedef int ssize_t;
#endif /* _WIN64 */

#define srandom srand
#define random rand
#define access _access
#define strdup _strdup
#define execvp _execvp
#define strtoll _strtoi64
#define read _read
#define open _open
#define close _close
#define lseek _lseek

/* Pretend to be root to replace these */
inline int setuid(int x) { return 1; }
inline int getuid(void) { return 0; }

inline int seteuid(int x) { return 1; }
inline int geteuid(void) { return 0; }

inline int setgid(int x) { return 1; }
inline int getgid(void) { return 0; }

inline int setegid(int x) { return 1; }

#endif /* _MSC_VER */

#ifdef __NeXT
/* access macros are not declared in non posix mode in unistd.h -
 don't try to use posix on NeXTstep 3.3 ! */
#include <libc.h>
#endif


/*@-incondefs@*/
/*@mayexit@*/ /*@only@*/ /*@out@*/ /*@unused@*/
void * xmalloc (size_t size)
	/*@globals errno @*/
	/*@ensures maxSet(result) == (size - 1) @*/
	/*@modifies errno @*/;

/*@mayexit@*/ /*@only@*/ /*@unused@*/
void * xcalloc (size_t nmemb, size_t size)
	/*@ensures maxSet(result) == (nmemb - 1) @*/
	/*@*/;

/*@mayexit@*/ /*@only@*/ /*@unused@*/
void * xrealloc (/*@null@*/ /*@only@*/ void * ptr, size_t size)
	/*@ensures maxSet(result) == (size - 1) @*/
	/*@modifies *ptr @*/;

/*@mayexit@*/ /*@only@*/ /*@unused@*/
char * xstrdup (const char *str)
	/*@*/;
/*@=incondefs@*/

#if !defined(HAVE_STPCPY)
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST.  */
{'fraction_non_alphanumeric': 0.15690184049079756, 'fraction_numerical': 0.03588957055214724, 'mean_word_length': 4.250402576489533, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '1928812', 'n_tokens_mistral': 2869, 'n_tokens_neox': 2614, 'n_words': 746}