Mercurial > emacs
annotate oldXMenu/XLookAssoc.c @ 52242:f5ada28bb9f0
Patch by Michael Mauger <mmaug@yahoo.com>
Version 1.8.0 of sql-mode.
Simplify selection of SQL products to define highlighting and
interactive mode. Includes detailed instructions on adding
support for new products.
* sql.el (sql-product): New variable. Identifies SQL product for
use in highlighting and interactive mode.
(sql-interactive-product): New variable. SQL product for
sql-interactive-mode.
(sql-product-support): New variable. Specifies product-specific
parameters to drive highlighting and interactive mode.
(sql-imenu-generic-expression): Add more object types.
(sql-sqlite-options): Correct comment.
(sql-ms-program): Use "osql" rather than "isql".
(sql-prompt-regexp, sql-prompt-length): Update comment.
(sql-mode-menu): Add "Start SQLi session" entry. Replace
Highlighting submenu with Product menu. Fix Send Region entry.
(sql-mode-abbrev-table): Add abbreviations. Support of
SYSTEM-FLAG on define-abbrev. Support was removed with last
check-in; it now handles older Emacsen without the SYSTEM-FLAG.
(sql-mode-font-lock-object-name): Add font-lock pattern for object
names.
(sql-mode-ansi-font-lock-keywords): Set as default value.
(sql-mode-oracle-font-lock-keywords): Set as default value.
Support Oracle 9i keywords.
(sql-mode-postgres-font-lock-keywords): Set as default value.
(sql-mode-linter-font-lock-keywords): Set as default value.
(sql-mode-ms-font-lock-keywords): New variable. Support Microsoft
SQLServer 2000.
(sql-mode-sybase-font-lock-keywords)
(sql-mode-interbase-font-lock-keywords)
(sql-mode-sqlite-font-lock-keywords)
(sql-mode-strong-font-lock-keywords)
(sql-mode-mysql-font-lock-keywords)
(sql-mode-db2-font-lock-keywords): New variables. Default to ANSI
keywords.
(sql-mode-font-lock-defaults): Update comment.
(sql-product-feature): New function. Returns feature associated
with a product from `sql-product-support' alist.
(sql-product-font-lock): New function. Set font-lock support
based on `sql-product'.
(sql-add-product-keywords): New function. Add font-lock rules to
product-specific keyword variables.
(sql-set-product): New function. Set `sql-product' and apply
appropriate font-lock highlighting.
(sql-highlight-product): New function. Set font-lock support
based on a product. Also set mode name to include product name.
(sql-highlight-ansi-keywords, sql-highlight-oracle-keywords)
(sql-highlight-postgres-keywords, sql-highlight-linter-keywords):
Use `sql-set-product'.
(sql-highlight-ms-keywords)
(sql-highlight-sybase-keywords)
(sql-highlight-interbase-keywords)
(sql-highlight-strong-keywords)
(sql-highlight-mysql-keywords)
(sql-highlight-sqlite-keywords)
(sql-highlight-db2-keywords): New functions. Use
`sql-set-product'.
(sql-get-login): Prompt in the same order as the tokens.
(sql-mode): Uses `sql-product-highlight' and
`sql-product-font-lock'.
(sql-product-interactive): New function. Common portions of
product-specific interactive mode wrappers.
(sql-interactive-mode): Rewritten to use product features.
(sql-oracle, sql-sybase, sql-informix, sql-sqlite, sql-mysql)
(sql-solid, sql-ingres, sql-ms, sql-postgres, sql-interbase)
(sql-db2, sql-linter): Use `sql-product-interactive'.
(sql-connect-oracle, sql-connect-sybase, sql-connect-informix)
(sql-connect-sqlite, sql-connect-mysql, sql-connect-solid)
(sql-connect-ingres, sql-connect-postgres)
(sql-connect-interbase, sql-connect-db2, sql-connect-linter): New
functions. Format command line parameters and invoke comint on
the appropriate interpreter. Code was in the corresponding
`sql-xyz' function before.
(sql-connect-ms): New function. Support -E argument to use
operating system credentials for authentication.
author | Alex Schroeder <alex@gnu.org> |
---|---|
date | Mon, 18 Aug 2003 17:29:23 +0000 |
parents | 23a1cea22d13 |
children | 695cf19ef79e d7ddb3e565de |
rev | line source |
---|---|
25858 | 1 /* $XConsortium: XLookAssoc.c,v 10.16 91/01/06 12:09:24 rws Exp $ */ |
2 /* Copyright Massachusetts Institute of Technology 1985 */ | |
3 | |
4 /* | |
5 Permission to use, copy, modify, distribute, and sell this software and its | |
6 documentation for any purpose is hereby granted without fee, provided that | |
7 the above copyright notice appear in all copies and that both that | |
8 copyright notice and this permission notice appear in supporting | |
9 documentation, and that the name of M.I.T. not be used in advertising or | |
10 publicity pertaining to distribution of the software without specific, | |
11 written prior permission. M.I.T. makes no representations about the | |
12 suitability of this software for any purpose. It is provided "as is" | |
13 without express or implied warranty. | |
14 */ | |
15 | |
16 #include <X11/Xlib.h> | |
17 #include <X11/Xresource.h> | |
18 #include "X10.h" | |
19 | |
20 #ifndef NULL | |
21 #define NULL 0 | |
22 #endif | |
23 | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
24 /* |
25858 | 25 * XLookUpAssoc - Retrieve the data stored in an XAssocTable by its XId. |
26 * If an appropriately matching XId can be found in the table the routine will | |
27 * return apointer to the data associated with it. If the XId can not be found | |
28 * in the table the routine will return a NULL pointer. All XId's are relative | |
29 * to the currently active Display. | |
30 */ | |
31 caddr_t XLookUpAssoc(dpy, table, x_id) | |
32 register Display *dpy; | |
33 register XAssocTable *table; /* XAssocTable to search in. */ | |
34 register XID x_id; /* XId to search for. */ | |
35 { | |
36 int hash; | |
37 register XAssoc *bucket; | |
38 register XAssoc *Entry; | |
39 | |
40 /* Hash the XId to get the bucket number. */ | |
41 hash = x_id & (table->size - 1); | |
42 /* Look up the bucket to get the entries in that bucket. */ | |
43 bucket = &table->buckets[hash]; | |
44 /* Get the first entry in the bucket. */ | |
45 Entry = bucket->next; | |
46 | |
47 /* Scan through the entries in the bucket for the right XId. */ | |
48 for (; Entry != bucket; Entry = Entry->next) { | |
49 if (Entry->x_id == x_id) { | |
50 /* We have the right XId. */ | |
51 if (Entry->display == dpy) { | |
52 /* We have the right display. */ | |
53 /* We have the right entry! */ | |
54 return(Entry->data); | |
55 } | |
56 /* Oops, identical XId's on different displays! */ | |
57 continue; | |
58 } | |
59 if (Entry->x_id > x_id) { | |
60 /* We have gone past where it should be. */ | |
61 /* It is apparently not in the table. */ | |
62 return(NULL); | |
63 } | |
64 } | |
65 /* It is apparently not in the table. */ | |
66 return(NULL); | |
67 } | |
68 |