<commit_before>#include "win_oper.h"
#include "win_xcb.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "x11fs.h"

//Specific read and write functions for each file

void border_color_write(int wid, const char *buf)
{
	set_border_color(wid, atoi(buf));
}

char *border_width_read(int wid)
{
	int border_width=get_border_width(wid);
	if(border_width==-1){
		errno = -EIO;
		return NULL;
	}
	//Work out the size needed to malloc by calling snprintf with a size of 0
	char *border_width_string=malloc(snprintf(NULL, 0, "%d\n", border_width)+1);
	sprintf(border_width_string, "%d\n", border_width);
	return border_width_string;
}

void border_width_write(int wid, const char *buf)
{
	set_border_width(wid, atoi(buf));
}

char *root_width_read(int wid)
{<commit_msg>Fix setting border colour<commit_after>#include "win_oper.h"
#include "win_xcb.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "x11fs.h"

//Specific read and write functions for each file

void border_color_write(int wid, const char *buf)
{
	set_border_color(wid, strtol(buf, NULL, 16));
}

char *border_width_read(int wid)
{
	int border_width=get_border_width(wid);
	if(border_width==-1){
		errno = -EIO;
		return NULL;
	}
	//Work out the size needed to malloc by calling snprintf with a size of 0
	char *border_width_string=malloc(snprintf(NULL, 0, "%d\n", border_width)+1);
	sprintf(border_width_string, "%d\n", border_width);
	return border_width_string;
}

void border_width_write(int wid, const char *buf)
{
	set_border_width(wid, atoi(buf));
}

char *root_width_read(int wid)
{
{'fraction_non_alphanumeric': 0.1339066339066339, 'fraction_numerical': 0.0085995085995086, 'mean_word_length': 5.7875, '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': '295616', 'n_tokens_mistral': 636, 'n_tokens_neox': 617, 'n_words': 157}