<reponame>gvx/deja
with open('std.c', 'w') as f:
	f.write('''#include "std.h"

/* This file is generated by genstdc.py.
 * Do not edit by hand.
 * Also, this file is automatically updated
 * by make when the project is built.
 */

V load_std(V global)
{
	char std[] = {''')
	with open('std.vu', 'rb') as std:
		for n, char in enumerate(std.read()):
			if n % 8 == 0:
				f.write("\n		")
			f.write(r"'\x%02x', " % ord(char))
	f.write('''
	};
	return load_memfile(std, sizeof std, a_to_string("(standard library)"), global);
}
''')

with open('std.c', 'w') as f:
	f.write('''#include "std.h"

/* This file is generated by genstdc.py.
 * Do not edit by hand.
 * Also, this file is automatically updated
 * by make when the project is built.
 */

V load_std(V global)
{
	char std[] = {''')
	with open('std.vu', 'rb') as std:
		for n, char in enumerate(std.read()):
			if n % 8 == 0:
				f.write("\n		")
			f.write(r"'\x%02x', " % ord(char))
	f.write('''
	};
	return load_memfile(std, sizeof std, a_to_string("(standard library)"), global);
}
''')
#include "std.h"  /* This file is generated by genstdc.py.  * Do not edit by hand.  * Also, this file is automatically updated  * by make when the project is built.  */  V load_std(V global) { 	char std[] = { }; 	return load_memfile(std, sizeof std, a_to_string("(standard library)"), global); }