Mercurial > emacs
annotate oldXMenu/XCrAssoc.c @ 72459:2657308de2f6
Update to Dave Love's latest version.
(python-font-lock-keywords, python-mode): Don't use
font-lock-syntax-table, but match symbol elements explicitly instead.
(python-mode-map): Add help, and a few more key bindings.
(python-skip-comments/blanks): Move out of comments as well.
(python-continuation-line-p): Behave better with unbalanced parens.
(python-blank-line-p): New fun.
(python-open-block-statement-p): Don't use a heuristic.
(python-outdent-p): Better handle blocks-in-the-same-line.
(python-calculate-indentation): Misc improvements.
(python-comment-indent): Remove.
(python-block-pairs): New var.
(python-first-word): New fun.
(python-indentation-levels): Handle more common cases.
(python-indent-line-1): Add `leave' argument.
(python-indent-region): New fun.
(python-skip-out): New fun.
(python-beginning-of-statement, python-end-of-statement): Use it.
(python-next-statement): Return correct count even at eob.
(python-end-of-block): Fix paren-typo.
(python-imenu-create-index): Add module variables.
(run-python): Add `new' arg. Check we're at a prompt before returning.
(python-send-command): Move to end of buffer. Wait for prompt to return.
(python-set-proc): New fun.
(python-imports): New var.
(python-describe-symbol): Use it. Adjust to new interface of `ehelp'.
(python-eldoc-function): Try to move out of arg list.
(python-outline-level): Offset by 1.
(python-find-imports): New fun.
(python-symbol-completions): Use python-imports.
(python-module-path, ffap-alist): Add support for ffap.
(python-skeletons, python-mode-abbrev-table, def-python-skeleton)
(pythin-insert-*, python-default-template, python-expand-template):
Add templates/skeletons.
(python-setup-brm): Support for Bicycle Repair Man.
(python-abbrev-syntax-table): New var.
(python-abbrev-pc-hook, python-pea-hook): New funs.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 20 Aug 2006 17:55:16 +0000 |
parents | e8a3fb527b77 |
children | ce127a46b1ca c5406394f567 |
rev | line source |
---|---|
25858 | 1 /* Copyright Massachusetts Institute of Technology 1985 */ |
68640
e8a3fb527b77
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
65000
diff
changeset
|
2 /* Copyright (C) 2002, 2003, 2004, 2005, |
e8a3fb527b77
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
65000
diff
changeset
|
3 2006 Free Software Foundation, Inc. */ |
25858 | 4 |
5 /* | |
6 Permission to use, copy, modify, distribute, and sell this software and its | |
7 documentation for any purpose is hereby granted without fee, provided that | |
8 the above copyright notice appear in all copies and that both that | |
9 copyright notice and this permission notice appear in supporting | |
10 documentation, and that the name of M.I.T. not be used in advertising or | |
11 publicity pertaining to distribution of the software without specific, | |
12 written prior permission. M.I.T. makes no representations about the | |
13 suitability of this software for any purpose. It is provided "as is" | |
14 without express or implied warranty. | |
15 */ | |
16 | |
17 #include <config.h> | |
18 #include <X11/Xlib.h> | |
19 #include <errno.h> | |
20 #include "X10.h" | |
21 | |
22 #ifndef NULL | |
23 #define NULL 0 | |
24 #endif | |
25 | |
26 extern int errno; | |
27 | |
28 /* | |
29 * XCreateAssocTable - Create an XAssocTable. The size argument should be | |
30 * a power of two for efficiency reasons. Some size suggestions: use 32 | |
31 * buckets per 100 objects; a reasonable maximum number of object per | |
32 * buckets is 8. If there is an error creating the XAssocTable, a NULL | |
33 * pointer is returned. | |
34 */ | |
35 XAssocTable *XCreateAssocTable(size) | |
36 register int size; /* Desired size of the table. */ | |
37 { | |
38 register XAssocTable *table; /* XAssocTable to be initialized. */ | |
39 register XAssoc *buckets; /* Pointer to the first bucket in */ | |
40 /* the bucket array. */ | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
41 |
25858 | 42 /* Malloc the XAssocTable. */ |
43 if ((table = (XAssocTable *)malloc(sizeof(XAssocTable))) == NULL) { | |
44 /* malloc call failed! */ | |
45 errno = ENOMEM; | |
46 return(NULL); | |
47 } | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
48 |
25858 | 49 /* calloc the buckets (actually just their headers). */ |
50 buckets = (XAssoc *)calloc((unsigned)size, (unsigned)sizeof(XAssoc)); | |
51 if (buckets == NULL) { | |
52 /* calloc call failed! */ | |
53 errno = ENOMEM; | |
54 return(NULL); | |
55 } | |
56 | |
57 /* Insert table data into the XAssocTable structure. */ | |
58 table->buckets = buckets; | |
59 table->size = size; | |
60 | |
61 while (--size >= 0) { | |
62 /* Initialize each bucket. */ | |
63 buckets->prev = buckets; | |
64 buckets->next = buckets; | |
65 buckets++; | |
66 } | |
67 | |
68 return(table); | |
69 } | |
52401 | 70 |
71 /* arch-tag: 5df3237d-ada0-4345-a3ab-282cafb397aa | |
72 (do not change this comment) */ |