OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [insight/] [tk/] [doc/] [GetUid.3] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
'\"
2
'\" Copyright (c) 1990 The Regents of the University of California.
3
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4
'\"
5
'\" See the file "license.terms" for information on usage and redistribution
6
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7
'\"
8
'\" RCS: @(#) $Id: GetUid.3,v 1.1.1.1 2002-01-16 10:25:48 markom Exp $
9
'\"
10
.so man.macros
11
.TH Tk_GetUid 3 "" Tk "Tk Library Procedures"
12
.BS
13
.SH NAME
14
Tk_GetUid, Tk_Uid \- convert from string to unique identifier
15
.SH SYNOPSIS
16
.nf
17
\fB#include \fR
18
.sp
19
\fB#typedef char *Tk_Uid\fR
20
.sp
21
Tk_Uid
22
\fBTk_GetUid\fR(\fIstring\fR)
23
.SH ARGUMENTS
24
.AP char *string in
25
String for which the corresponding unique identifier is
26
desired.
27
.BE
28
 
29
.SH DESCRIPTION
30
.PP
31
\fBTk_GetUid\fR returns the unique identifier corresponding
32
to \fIstring\fR.
33
Unique identifiers are similar to atoms in Lisp, and are used
34
in Tk to speed up comparisons and
35
searches.  A unique identifier (type Tk_Uid) is a string pointer
36
and may be used anywhere that a variable of type ``char *''
37
could be used.  However, there is guaranteed to be exactly
38
one unique identifier for any given string value.  If \fBTk_GetUid\fR
39
is called twice, once with string \fIa\fR and once with string
40
\fIb\fR, and if \fIa\fR and \fIb\fR have the same string value
41
(strcmp(a, b) == 0), then \fBTk_GetUid\fR will return exactly
42
the same Tk_Uid value for each call (Tk_GetUid(a) == Tk_GetUid(b)).
43
This means that variables of type
44
Tk_Uid may be compared directly (x == y) without having to call
45
\fBstrcmp\fR.
46
In addition, the return value from \fBTk_GetUid\fR will have the
47
same string value as its argument (strcmp(Tk_GetUid(a), a) == 0).
48
 
49
.SH KEYWORDS
50
atom, unique identifier

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.