'\" '\" 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 .SH "跋" .br 本頁面中文版由中文 man 手冊頁計劃提供。 .br 中文 man 手冊頁計劃:\fBhttps://github.com/man-pages-zh/manpages-zh\fR