Update doc/efun/ aus Driversourcen.
Manpages der efuns aktualisiert, neue Manpages hinzugefuegt.
Change-Id: I7cc91684269ff56d1aef47d5c5e7c87f7fd531dc
diff --git a/doc/efun/sscanf b/doc/efun/sscanf
index 4344d0e..da96bfe 100644
--- a/doc/efun/sscanf
+++ b/doc/efun/sscanf
@@ -1,81 +1,78 @@
SYNOPSIS
int sscanf(string str, string fmt, mixed var1, mixed var2, ...)
-BESCHREIBUNG
- Wertet einen String <str> unter Beruecksichtigung des Formats
- <fmt>. <fmt> kann Strings beinhalten, die durch %d und %s getrennt
- werden. Jedes %d und %s entspricht einer der Variablen <var1>,
- <var2> etc.
+DESCRIPTION
+ Parse a string str using the format fmt. fmt can contain
+ strings seperated by %d and %s. Every %d and %s corresponds to
+ one of var1, var2, ... .
- Die Operatoren im Format-String <fmt> haben eines der folgenden
- Formate:
+ The match operators in the format string have one of these
+ formats:
+ %[+][!|~][<size>[.<minmatch>]]<type>
- %[+][!|~][<size>[.<minmatch>]]<type>
+ <type> may be:
+ d: matches any number.
+ D: matches any number.
+ U: matches any unsigned number.
+ s: matches any string.
+ %: matches the % character.
+ t: matches whitespace (spaces and tab characters), but does
+ not store them (the simple ' ' matches just spaces and
+ can't be given a size specification).
- <type> kann folgendes sein:
- d: meldet eine Zahl
- D: meldet eine Zahl
- U:
- s: meldet eine Zeichenkette
- %: meldet das %-Zeichen
- t: meldet Whitespaces (also Leerschlaege und Tabulatoren),
- speichert diese aber nicht.
+ <size> is the expected field size, <minmatch> the demanded
+ minimal match length (defaults are 0 for strings and 1 for
+ numbers). Each of these both may be specified numerically, or
+ as '*' - then the value of the variable at the current place
+ in the argument list is used.
- <size> ist die erwartete Feldgroesse, <minmatch> die verlangte
- minimale Laenge fuer einen Treffer (Standardwerte sind 0 fuer
- Strings und 1 fuer Nummern). Sowohl <size> als auch <minmatch> kann
- entweder numerisch oder mit '*' angegeben werden - im zweiten Fall
- wird die gueltige Variable in der Liste der Argumente benutzt.
+ Specifying + will require that the characters after the field
+ match as well, or the match will be deemed unsuccessful (the variable
+ might still get assigned, though).
- Wird + angegeben, muessen die Zeichen nach dem Feld ebenfalls
- matchen. Ist dies nicht der Fall, wird das Feld als Misserfolg
- betrachted (auch wenn der Wert bereits an die zugehoerige Variable
- zugewiesen wurde).
+ Specifying ! will perform the match, but neither store the
+ result nor count the match.
- Wird ! angegeben, wird zwar die Suche durchgefuehrt, aber Treffer
- werden weder gespeichert noch gezaehlt. Mit ~ als Argument wird
- zwar die Suche durchgefuehrt und die Treffer gezaehlt, das Resultat
- wird aber nicht gespeichert.
+ Specifying ~ will perform and count the match, but not store
+ the result.
- Wenn %s nicht am Ende von <fmt> steht, wird nur ein Treffer
- registriert, wenn auch der nachfolgende String bzw. das
- nachfolgende Format gefunden wird. Weiter unten gibt es dazu
- ein Beispiel.
+ If the %s specifier is not at the end of the format string,
+ it is matched only if the following character(s) or format
+ is found, too. See below for an example.
- Der Unterschied zwischen %d und %D %U ist, dass letzteres ein
- unmittelbar vorausgehendes %s so bald als moeglich abbricht,
- waehrend ersteres zuerst versucht, einen moeglichst grossen Treffer
- fuer %s zu erzielen. Trotzdem ueberspringt %D/%U keine Whitespaces,
- dazu muss %.0t%D gesetzt werden.
+ The difference between %d and %D/%U is that the latter will abort
+ an immediately preceeding %s as soon as possible, whereas the
+ former will attempt to make largest match to %s first.
+ %D/%U will still not skip whitespace, use %.0t%D to skip optional
+ whitespace.
- Wenn eine Zahl erkannt wird, welche ausserhalb des Zahlenbereiches
- von Integers ist, so wird dies nicht als Treffer betrachtet.
+ If a number is matched that exceeds the numerical limits of
+ integers the match is deemed unsuccessful.
- Zurueck gegeben wird die Anzahl Treffer.
+ The number of matched arguments will be returned.
- Die Funktion sscanf() ist insofern ein Spezialfall, als dass
- Argumente automatisch nach Referenz uebergeben werden.
+ The function sscanf is special, in that arguments are passed
+ by reference automatically.
-BEISPIELE
+EXAMPLES
string who, what;
- if (sscanf("wirf frisbee zu rex",
- "wirf %s zu %s", what, who) != 2)
- write("Usage: Wirf <what> zu <who>\n");
- else
- write("Du wirfst einen "+what+" zu "+who+" um auf dich "
- "aufmerksam zu machen.\n");
+ if (sscanf("throw frisbee to rover",
+ "throw %s to %s", what, who) != 2)
+ write("Usage: throw <what> to <who>\n");
+ else
+ write("You throw a "+what+" to "+who+" to get his attention.\n");
sscanf("ab", "%s%s", who, what)
- ==> liefert 2, who = "", what = "ab"
+ ==> result 2, who = "", what = "ab"
sscanf("ab", "%s %s", who, what)
- ==> liefert 0, who = 0, what = 0
+ ==> result 0, who = 0, what = 0
sscanf("ab ", "%s %s", who, what)
- ==> liefert 2, who = "ab", what = ""
+ ==> result 2, who = "ab", what = ""
-GESCHICHTE
- LDMud 3.3.713/3.2.13 fuehrte den '+'-Modifizierer ein.
+HISTORY
+ LDMud 3.3.713/3.2.13 introduced the '+' specifier.
-SIEHE AUCH
+SEE ALSO
explode(E), regexp(E)