<commit_before>#include <fcntl.h>
#include "condor_debug.h"
#include "expr.h"
#include "dgram_io_handle.h"
#include "xferstat2.h"
#include "xfer_summary.h"
#include "safe_sock.h"
#include "condor_network.h"
#include "condor_classad.h"
#include "condor_collector.h"

extern "C" {
	char *param();
	int gethostname(char *name, int namelen);
	char *calc_subnet_name();
	char *getwd(char *path);
}


XferSummary::init()
{
	start_time = time(0);

	num_sends = 0;
	bytes_sent = 0;
	tot_send_bandwidth = 0;
	time_sending = 0;

	num_recvs = 0;
	bytes_recv = 0;
	tot_recv_bandwidth = 0;
	time_recving = 0;

	gethostname(machine, 256);
	struct hostent *hostptr = gethostbyname(machine);
	sprintf(name, hostptr->h_name);
	subnet = (char *)calc_subnet_name(NULL);
}


XferSummary::Result(transferinfo *tinfo)<commit_msg>   Fixed the gethostname prototype for Linux<commit_after>#include <fcntl.h>
#include "condor_debug.h"
#include "expr.h"
#include "dgram_io_handle.h"
#include "xferstat2.h"
#include "xfer_summary.h"
#include "safe_sock.h"
#include "condor_network.h"
#include "condor_classad.h"
#include "condor_collector.h"

extern "C" {
	char *param();
#if defined(LINUX)	
	int gethostname(char *name, unsigned int namelen);
#else
	int gethostname(char *name, int namelen);
#endif
	char *calc_subnet_name();
	char *getwd(char *path);
}


XferSummary::init()
{
	start_time = time(0);

	num_sends = 0;
	bytes_sent = 0;
	tot_send_bandwidth = 0;
	time_sending = 0;

	num_recvs = 0;
	bytes_recv = 0;
	tot_recv_bandwidth = 0;
	time_recving = 0;

	gethostname(machine, 256);
	struct hostent *hostptr = gethostbyname(machine);
	sprintf(name, hostptr->h_name);
	subnet = (char *)calc_subnet_name(NULL);
}


XferSummary::Result(transferinfo *tinfo)
{'fraction_non_alphanumeric': 0.14219653179190753, 'fraction_numerical': 0.015028901734104046, 'mean_word_length': 5.841897233201581, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4025802', 'n_tokens_mistral': 737, 'n_tokens_neox': 718, 'n_words': 147}