<commit_before>#include <stdlib.h>
#include <stdio.h>
#include <dlt/dlt.h>
#include <string.h>

DLT_DECLARE_CONTEXT(context);

int main(int argc, char** argv) {
	if (argc < 4) {
		printf("Usage: tracegen APPID CONTEXTID path_to_trace_file [delay]\n");
	}
	else {
		char* appid = argv[1];
		char* contextid = argv[2];
		char* path = argv[3];

		int delay = 1;
		if (argc == 5) {
			delay = atoi(argv[4]);
		}

		DLT_REGISTER_APP(appid, "Franca test application");
		DLT_REGISTER_CONTEXT(context, contextid, "Franca test context");

		FILE * fp;
		char* line = NULL;
		size_t len = 0;
		ssize_t read;

		fp = fopen(path, "r");
		if (fp == NULL) {
			printf("The specified file cannot be found or cannot be opened!\n");
			exit(EXIT_FAILURE);
		}

		while ((read = getline(&line, &len, fp)) != -1) {
			if (line[strlen(line) - 1] == '\n') {
				line[strlen(line) - 1] = 0;
			}
			DLT_LOG(context, DLT_LOG_INFO, DLT_STRING(line));
			sleep(delay);
		}

		if (line) {
			free(line);
		}
		free(appid);
		free(contextid);
		free(path);

		DLT_UNREGISTER_CONTEXT(context);
		DLT_UNREGISTER_APP();
		return 0;
	}
}<commit_msg>minor changes in tracegen code<commit_after>#include <stdlib.h>
#include <stdio.h>
#include <dlt/dlt.h>
#include <string.h>

DLT_DECLARE_CONTEXT(context);

int main(int argc, char** argv) {
	if (argc < 4) {
		printf("Usage: tracegen APPID CONTEXTID path_to_trace_file [delay]\n");
		return 1;
	}
	else {
		char* appid = argv[1];
		char* contextid = argv[2];
		char* path = argv[3];

		int delay = 1;
		if (argc == 5) {
			delay = atoi(argv[4]);
		}

		DLT_REGISTER_APP(appid, "Franca test application");
		DLT_REGISTER_CONTEXT(context, contextid, "Franca test context");

		FILE * fp;
		char* line = NULL;
		size_t len = 0;
		ssize_t read;

		fp = fopen(path, "r");
		if (fp == NULL) {
			printf("The specified file cannot be found or cannot be opened!\n");
			return 1;
		}

		while ((read = getline(&line, &len, fp)) != -1) {
			if (line[strlen(line) - 1] == '\n') {
				line[strlen(line) - 1] = 0;
			}
			DLT_LOG(context, DLT_LOG_INFO, DLT_STRING(line));
			sleep(delay);
		}

		if (line) {
			free(line);
		}

		DLT_UNREGISTER_CONTEXT(context);
		DLT_UNREGISTER_APP();
		return 0;
	}
}
{'fraction_non_alphanumeric': 0.16659121774558625, 'fraction_numerical': 0.012675418741511997, 'mean_word_length': 3.5755693581780537, 'pattern_counts': {'":': 0, '<': 13, '<?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': '7655877', 'n_tokens_mistral': 1013, 'n_tokens_neox': 886, 'n_words': 216}