<commit_before>#  glfw_h.py
#  
#  Copyright 2014 <NAME> <<EMAIL>>
#  
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the Eclipse Public License 1.0
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
#  
#  



import os, re, subprocess
t=subprocess.Popen(('gcc -E /usr/include/GLFW/glfw3.h').split(),stdout=subprocess.PIPE)
data=''
while t.poll() is None:
	data+=t.stdout.read()
data = (data+t.stdout.read()).replace('\r\n','\n')

data=data.split('typedef void ( * PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);')[1].replace('\n ','\n')
import cffi
ffi=cffi.FFI()
ffi.cdef(data)



def getfunctions(lib):
	functions={}
	for f in re.findall('\n[a-zA-Z* ]+? \*{0,1}([a-zA-Z0-9]+)\(',data):
		try:
			functions[f]=getattr(lib,f)
		except:
			pass
	return functions<commit_msg>add GLFWINCLUDE environment variable for GLFW include directory<commit_after>#  glfw_h.py
#  
#  Copyright 2014 <NAME> <<EMAIL>>
#  
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the Eclipse Public License 1.0
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
#  
#  



import os, re, subprocess
t=subprocess.Popen(('gcc -E %s/glfw3.h'%os.environ.get('GLFWINCLUDE', '/usr/include/GLFW')).split(),stdout=subprocess.PIPE)
data=''
while t.poll() is None:
	data+=t.stdout.read()
data = (data+t.stdout.read()).replace('\r\n','\n')

data=data.split('typedef void ( * PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);')[1].replace('\n ','\n')
import cffi
ffi=cffi.FFI()
ffi.cdef(data)



def getfunctions(lib):
	functions={}
	for f in re.findall('\n[a-zA-Z* ]+? \*{0,1}([a-zA-Z0-9]+)\(',data):
		try:
			functions[f]=getattr(lib,f)
		except:
			pass
	return functions
{'fraction_non_alphanumeric': 0.15586272640610105, 'fraction_numerical': 0.011439466158245948, 'mean_word_length': 4.423772609819121, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1832929', 'n_tokens_mistral': 815, 'n_tokens_neox': 776, 'n_words': 201}