'\" '\" Copyright (c) 1997 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" RCS: @(#) $Id: registry.n,v 1.2 2003/11/24 05:09:59 bbbush Exp $ '\" '\" The definitions below are for supplemental macros used in Tcl/Tk '\" manual entries. '\" '\" .AP type name in/out ?indent? '\" Start paragraph describing an argument to a library procedure. '\" type is type of argument (int, etc.), in/out is either "in", "out", '\" or "in/out" to describe whether procedure reads or modifies arg, '\" and indent is equivalent to second arg of .IP (shouldn't ever be '\" needed; use .AS below instead) '\" '\" .AS ?type? ?name? '\" Give maximum sizes of arguments for setting tab stops. Type and '\" name are examples of largest possible arguments that will be passed '\" to .AP later. If args are omitted, default tab stops are used. '\" '\" .BS '\" Start box enclosure. From here until next .BE, everything will be '\" enclosed in one large box. '\" '\" .BE '\" End of box enclosure. '\" '\" .CS '\" Begin code excerpt. '\" '\" .CE '\" End code excerpt. '\" '\" .VS ?version? ?br? '\" Begin vertical sidebar, for use in marking newly-changed parts '\" of man pages. The first argument is ignored and used for recording '\" the version when the .VS was added, so that the sidebars can be '\" found and removed when they reach a certain age. If another argument '\" is present, then a line break is forced before starting the sidebar. '\" '\" .VE '\" End of vertical sidebar. '\" '\" .DS '\" Begin an indented unfilled display. '\" '\" .DE '\" End of indented unfilled display. '\" '\" .SO '\" Start of list of standard options for a Tk widget. The '\" options follow on successive lines, in four columns separated '\" by tabs. '\" '\" .SE '\" End of list of standard options for a Tk widget. '\" '\" .OP cmdName dbName dbClass '\" Start of description of a specific option. cmdName gives the '\" option's name as specified in the class command, dbName gives '\" the option's name in the option database, and dbClass gives '\" the option's class in the option database. '\" '\" .UL arg1 arg2 '\" Print arg1 underlined, then print arg2 normally. '\" '\" RCS: @(#) $Id: registry.n,v 1.2 2003/11/24 05:09:59 bbbush Exp $ '\" '\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. .if t .wh -1.3i ^B .nr ^l \n(.l .ad b '\" # Start an argument description .de AP .ie !"\\$4"" .TP \\$4 .el \{\ . ie !"\\$2"" .TP \\n()Cu . el .TP 15 .\} .ta \\n()Au \\n()Bu .ie !"\\$3"" \{\ \&\\$1 \\fI\\$2\\fP (\\$3) .\".b .\} .el \{\ .br .ie !"\\$2"" \{\ \&\\$1 \\fI\\$2\\fP .\} .el \{\ \&\\fI\\$1\\fP .\} .\} .. '\" # define tabbing values for .AP .de AS .nr )A 10n .if !"\\$1"" .nr )A \\w'\\$1'u+3n .nr )B \\n()Au+15n .\" .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n .nr )C \\n()Bu+\\w'(in/out)'u+2n .. .AS Tcl_Interp Tcl_CreateInterp in/out '\" # BS - start boxed text '\" # ^y = starting y location '\" # ^b = 1 .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. '\" # BE - end boxed text (draw box now) .de BE .nf .ti 0 .mk ^t .ie n \l'\\n(^lu\(ul' .el \{\ .\" Draw four-sided box normally, but don't draw top of .\" box if the box started on an earlier page. .ie !\\n(^b-1 \{\ \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .el \}\ \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .\} .fi .br .nr ^b 0 .. '\" # VS - start vertical sidebar '\" # ^Y = starting y location '\" # ^v = 1 (for troff; for nroff this doesn't matter) .de VS .if !"\\$2"" .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. '\" # VE - end of vertical sidebar .de VE .ie n 'mc .el \{\ .ev 2 .nf .ti 0 .mk ^t \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' .sp -1 .fi .ev .\} .nr ^v 0 .. '\" # Special macro to handle page bottom: finish off current '\" # box/sidebar if in box/sidebar mode, then invoked standard '\" # page bottom macro. .de ^B .ev 2 'ti 0 'nf .mk ^t .if \\n(^b \{\ .\" Draw three-sided box if this is the box's first page, .\" draw two sides but no top otherwise. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .\} .if \\n(^v \{\ .nr ^x \\n(^tu+1v-\\n(^Yu \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c .\} .bp 'fi .ev .if \\n(^b \{\ .mk ^y .nr ^b 2 .\} .if \\n(^v \{\ .mk ^Y .\} .. '\" # DS - begin display .de DS .RS .nf .sp .. '\" # DE - end display .de DE .fi .RE .sp .. '\" # SO - start of list of standard options .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 5.5c 11c .ft B .. '\" # SE - end of list of standard options .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. '\" # OP - start of full description for a single option .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. '\" # CS - begin code excerpt .de CS .RS .nf .ta .25i .5i .75i 1i .. '\" # CE - end code excerpt .de CE .fi .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. .TH registry 3tcl 8.0 Tcl "Tcl Built-In Commands" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME registry \- 操縱 Windows 注冊表 .SH "總覽 SYNOPSIS" .sp \fBpackage require registry 1.0\fR .sp \fBregistry \fIoption\fR \fIkeyName\fR ?\fIarg arg ...\fR? .BE .SH "描述 DESCRIPTION" .PP \fBregistry\fR 包為操縱 Windows 注冊表提供了一個通用的操作集。這個包實現了 Tcl 命令 \fBregistry\fR。只在 Windows 平台上支持這個命令。警告: 使用這個命令必須謹慎,因為一個被破壞了的注冊表將導致你的系統進入不可用狀態。 .PP \fIKeyName\fR 是一個注冊表鍵的名字。注冊表鍵必須是下列一種形式之一: .IP \fB\e\e\fIhostname\fB\e\fIrootname\fB\e\fIkeypath\fR .IP \fIrootname\fB\e\fIkeypath\fR .IP \fIrootname\fR .PP \fIHostname\fR 指定任何有效的 Windows 主機名字,它導出了自己的注冊表。\fIrootname\fR 組成部分必須是下列之一: \fBHKEY_LOCAL_MACHINE\fR, \fBHKEY_USERS\fR, .VS \fBHKEY_CLASSES_ROOT\fR, \fBHKEY_CURRENT_USER\fR, \fBHKEY_CURRENT_CONFIG\fR, \fBHKEY_PERFORMANCE_DATA\fR, or \fBHKEY_DYN_DATA\fR. \fIkeypath\fR 可以是一個或更多 .VE 注冊表鍵的名字, 用反斜槓字符(\fB\\fR)分隔。 .PP \fIOption\fR 指示對注冊表鍵名要做什麼。可接受一個唯一的 \fIoption\fR 的縮寫。有效的選項有: .TP \fBregistry delete \fIkeyName\fR ?\fIvalueName\fR? . 如果提供了可選的 \fIvalueName\fR 參數,則從注冊表中刪除 \fIkeyName\fR 下的這個指定的值。如果省略了可選的 \fIvalueName\fR,則刪除這個指定的鍵和在注冊表層次中位於其下的子鍵或值。如果不能刪除這個鍵則生成一個錯誤。如果這個鍵不存在,這個命令沒有作用。 .TP \fBregistry get \fIkeyName valueName\fR . 返回在鍵 \fIkeyName \fR下面的值 \fIvalueName\fR 所關聯的數據。如果這個鍵或值不存在,則生成一個錯誤。 返回數據的格式的詳情請參見下面的 SUPPORTED TYPES 支持的類型。 .TP \fBregistry keys \fIkeyName\fR ?\fIpattern\fR? . 如果未指定 \fIpattern\fR,返回 \fIkeyName \fR的所有子鍵的名字的一個列表。如果指定了 \fIpattern\fR,只返回匹配 \fIpattern\fR 的那些名字。使用與 \fBstring\fR 相同的匹配規則確定匹配。如果指定的 \fIkeyName\fR 不存在,則生成一個錯誤。 .TP \fBregistry set \fIkeyName\fR ?\fIvalueName data \fR?\fItype\fR?? . 如果未指定 \fIvalueName\fR,若鍵 \fIkeyName\fR 不存在則建立之。如果指定了 \fIvalueName\fR,如果需要的話,建立鍵 \fIkeyName\fR 和值 \fIvalueName\fR。\fIvalueName\fR 的內容被設置成 \fIdata\fR,用 \fItype \fR指示其類型。如果未指定 \fItype\fR,假定為類型 \fBsz\fR。數據和類型參數的詳情請參見下面的 SUPPORTED TYPES 支持的類型。 .TP \fBregistry type \fIkeyName valueName\fR . 返回在鍵 \fIkeyName \fR中的值 \fIvalueName\fR 的類型。可能的類型的更多信息請參見下面的SUPPORTED TYPES 支持的類型。 .TP \fBregistry values \fIkeyName\fR ?\fIpattern\fR? . 如果未指定 \fIpattern\fR,返回 \fIkeyName \fR的所有值的名字的一個列表。如果指定了 \fIpattern\fR ,只返回匹配 \fIpattern\fR 的那些名字。使用與 \fBstring\fR 相同的匹配規則確定匹配。 .SH "支持的類型 SUPPORTED TYPES" 在注冊表中一個鍵之下的每個值包含特定類型的一些數據,這些數據存儲為特定於類型的表示。\fBregistry\fR 命令在這種內部表示和可以被 Tcl 稿本操作的表示之間進行轉換。在多數情況下,數據被簡單的返回為一個 Tcl 字符串。類型為數據指示目的用途,但不實際改變表示。對於一些類型,\fBregistry\fR 命令以不同的形式返回數據以易於操縱。注冊命令識別下列類型: .TP 17 \fBbinary\fR . 注冊值包含任意二進制數據。數據在 Tcl 中被精確表示,包括所有嵌入的 null。 .TP \fBnone\fR . 注冊值包含未定義類型的任意二進制數據。數據在 Tcl 中被精確表示,包括所有嵌入的 null。 .TP \fBsz\fR . 注冊值包含一個 null 終結的字符串。數據在 Tcl 中被表示為一個字符串。 .TP \fBexpand_sz\fR . 注冊值包含一個 null 終結的字符串,其中包含到環境變量的未展開的引用(unexpanded reference),引用是通常的 Windows 式樣(例如,"%PATH%")。數據在 Tcl 中被表示為一個字符串。 .TP \fBdword\fR . 注冊值包含一個小端(little-endian) 32 位數。數據在 Tcl 中被表示為一個十進制串。 .TP \fBdword_big_endian\fR . 注冊值包含一個大端(big-endian) 32 位數。數據在 Tcl 中被表示為一個十進制串。 .TP \fBlink\fR . 注冊值包含一個符號連接。數據在 Tcl 中被精確表示,包括所有嵌入的 null。 .TP \fBmulti_sz\fR . 注冊值包含 null 終結的字符串的一個數組。數據在 Tcl 中被表示為字符串的一個列表。 .TP \fBresource_list\fR . 注冊值包含一個設備-驅動器資源列表。數據在 Tcl 中被精確表示,包括所有嵌入的 null。 .PP 除了上面列出的用符號命名的類型之外,用對應於系統接口返回的類型代碼的一個32位整數標識未知類型 。在這種情況下,數據在 Tcl 中被精確表示,包括所有嵌入的 null。 .SH "移植要點 PORTABILITY ISSUES" 只能在 Windows 中使用注冊表命令。 .SH "關鍵字 KEYWORDS" registry .SH "[中文版維護人]" .B 寒蟬退士 .SH "[中文版最新更新]" .B 2001/10/29 .SH "《中國 Linux 論壇 man 手冊頁翻譯計劃》:" .BI http://cmpp.linuxforum.net