<commit_before>#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <hamlib/rig.h>

hamlib_port_t myport;
RIG *myrig;

int set_port(int rig_port_type, char* portname, int baudrate, int databits, int stopbits, int parity, int handshake){

	//check if rig exists
 	if (myrig == 0) return -1;

	myrig->state.rigport.type.rig = rig_port_type;
	myrig->state.rigport.parm.serial.rate = baudrate;
	myrig->state.rigport.parm.serial.data_bits = databits;
	myrig->state.rigport.parm.serial.stop_bits = stopbits;
	myrig->state.rigport.parm.serial.parity = parity;
	myrig->state.rigport.parm.serial.handshake = handshake;
	strncpy(myrig->state.rigport.pathname, portname, FILPATHLEN - 1);
	printf("path: %s\n", portname);
	printf("path: %s\n", myrig->state.rigport.pathname);
	return 0;
}

int init_rig(int rig_model)
{
	//check if rig already exists
	if (myrig != 0) return -1;

	rig_load_all_backends();
	myrig = rig_init(rig_model);
	if (!myrig) {
		return -1;
	}
	
	return 0;
}

int open_rig()
{
	int res = rig_open(myrig);
	return res;
}

int set_vfo(int vfo)
{<commit_msg>removed prints<commit_after>#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <hamlib/rig.h>

hamlib_port_t myport;
RIG *myrig;

int set_port(int rig_port_type, char* portname, int baudrate, int databits, int stopbits, int parity, int handshake){

	//check if rig exists
 	if (myrig == 0) return -1;

	myrig->state.rigport.type.rig = rig_port_type;
	myrig->state.rigport.parm.serial.rate = baudrate;
	myrig->state.rigport.parm.serial.data_bits = databits;
	myrig->state.rigport.parm.serial.stop_bits = stopbits;
	myrig->state.rigport.parm.serial.parity = parity;
	myrig->state.rigport.parm.serial.handshake = handshake;
	strncpy(myrig->state.rigport.pathname, portname, FILPATHLEN - 1);
	// printf("path: %s\n", portname);
	// printf("path: %s\n", myrig->state.rigport.pathname);
	return 0;
}

int init_rig(int rig_model)
{
	//check if rig already exists
	if (myrig != 0) return -1;

	// rig_load_all_backends();
	myrig = rig_init(rig_model);
	if (!myrig) {
		return -1;
	}
	
	return 0;
}

int open_rig()
{
	int res = rig_open(myrig);
	return res;
}

int set_vfo(int vfo)
{
{'fraction_non_alphanumeric': 0.1518987341772152, 'fraction_numerical': 0.007233273056057866, 'mean_word_length': 4.4641975308641975, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 29, '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': '383516', 'n_tokens_mistral': 941, 'n_tokens_neox': 907, 'n_words': 189}