<commit_before>%{
/*
 * Parse openCryptoki's config file.
 */

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

#include "log.h"
#include "slotmgr.h"
#include "pkcsslotd.h"

Slot_Info_t_64 sinfo_struct;
unsigned long int Index;
int slot_count = 0;

#define ERRSTRLEN	256
#define DEF_MANUFID	"IBM"
#define DEF_SLOTDESC	"Linux"

static char errbuf[ERRSTRLEN + 1];

extern char *strsep(char **stringp, const char *delim);
extern FILE *yyin;
extern int yyparse();
extern void yyerror(const char *s);
extern int line_num;

typedef enum {
        KW_STDLL,
	KW_SLOTDESC,
	KW_MANUFID,
	KW_HWVERSION,
	KW_FWVERSION,
        KW_CONFNAME,
        KW_MAX
} keyword_token;

struct ock_key {
        char *name;
        keyword_token token;
};

static const struct ock_key ock_keywords[] = {
        {"stdll",       	KW_STDLL},
	{"description", 	KW_SLOTDESC},
	{"manufacturer",	KW_MANUFID},
	{"hwversion",		KW_HWVERSION},
	{"firmwareversion",	KW_FWVERSION},
        {"confname",		KW_CONFNAME}
};

%}
<commit_msg>Add missing function declarations to parser.y<commit_after>%{
/*
 * Parse openCryptoki's config file.
 */

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

#include "log.h"
#include "slotmgr.h"
#include "pkcsslotd.h"

Slot_Info_t_64 sinfo_struct;
unsigned long int Index;
int slot_count = 0;

#define ERRSTRLEN	256
#define DEF_MANUFID	"IBM"
#define DEF_SLOTDESC	"Linux"

static char errbuf[ERRSTRLEN + 1];

extern char *strsep(char **stringp, const char *delim);
extern FILE *yyin;
extern int yyparse();
extern void yyerror(const char *s);
extern int line_num;

typedef enum {
        KW_STDLL,
	KW_SLOTDESC,
	KW_MANUFID,
	KW_HWVERSION,
	KW_FWVERSION,
        KW_CONFNAME,
        KW_MAX
} keyword_token;

struct ock_key {
        char *name;
        keyword_token token;
};

static const struct ock_key ock_keywords[] = {
        {"stdll",       	KW_STDLL},
	{"description", 	KW_SLOTDESC},
	{"manufacturer",	KW_MANUFID},
	{"hwversion",		KW_HWVERSION},
	{"firmwareversion",	KW_FWVERSION},
        {"confname",		KW_CONFNAME}
};

void set_init(void);
void set_defaults(void);
%}

{'fraction_non_alphanumeric': 0.12593632958801498, 'fraction_numerical': 0.006554307116104869, 'mean_word_length': 4.100238663484487, 'pattern_counts': {'":': 0, '<': 11, '<?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': '4304282', 'n_tokens_mistral': 889, 'n_tokens_neox': 851, 'n_words': 199}