File: APIError.java

package info (click to toggle)
brltty 6.8-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,776 kB
  • sloc: ansic: 150,447; java: 13,484; sh: 9,667; xml: 5,702; tcl: 2,634; makefile: 2,328; awk: 713; lisp: 366; python: 321; ml: 301
file content (71 lines) | stat: -rw-r--r-- 2,709 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 * libbrlapi - A library providing access to braille terminals for applications.
 *
 * Copyright (C) 2006-2025 by
 *   Samuel Thibault <Samuel.Thibault@ens-lyon.org>
 *   Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>
 *
 * libbrlapi comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU Lesser General Public License, as published by the Free Software
 * Foundation; either version 2.1 of the License, or (at your option) any
 * later version. Please see the file LICENSE-LGPL for details.
 *
 * Web Page: http://brltty.app/
 *
 * This software is maintained by Dave Mielke <dave@mielke.cc>.
 */

package org.a11y.brlapi;

public class APIError extends Error {
  @Override
  public native String toString ();

  private final int apiError;
  private final int osError;
  private final int gaiError;
  private final String functionName;

  public APIError (int api, int os, int gai, String function) {
    apiError = api;
    osError = os;
    gaiError = gai;
    functionName = function;
  }

  public final int getApiError () {
    return apiError;
  }

  public final int getOsError () {
    return osError;
  }

  public final int getGaiError () {
    return gaiError;
  }

  public final String getFunctionName () {
    return functionName;
  }

  public final static int SUCCESS             =  0; /* Success */
  public final static int NOMEM               =  1; /* Not enough memory */
  public final static int TTYBUSY             =  2; /* Already a connection running in this tty */
  public final static int DEVICEBUSY          =  3; /* Already a connection using RAW mode */
  public final static int UNKNOWN_INSTRUCTION =  4; /* Not implemented in protocol */
  public final static int ILLEGAL_INSTRUCTION =  5; /* Forbiden in current mode */
  public final static int INVALID_PARAMETER   =  6; /* Out of range or have no sense */
  public final static int INVALID_PACKET      =  7; /* Invalid size */
  public final static int CONNREFUSED         =  8; /* Connection refused */
  public final static int OPNOTSUPP           =  9; /* Operation not supported */
  public final static int GAIERR              = 10; /* Getaddrinfo error */
  public final static int LIBCERR             = 11; /* Libc error */
  public final static int UNKNOWNTTY          = 12; /* Couldn't find out the tty number */
  public final static int PROTOCOL_VERSION    = 13; /* Bad protocol version */
  public final static int EOF                 = 14; /* Unexpected end of file */
  public final static int EMPTYKEY            = 15; /* Too many levels of recursion */
  public final static int DRIVERERROR         = 16; /* Packet returned by driver too large */
}