public class Apitest {
  public static void main(String argv[]) {
    try {
      Brlapi brlapi = new Brlapi();
      int fd;
      BrlapiSize size;
      int tty;
      BrlapiKey key;
      long keylong;
      Brlapi.settings settings = new Brlapi.settings();
      Brlapi.writeStruct ws2 = new Brlapi.writeStruct(-1, 10, 20,
	  "Key Pressed         ",
	  "????????????????????".getBytes(),
	  null,3);
      System.out.print("Connecting to BrlAPI... ");
      System.loadLibrary("brlapi_java");
      fd = brlapi.initializeConnection(settings, settings);
      size = brlapi.getDisplaySize();
      System.out.println("done (fd="+fd+")");
      System.out.println("Connected to "+settings.hostName+" using key file "+settings.authKey);
      System.out.println("driver "+brlapi.getDriverId()+" "+brlapi.getDriverName());
      System.out.println("display "+size.x()+"x"+size.y());
      tty = brlapi.enterTtyMode(0,null);
      System.out.println("got tty "+tty);
      brlapi.writeText(0,"ok !!");
      keylong = brlapi.readKey(true);
      key = new BrlapiKey(keylong);
      System.out.println("got key "+keylong+": ("+key.command+","+key.argument+","+key.flags+")");
      brlapi.write(ws2);
      keylong = brlapi.readKey(true);
      key = new BrlapiKey(keylong);
      System.out.println("got key "+keylong+": ("+key.command+","+key.argument+","+key.flags+")");
      brlapi.leaveTtyMode();
      brlapi.closeConnection();
    } catch (BrlapiError e) {
      System.out.println("got error " + e);
    }
  }
}

@@ -73,58 +73,8 @@
 y %7B%0A
-      Brlapi brlapi = new Brlapi();%0A      int fd;%0A
     
@@ -156,26 +156,25 @@
       Brlapi
-.s
+S
 ettings sett
@@ -194,10 +194,9 @@
 lapi
-.s
+S
 etti
@@ -210,26 +210,25 @@
       Brlapi
-.w
+W
 riteStruct w
@@ -238,26 +238,25 @@
 = new Brlapi
-.w
+W
 riteStruct(-
@@ -446,51 +446,35 @@
     
-fd = brlapi.initializeConnection(settings, 
+Brlapi brlapi = new Brlapi(
 sett
@@ -555,18 +555,42 @@
 e (fd=%22+
-fd
+brlapi.getFileDescriptor()
 +%22)%22);%0A 

Make recent type name changes to Apitest.java. (dm)