<commit_before>/***************************************************************************
            localkdb.c  -  Methods for accessing the Key Database
                             -------------------
    begin                : Mon Dec 29 2003
    copyright            : (C) 2003 by <NAME>
    email                : <EMAIL>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/



/***************************************************************************
 *                                                                         *
 *   This is the implementation of a filesystem backend for the            *
 *   Elektra Project. Each Key is a file in the filesystem.                *
 *   It is as secure as filesystem security. It is as reliable             *
 *   as filesystem. It uses only standards C calls, which makes it         *
 *   usable by very low level or early boot stage software, like           *
 *   /sbin/init.                                                           *
 *                                                                         *
 ***************************************************************************/


/* Subversion stuff

$Id$
$LastChangedBy$

*/


#include "kdb.h"
#include "kdbprivate.h"


#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <pwd.h>
#include <dirent.h>
#include <errno.h>
#include <stdio.h>
#include <iconv.h>
#include <locale.h>
#include <langinfo.h>
#include <ctype.h>
#include <string.h>
#include <utmp.h>


#define UTF8_TO   1
#define UTF8_FROM 0

#define BUFFER_SIZE 100

#define USER_NAME_SIZE 100

#ifndef UT_NAMESIZE
#define USER_NAME_SIZE UT_NAMESIZE
#endif

/**4096 was taken from my  system (pathconf and PATH_MAX)
 * TODO: Should be taken from pathconf(pathname, _PC_PATH_MAX)
 * but then the buffers have to be malloced.*/
#define MAX_PATH_LENGTH 4096

/**This value is garanteed on any Posixsystem*/
#ifndef  __USE_POSIX
#define MAX_PATH_LENGTH _POSIX_PATH_MAX
#endif

/**Some systems have even longer pathnames*/
#ifndef PATH_MAX
#define MAX_PATH_LENGTH PATH_MAX<commit_msg>Approved Makros to avoid redefines!<commit_after>/***************************************************************************
            localkdb.c  -  Methods for accessing the Key Database
                             -------------------
    begin                : Mon Dec 29 2003
    copyright            : (C) 2003 by <NAME>
    email                : <EMAIL>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/



/***************************************************************************
 *                                                                         *
 *   This is the implementation of a filesystem backend for the            *
 *   Elektra Project. Each Key is a file in the filesystem.                *
 *   It is as secure as filesystem security. It is as reliable             *
 *   as filesystem. It uses only standards C calls, which makes it         *
 *   usable by very low level or early boot stage software, like           *
 *   /sbin/init.                                                           *
 *                                                                         *
 ***************************************************************************/


/* Subversion stuff

$Id$
$LastChangedBy$

*/


#include "kdb.h"
#include "kdbprivate.h"


#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <pwd.h>
#include <dirent.h>
#include <errno.h>
#include <stdio.h>
#include <iconv.h>
#include <locale.h>
#include <langinfo.h>
#include <ctype.h>
#include <string.h>
#include <utmp.h>


#define UTF8_TO   1
#define UTF8_FROM 0

#define BUFFER_SIZE 100

#ifdef UT_NAMESIZE
#define USER_NAME_SIZE UT_NAMESIZE
#else
#define USER_NAME_SIZE 100
#endif

/**Some systems have even longer pathnames*/
#ifdef PATH_MAX
#define MAX_PATH_LENGTH PATH_MAX
/**This value is garanteed on any Posixsystem*/
#elif __USE_POSIX
#define MAX_PATH_LENGTH _POSIX_PATH_MAX
#else 
#define MAX_PATH_LENGTH 4096
{'fraction_non_alphanumeric': 0.23804226918798665, 'fraction_numerical': 0.010011123470522803, 'mean_word_length': 1.952928297755884, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5948447', 'n_tokens_mistral': 1374, 'n_tokens_neox': 1225, 'n_words': 424}