brlapi_getDisplaySize = dlsym(brlapi_library, "brlapi_getDisplaySize");
brlapi_getDisplaySize = (int (*)(unsigned int *, unsigned int *)) dlsym(brlapi_library, "brlapi_getDisplaySize");
static PyObject *brl_module_init(PyObject *self,				 PyObject *args) {        int tty = -1;        int how = 0;  /* BRLCOMMANDS */        int ttyNum;	void *brlapi_library;	int brlapi_fd;	GIOChannel *brlapi_channel;	if (brl_initialized) {		PyErr_SetString(PyExc_StandardError, "Already initialized");		return NULL;	}	if (!PyArg_ParseTuple (args, "|ii:init", &tty, &how))		return NULL;	/* Open the brlapi library          */	brlapi_library = dlopen("libbrlapi.so", RTLD_LAZY);	if (!brlapi_library) {  	        fprintf(stderr, "Failed to load libbrlapi.so\n");		return PyInt_FromLong(0);	}	/* Load the functions */	brlapi_initializeConnection = dlsym(brlapi_library, 					    "brlapi_initializeConnection");	if (!brlapi_initializeConnection) {  	        fprintf(stderr, 			"Failed to find brlapi_initializeConnection in BrlTTY.\n");		return PyInt_FromLong(0);	}	brlapi_closeConnection = dlsym(brlapi_library, 				       "brlapi_closeConnection");	if (!brlapi_closeConnection) {  	        fprintf(stderr,			"Failed to find brlapi_closeConnection in BrlTTY.\n");		return PyInt_FromLong(0);	}	brlapi_getDriverId = dlsym(brlapi_library, 				   "brlapi_getDriverId");	if (!brlapi_getDriverId) {  	        fprintf(stderr, 			"Failed to find brlapi_getDriverId in BrlTTY.\n");		return PyInt_FromLong(0);	}	brlapi_getDriverName = dlsym(brlapi_library, 				     "brlapi_getDriverName");	if (!brlapi_getDriverName) {  	        fprintf(stderr,			"Failed to find brlapi_getDriverName in BrlTTY.\n");		return PyInt_FromLong(0);	}	brlapi_getDisplaySize = dlsym(brlapi_library, 				      "brlapi_getDisplaySize");	if (!brlapi_getDisplaySize) {  	        fprintf(stderr,			"Failed to find brlapi_getDisplaySize in BrlTTY.\n");		return PyInt_FromLong(0);	}	brlapi_getTty = dlsym(brlapi_library, 			      "brlapi_getTty");	if (!brlapi_getTty) {  	        fprintf(stderr, 			"Failed to find brlapi_getTty in BrlTTY.\n");		return PyInt_FromLong(0);	}		brlapi_leaveTty = dlsym(brlapi_library, 				"brlapi_leaveTty");	if (!brlapi_leaveTty) {  	        fprintf(stderr,			"Failed to find brlapi_leaveTty in BrlTTY.\n");		return PyInt_FromLong(0);	}	brlapi_writeText = dlsym (brlapi_library, "brlapi_writeText");	if (!brlapi_writeText) {  	        fprintf(stderr,			"Failed to find brlapi_writeText in BrlTTY.\n");		return PyInt_FromLong(0);	}	brlapi_writeDots = dlsym (brlapi_library, "brlapi_writeDots");	if (!brlapi_writeDots) {  	        fprintf(stderr,			"Failed to find brlapi_writeDots in BrlTTY.\n");		return PyInt_FromLong(0);	}	brlapi_readKey = dlsym(brlapi_library, "brlapi_readKey");	if (!brlapi_readKey) {	        fprintf(stderr,			"Failed to find brlapi_readKey in BrlTTY.\n");		return PyInt_FromLong(0);	}	/* Connect to BrlTTY 	 */	brlapi_fd = brlapi_initializeConnection(NULL, NULL);	if (brlapi_fd >= 0) {				/* Take over the owning tty. 		 */ 	        ttyNum = brlapi_getTty(tty,				       0); /* HOW = give me BRLCOMMANDS */		if (ttyNum == -1) { 		        fprintf(stderr,				"Failed on call to brlapi_getTty in BrlTTY.\n");			return PyInt_FromLong(0);		}		/* Setup the GIOChannel to receive notifications of Braille 		 * key events 		 */		brlapi_channel = g_io_channel_unix_new(brlapi_fd);		g_io_add_watch(brlapi_channel,			       G_IO_IN, 			       brlapi_io_cb,			       NULL);		brl_initialized = 1;	} else {  	        fprintf(stderr,			"Failed on call to brlapi_initializeConnection in BrlTTY.\n");	}	return PyInt_FromLong(brl_initialized);}