<commit_before>#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>

#include <prscfl.h>

static void
putt(int level) {
	while(level--)
		putchar('\t');
}

static void
debugParamDef(ParamDef *def, int level) {

	while(def) {
		putt(level);
		switch(def->paramType) {
			case	int32Type:
				printf("int32_t\t%s\n", def->name);
				break;
			case	uint32Type:
				printf("u_int32_t\t%s\n", def->name);
				break;
			case	int64Type:
				printf("int64_t\t%s\n", def->name);
				break;
			case	uint64Type:
				printf("u_int64_t\t%s\n", def->name);
				break;
			case	doubleType:
				printf("double\t%s\n", def->name);
				break;
			case	stringType:
				printf("char*\t%s\n", def->name);
				break;
			case	commentType:
				fprintf(stderr, "Unexpected comment"); 
				break;
			case	structType:
				printf("struct\t%s\n", def->name);
				debugParamDef(def->paramValue.structval, level+1);
				break;
			case	arrayType:
				printf("array\t%s\n", def->name);
				debugParamDef(def->paramValue.arrayval, level+1);
				break;
			case 	builtinType:
				printf("BUILTIN\n");
				break;<commit_msg>add RW/REQ flags to dump<commit_after>#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>

#include <prscfl.h>

static void
putt(int level) {
	while(level--)
		putchar('\t');
}

static void 
printDef(char *type, ParamDef *def) {
	printf("%s (%s%s)\t%s\n", 
				type,
				(def->flags & PARAMDEF_RDONLY) ? "RO" : "RW",
				(def->flags & PARAMDEF_REQUIRED) ? ", REQ" : "",
				def->name);
}

static void
debugParamDef(ParamDef *def, int level) {

	while(def) {
		putt(level);
		switch(def->paramType) {
			case	int32Type:
				printDef("int32_t", def);
				break;
			case	uint32Type:
				printDef("u_int32_t", def);
				break;
			case	int64Type:
				printDef("int64_t", def);
				break;
			case	uint64Type:
				printDef("u_int64_t", def);
				break;
			case	doubleType:
				printDef("double", def);
				break;
			case	stringType:
				printDef("char*", def);
				break;
			case	commentType:
				fprintf(stderr, "Unexpected comment"); 
				break;
			case	structType:
				printDef("struct", def);
				debugParamDef(def->paramValue.structval, level+1);
				break;
			case	arrayType:
				printDef("array", def);
				debugParamDef(def->paramValue.arrayval, level+1);
				break;
			case 	builtinType:
				printf("BUILTIN\n");
				break;
{'fraction_non_alphanumeric': 0.1642304385210662, 'fraction_numerical': 0.015477214101461736, 'mean_word_length': 3.357677902621723, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 28, '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': '5535663', 'n_tokens_mistral': 1114, 'n_tokens_neox': 910, 'n_words': 174}