File: xerrors.sml

package info (click to toggle)
smlnj 110.79-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 82,564 kB
  • sloc: ansic: 32,532; asm: 6,314; sh: 2,296; makefile: 1,821; perl: 1,170; pascal: 295; yacc: 190; cs: 78; python: 77; lisp: 19
file content (47 lines) | stat: -rw-r--r-- 1,763 bytes parent folder | download | duplicates (5)
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
(* xerrors.sml
 *
 * COPYRIGHT (c) 1990,1991 by John H. Reppy.  See COPYRIGHT file for details.
 *
 * These are ML types for representing the X11 protocol error messages.
 *)

structure XErrors =
  struct
    local open XProtTypes in

    datatype xerror = XErr of {
	    kind : xerr_kind,
	    major_op : Word8.word,	(* major op-code (8 bits) *)
	    minor_op : word		(* minor op-code (16 bits) *)
	  }

    and xerr_kind
      = BadRequest			(* bad request code *)
      | BadValue of string		(* int parameter out of range *)
      | BadWindow of xid		(* parameter not a Window *)
      | BadPixmap of xid		(* parameter not a Pixmap *)
      | BadAtom of xid			(* parameter not an Atom *)
      | BadCursor of xid		(* parameter not a Cursor *)
      | BadFont of xid			(* parameter not a Font *)
      | BadMatch			(* parameter mismatch *)
      | BadDrawable of xid		(* parameter not a Pixmap or Window *)
      | BadAccess			(* depending on context: *)
					(*   - key/button already grabbed *)
					(*   - attempt to free an illegal cmap entry *)
					(*   - attempt to store into a read-only *)
					(*     cmap entry. *)
					(*   - attempt to modify the access control *)
					(*     list from other than the local host. *)
      | BadAlloc			(* insufficient resources *)
      | BadColor of xid			(* no such colormap *)
      | BadGC of xid			(* parameter not a GC *)
      | BadIDChoice of xid		(* choice not in range or already used *)
      | BadName				(* font or color name doesn't exist *)
      | BadLength			(* Request length incorrect *)
      | BadImplementation		(* server is defective *)

    val firstExtensionError = 0w128 : Word8.word
    val lastExtensionError = 0w255 : Word8.word

    end (* local open XTypes in *)
  end (* XErrors *)