[Tkabber-dev] [tclxmpp commit] r38 - in trunk: . doc xmpp

codesite-noreply at google.com codesite-noreply at google.com
Sun Oct 19 23:56:10 MSD 2008


Author: sgolovan
Date: Sun Oct 19 12:55:00 2008
New Revision: 38

Added:
    trunk/doc/
    trunk/doc/xmpp::jid.man   (contents, props changed)
    trunk/doc/xmpp::xml.man   (contents, props changed)
Modified:
    trunk/ChangeLog
    trunk/xmpp/jid.tcl

Log:
	* doc/xmpp::jid.man, doc/xmpp::xml.man: Added preliminary manual pages
	  for xmpp::jid and xmpp::xml packages. Currently they contain only
	  lists of commands.

	* xmpp/jid.tcl: Code cleanup.


Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Sun Oct 19 12:55:00 2008
@@ -14,6 +14,12 @@
  	* xmpp/tcp.tcl, xmpp/tls.tcl, xmpp/zlib.tcl: Removed unnecessary error
  	  hidings by catch.

+	* doc/xmpp::jid.man, doc/xmpp::xml.man: Added preliminary manual pages
+	  for xmpp::jid and xmpp::xml packages. Currently they contain only
+	  lists of commands.
+
+	* xmpp/jid.tcl: Code cleanup.
+
  2008-10-18  Sergei Golovan  <sgolovan at nes.ru>

  	* xmpp/jid.tcl: Added default resource value (empty string).

Added: trunk/doc/xmpp::jid.man
==============================================================================
--- (empty file)
+++ trunk/doc/xmpp::jid.man	Sun Oct 19 12:55:00 2008
@@ -0,0 +1,66 @@
+[comment {-*- tcl -*- doctools manpage}]
+[comment {$Id$}]
+[manpage_begin xmpp::jid 3 0.1]
+[copyright {2008 Sergei Golovan <sgolovan at nes.ru>}]
+[moddesc {Tcl XMPP library}]
+[titledesc {Operations with JIDs}]
+[require Tcl 8.3]
+[require xmpp::jid [opt 0.1]]
+[description]
+[para]
+
+This module is part of the XMPP library. It implements basic operations
+with JIDs (Jabber IDs).
+
+[section "COMMANDS"]
+
+[list_begin definitions]
+[call [cmd "::xmpp::jid::jid"] \
+	[arg "node"] \
+	[arg "server"] \
+	[opt [arg "resource"]]]
+
+Create JID from node, server and resource parts. If missing, resource is
+empty.
+
+[call [cmd "::xmpp::jid::split"] \
+	[arg "jid"] \
+        [arg "nodeVar"] \
+        [arg "serverVar"] \
+	[arg "resourceVar"]]
+
+Split JID into three parts and assign the specified variables.
+
+[call [cmd "::xmpp::jid::node"] [arg "jid"]]
+
+Return the node part of a specified JID.
+
+[call [cmd "::xmpp::jid::server"] [arg "jid"]]
+
+Return the server part of a specified JID.
+
+[call [cmd "::xmpp::jid::resource"] [arg "jid"]]
+
+Return the resource part of a specified JID.
+
+[call [cmd "::xmpp::jid::stripResource"] [arg "jid"]]
+
+Return the bare JID (a JID without resource part) corresponding
+to a specified JID.
+
+[call [cmd "::xmpp::jid::normalize"] [arg "jid"]]
+
+Return the normalized JID corresponding to a specified JID.
+
+[call [cmd "::xmpp::jid::equal"] [arg "jid1"] [arg "jid2"]]
+
+Compare two given JIDs (in normalized form) and return true if
+they are equivalent or false otherwise.
+
+[list_end]
+
+[section "AUTHORS"]
+Sergei Golovan
+
+[keywords Tcl XMPP JID]
+[manpage_end]

Added: trunk/doc/xmpp::xml.man
==============================================================================
--- (empty file)
+++ trunk/doc/xmpp::xml.man	Sun Oct 19 12:55:00 2008
@@ -0,0 +1,143 @@
+[comment {-*- tcl -*- doctools manpage}]
+[comment {$Id$}]
+[manpage_begin xmpp::man 3 0.1]
+[copyright {2008 Sergei Golovan <sgolovan at nes.ru>}]
+[moddesc {Tcl XMPP library}]
+[titledesc {Operations with JIDs}]
+[require Tcl 8.3]
+[require msgcat]
+[require tdom 0.8]
+[require xmpp::xml [opt 0.1]]
+[description]
+[para]
+
+This module is part of the XMPP library. It implements XML parsing and
+working with.
+
+[section "COMMANDS"]
+
+[list_begin definitions]
+[call [cmd "::xmpp::xml::new"] \
+	[arg "streamHeaderCmd"] \
+	[arg "streamTrailerCmd"] \
+	[arg "stanzaCmd"]]
+
+Create new XMPP stream parser.
+
+[call [cmd "::xmpp::xml::free"] [arg "token"]]
+
+Frees XMPP parser resources.
+
+[call [cmd "::xmpp::xml::parser"] \
+	[arg "token"] \
+	[arg "command"] \
+	[opt [arg "args"]]]
+
+Execute a given command.
+
+[call [cmd "::xmpp::xml::reset"] [arg "token"]]
+
+Reset XMPP stream parser.
+
+[call [cmd "::xmpp::xml::parseData"] \
+	[arg "data"] \
+	[opt [arg "stanzaComd"]]]
+
+Parse given data using a new XML parser and either return parsed XML
+or call the callback on every top level XML element.
+
+[call [cmd "::xmpp::xml::create"] \
+	[arg "tag"] \
+	[opt [arg "-xmlns xmlns"]] \
+	[opt [arg "-attrs attrs"]] \
+	[opt [arg "-cdata cdata"]] \
+	[opt [arg "-subelement subelement"]] \
+	[opt [arg "-subelements subelementsList"]]]
+
+Create XML element.
+
+[call [cmd "::xmpp::xml::split"] \
+	[arg "xmlelement"] \
+	[arg "tagVar"] \
+	[arg "xmlnsVar"] \
+	[arg "attrsVar"] \
+	[arg "cdataVar"] \
+	[arg "subelsVar"] \
+	[opt [arg "nextCdataVar"]]]
+
+Split XML data into five or six variables.
+
+[call [cmd "::xmpp::xml::merge"] \
+	[arg "tag"] \
+	[arg "xmlns"] \
+	[arg "attrs"] \
+	[arg "cdata"] \
+	[arg "subels"] \
+	[opt [arg "nextCdata"]]]
+
+Merge five or six variables into an XML element.
+
+[call [cmd "::xmpp::xml::isAttr"] \
+	[arg "attrList"] \
+	[arg "attrName"]]
+
+Check if a given attribute list contains a given attribute.
+
+[call [cmd "::xmpp::xml::getAttr"] \
+	[arg "attrList"] \
+	[arg "attrName"]]
+
+Return a given attribute value from an attribute list.
+
+[call [cmd "::xmpp::xml::getCdata"] \
+	[arg "xmlElement"]]
+
+Return all character data from a given element.
+
+[call [cmd "::xmpp::xml::getFirstCdata"] \
+	[arg "xmlElement"]]
+
+Return character data chunk which is located before the first XML  
subelement
+in a given element.
+
+[call [cmd "::xmpp::xml::getNextCdata"] \
+	[arg "xmlElement"]]
+
+Return character data chunk which is located after the given XML element.
+
+[call [cmd "::xmpp::xml::streamHeader"] \
+	[arg "server"] \
+	[arg "-xmlns:stream uri"] \
+	[arg "-xmlns uri"] \
+	[opt [arg "-xml:lang lang"]] \
+	[opt [arg "-version ver"]]]
+
+Return XMPP stream header.
+
+[call [cmd "::xmpp::xml::streamTrailer"]]
+
+Return XMPP stream trailer.
+
+[call [cmd "::xmpp::xml::lang"]]
+
+Return XML language string derived from msgcat preferences.
+
+[call [cmd "::xmpp::xml::toText"] \
+	[arg "xmlElement"] \
+	[opt [arg "parentNamespace"]]]
+
+Serialize a given XML element.
+
+[call [cmd "::xmpp::xml::toTabbedText"] \
+	[arg "xmlElement"] \
+	[opt [arg "parentNamespace"]]]
+
+Serialize a given XML element adding indentations.
+
+[list_end]
+
+[section "AUTHORS"]
+Sergei Golovan
+
+[keywords Tcl XMPP XML]
+[manpage_end]

Modified: trunk/xmpp/jid.tcl
==============================================================================
--- trunk/xmpp/jid.tcl	(original)
+++ trunk/xmpp/jid.tcl	Sun Oct 19 12:55:00 2008
@@ -13,7 +13,8 @@
  package provide xmpp::jid 0.1

  namespace eval ::xmpp::jid {
-    namespace export jid node server resource stripResource normalize equal
+    namespace export jid split node server resource stripResource \
+                     normalize equal

      if {[catch {package require stringprep}]} {
          variable Stringprep 0
@@ -173,7 +174,7 @@
  #       None.

  proc ::xmpp::jid::stripResource {jid} {
-    jid [node $jid] [server $jid] ""
+    jid [node $jid] [server $jid]
  }

  # ::xmpp::jid::normalize --


More information about the Tkabber-dev mailing list