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

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [insight/] [tk/] [doc/] [GetUid.3] - Diff between revs 579 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 579 Rev 1765
'\"
'\"
'\" Copyright (c) 1990 The Regents of the University of California.
'\" Copyright (c) 1990 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
'\" RCS: @(#) $Id: GetUid.3,v 1.1.1.1 2002-01-16 10:25:48 markom Exp $
'\" RCS: @(#) $Id: GetUid.3,v 1.1.1.1 2002-01-16 10:25:48 markom Exp $
'\"
'\"
.so man.macros
.so man.macros
.TH Tk_GetUid 3 "" Tk "Tk Library Procedures"
.TH Tk_GetUid 3 "" Tk "Tk Library Procedures"
.BS
.BS
.SH NAME
.SH NAME
Tk_GetUid, Tk_Uid \- convert from string to unique identifier
Tk_GetUid, Tk_Uid \- convert from string to unique identifier
.SH SYNOPSIS
.SH SYNOPSIS
.nf
.nf
\fB#include \fR
\fB#include \fR
.sp
.sp
\fB#typedef char *Tk_Uid\fR
\fB#typedef char *Tk_Uid\fR
.sp
.sp
Tk_Uid
Tk_Uid
\fBTk_GetUid\fR(\fIstring\fR)
\fBTk_GetUid\fR(\fIstring\fR)
.SH ARGUMENTS
.SH ARGUMENTS
.AP char *string in
.AP char *string in
String for which the corresponding unique identifier is
String for which the corresponding unique identifier is
desired.
desired.
.BE
.BE
.SH DESCRIPTION
.SH DESCRIPTION
.PP
.PP
\fBTk_GetUid\fR returns the unique identifier corresponding
\fBTk_GetUid\fR returns the unique identifier corresponding
to \fIstring\fR.
to \fIstring\fR.
Unique identifiers are similar to atoms in Lisp, and are used
Unique identifiers are similar to atoms in Lisp, and are used
in Tk to speed up comparisons and
in Tk to speed up comparisons and
searches.  A unique identifier (type Tk_Uid) is a string pointer
searches.  A unique identifier (type Tk_Uid) is a string pointer
and may be used anywhere that a variable of type ``char *''
and may be used anywhere that a variable of type ``char *''
could be used.  However, there is guaranteed to be exactly
could be used.  However, there is guaranteed to be exactly
one unique identifier for any given string value.  If \fBTk_GetUid\fR
one unique identifier for any given string value.  If \fBTk_GetUid\fR
is called twice, once with string \fIa\fR and once with string
is called twice, once with string \fIa\fR and once with string
\fIb\fR, and if \fIa\fR and \fIb\fR have the same string value
\fIb\fR, and if \fIa\fR and \fIb\fR have the same string value
(strcmp(a, b) == 0), then \fBTk_GetUid\fR will return exactly
(strcmp(a, b) == 0), then \fBTk_GetUid\fR will return exactly
the same Tk_Uid value for each call (Tk_GetUid(a) == Tk_GetUid(b)).
the same Tk_Uid value for each call (Tk_GetUid(a) == Tk_GetUid(b)).
This means that variables of type
This means that variables of type
Tk_Uid may be compared directly (x == y) without having to call
Tk_Uid may be compared directly (x == y) without having to call
\fBstrcmp\fR.
\fBstrcmp\fR.
In addition, the return value from \fBTk_GetUid\fR will have the
In addition, the return value from \fBTk_GetUid\fR will have the
same string value as its argument (strcmp(Tk_GetUid(a), a) == 0).
same string value as its argument (strcmp(Tk_GetUid(a), a) == 0).
.SH KEYWORDS
.SH KEYWORDS
atom, unique identifier
atom, unique identifier
 
 

powered by: WebSVN 2.1.0

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