File: commandhash.h

package info (click to toggle)
floater 1.2b1-6
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,612 kB
  • ctags: 1,822
  • sloc: ansic: 16,755; tcl: 4,034; sh: 1,291; makefile: 129
file content (40 lines) | stat: -rw-r--r-- 1,535 bytes parent folder | download
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
/* Copyright (c) 1996--1999 Geoff Pike. */
/* All rights reserved. */

/* Floater is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */

/* This software is provided "as is" and comes with absolutely no */
/* warranties.  Geoff Pike is not liable for damages under any */
/* circumstances.  Support is not provided.  Use at your own risk. */

/* Personal, non-commercial use is allowed.  Attempting to make money */
/* from Floater or products or code derived from Floater is not allowed */
/* without prior written consent from Geoff Pike.  Anything that remotely */
/* involves commercialism, including (but not limited to) systems that */
/* show advertisements while being used and systems that collect */
/* information on users that is later sold or traded require prior */
/* written consent from Geoff Pike. */
#ifndef __COMMANDHASH_H__
#define __COMMANDHASH_H__

#define AMBIGUOUS ((char *) 1)

#define NEW_ISSTRINGCOMMAND(s) \
	atob(TclDo3("uplevel #0 {info exists {isstringcommand(", \
		    itoa((long) s), ")}}"))
#define OLD_ISSTRINGCOMMAND(s) (((long) s) & 1)
#define ISSTRINGCOMMAND(s) \
  (using_old_isstringcommand ? OLD_ISSTRINGCOMMAND(s) : NEW_ISSTRINGCOMMAND(s))
extern bool using_old_isstringcommand;

typedef int (*commandptr)(char *);

commandptr commandhash(char *s);
void cmdbind(char *s, commandptr binding);
void stringbind(char *s, char *binding);

void hashdump(void);

#endif