home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / doc / GetUid.3 < prev    next >
Encoding:
Text File  |  1993-04-01  |  2.4 KB  |  64 lines

  1. '\"
  2. '\" Copyright (c) 1990 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/wish/man/RCS/GetUid.3,v 1.5 93/04/01 09:41:40 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS Tk_GetUid tkc
  25. .BS
  26. .SH NAME
  27. Tk_GetUid, Tk_Uid \- convert from string to unique identifier
  28. .SH SYNOPSIS
  29. .nf
  30. \fB#include <tk.h>\fR
  31. .sp
  32. \fB#typedef char *Tk_Uid\fR
  33. .sp
  34. Tk_Uid
  35. \fBTk_GetUid\fR(\fIstring\fR)
  36. .SH ARGUMENTS
  37. .AP char *string in
  38. String for which the corresponding unique identifer is
  39. desired.
  40. .BE
  41.  
  42. .SH DESCRIPTION
  43. .PP
  44. \fBTk_GetUid\fR returns the unique identifier corresponding
  45. to \fIstring\fR.
  46. Unique identifiers are similar to atoms in Lisp, and are used
  47. in Tk to speed up comparisons and
  48. searches.  A unique identifier (type Tk_Uid) is a string pointer
  49. and may be used anywhere that a variable of type ``char *''
  50. could be used.  However, there is guaranteed to be exactly
  51. one unique identifier for any given string value.  If \fBTk_GetUid\fR
  52. is called twice, once with string \fIa\fR and once with string
  53. \fIb\fR, and if \fIa\fR and \fIb\fR have the same string value
  54. (strcmp(a, b) == 0), then \fBTk_GetUid\fR will return exactly
  55. the same Tk_Uid value for each call (Tk_GetUid(a) == Tk_GetUid(b)).
  56. This means that variables of type
  57. Tk_Uid may be compared directly (x == y) without having to call
  58. \fBstrcmp\fR.
  59. In addition, the return value from \fBTk_GetUid\fR will have the
  60. same string value as its argument (strcmp(Tk_GetUid(a), a) == 0).
  61.  
  62. .SH KEYWORDS
  63. atom, unique identifier
  64.