diff options
Diffstat (limited to 'doc/ScintillaDoc.html')
-rw-r--r-- | doc/ScintillaDoc.html | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index b75d3c399..da63297bf 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -169,7 +169,9 @@ <td>Arguments point at text buffers that Scintilla will fill with text. In some cases, another argument will tell Scintilla the buffer size. In others, you must make sure that the buffer is big enough to hold the requested text. If a NULL pointer (0) is passed - then, for SCI_* calls, the length that should be allocated is returned.</td> + then, for SCI_* calls, the length that should be allocated, not including any terminating + NUL, is returned. Some calls (marked "NUL-terminated") add a NUL character to the result but other calls do + not: to generically handle both types, allocate one more byte than indicated and set it to NUL.</td> </tr> <tr> @@ -417,7 +419,7 @@ <a class="message" href="#SCI_SETLENGTHFORENCODE">SCI_SETLENGTHFORENCODE(int bytes)</a><br /> </code> - <p><b id="SCI_GETTEXT">SCI_GETTEXT(int length, char *text)</b><br /> + <p><b id="SCI_GETTEXT">SCI_GETTEXT(int length, char *text NUL-terminated)</b><br /> This returns <code>length</code>-1 characters of text from the start of the document plus one terminating 0 character. To collect all the text in a document, use <code>SCI_GETLENGTH</code> to get the number of characters in the document (<code>nLen</code>), allocate a character @@ -700,7 +702,7 @@ struct Sci_TextRange { After replacement, the target range refers to the replacement text. The return value is the length of the replacement string.</p> - <p><b id="SCI_GETTAG">SCI_GETTAG(int tagNumber, char *tagValue)</b><br /> + <p><b id="SCI_GETTAG">SCI_GETTAG(int tagNumber, char *tagValue NUL-terminated)</b><br /> Discover what text was matched by tagged expressions in a regular expression search. This is useful if the application wants to interpret the replacement string itself.</p> @@ -1331,7 +1333,7 @@ struct Sci_TextToFind { href="#SCI_GETLINEENDPOSITION"><code>SCI_GETLINEENDPOSITION(line)</code></a> - <a class="message" href="#SCI_POSITIONFROMLINE"><code>SCI_POSITIONFROMLINE(line)</code></a>.</p> - <p><b id="SCI_GETSELTEXT">SCI_GETSELTEXT(<unused>, char *text)</b><br /> + <p><b id="SCI_GETSELTEXT">SCI_GETSELTEXT(<unused>, char *text NUL-terminated)</b><br /> This copies the currently selected text and a terminating 0 byte to the <code>text</code> buffer. The buffer size should be determined by calling with a NULL pointer for the <code>text</code> argument <code>SCI_GETSELTEXT(0,0)</code>. @@ -1346,7 +1348,7 @@ struct Sci_TextToFind { <a class="message" href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a> </code></p> - <p><b id="SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text)</b><br /> + <p><b id="SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text NUL-terminated)</b><br /> This retrieves the text of the line containing the caret and returns the position within the line of the caret. Pass in <code>char* text</code> pointing at a buffer large enough to hold the text you wish to retrieve and a terminating 0 character. @@ -2573,7 +2575,7 @@ struct Sci_TextToFind { 3. Set the style attributes that make your lexical styles different.</p> <p><b id="SCI_STYLESETFONT">SCI_STYLESETFONT(int styleNumber, const char *fontName)</b><br /> - <b id="SCI_STYLEGETFONT">SCI_STYLEGETFONT(int styleNumber, char *fontName)</b><br /> + <b id="SCI_STYLEGETFONT">SCI_STYLEGETFONT(int styleNumber, char *fontName NUL-terminated)</b><br /> <b id="SCI_STYLESETSIZE">SCI_STYLESETSIZE(int styleNumber, int sizeInPoints)</b><br /> <b id="SCI_STYLEGETSIZE">SCI_STYLEGETSIZE(int styleNumber)</b><br /> <b id="SCI_STYLESETSIZEFRACTIONAL">SCI_STYLESETSIZEFRACTIONAL(int styleNumber, int sizeInHundredthPoints)</b><br /> @@ -2878,7 +2880,7 @@ struct Sci_TextToFind { </code> <p><b id="SCI_SETREPRESENTATION">SCI_SETREPRESENTATION(const char *encodedCharacter, const char *representation)</b><br /> - <b id="SCI_GETREPRESENTATION">SCI_GETREPRESENTATION(const char *encodedCharacter, char *representation)</b><br /> + <b id="SCI_GETREPRESENTATION">SCI_GETREPRESENTATION(const char *encodedCharacter, char *representation NUL-terminated)</b><br /> <b id="SCI_CLEARREPRESENTATION">SCI_CLEARREPRESENTATION(const char *encodedCharacter)</b><br /> Any character, including those normally displayed as mnemonics may be represented by a string inverted in a rounded rectangle.</p> @@ -4405,7 +4407,7 @@ struct Sci_TextToFind { href="#SCI_AUTOCSETAUTOHIDE"><code>SCI_AUTOCSETAUTOHIDE</code></a>).<br /> The current selection index can be retrieved with <code>SCI_AUTOCGETCURRENT</code>.</p> - <p><b id="SCI_AUTOCGETCURRENTTEXT">SCI_AUTOCGETCURRENTTEXT(<unused>, char *text)</b><br /> + <p><b id="SCI_AUTOCGETCURRENTTEXT">SCI_AUTOCGETCURRENTTEXT(<unused>, char *text NUL-terminated)</b><br /> This message retrieves the current selected text in the autocompletion list. Normally the <a class="message" href="#SCN_AUTOCSELECTION"><code>SCN_AUTOCSELECTION</code></a> notification is used instead.</p> @@ -6102,7 +6104,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ assigns unused lexer numbers to.</p> <p><b id="SCI_SETLEXERLANGUAGE">SCI_SETLEXERLANGUAGE(<unused>, const char *name)</b><br /> - <b id="SCI_GETLEXERLANGUAGE">SCI_GETLEXERLANGUAGE(<unused>, char *name)</b><br /> + <b id="SCI_GETLEXERLANGUAGE">SCI_GETLEXERLANGUAGE(<unused>, char *name NUL-terminated)</b><br /> <code>SCI_SETLEXERLANGUAGE</code> lets you select a lexer by name, and is the only method if you are using an external lexer or if you have written a lexer module for a language of your own and do not wish to assign it an explicit lexer number. To select an existing lexer, set <code>name</code> to @@ -6133,9 +6135,9 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ Indicate that the internal state of a lexer has changed over a range and therefore there may be a need to redraw.</p> - <p><b id="SCI_PROPERTYNAMES">SCI_PROPERTYNAMES(<unused>, char *names)</b><br /> + <p><b id="SCI_PROPERTYNAMES">SCI_PROPERTYNAMES(<unused>, char *names NUL-terminated)</b><br /> <b id="SCI_PROPERTYTYPE">SCI_PROPERTYTYPE(const char *name)</b><br /> - <b id="SCI_DESCRIBEPROPERTY">SCI_DESCRIBEPROPERTY(const char *name, char *description)</b><br /> + <b id="SCI_DESCRIBEPROPERTY">SCI_DESCRIBEPROPERTY(const char *name, char *description NUL-terminated)</b><br /> Information may be retrieved about the properties that can be set for the current lexer. This information is only available for newer lexers. <code>SCI_PROPERTYNAMES</code> returns a string with all of the valid properties separated by "\n". @@ -6174,7 +6176,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ Documentation for the property may be located above the call as a multi-line comment starting with <br/><code>// property <property-name></code></p> - <p><b id="SCI_GETPROPERTY">SCI_GETPROPERTY(const char *key, char *value)</b><br /> + <p><b id="SCI_GETPROPERTY">SCI_GETPROPERTY(const char *key, char *value NUL-terminated)</b><br /> Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied buffer and return the length (not including the terminating 0). If not found, copy an empty string to the buffer and return 0.</p> @@ -6226,7 +6228,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ There is nothing to stop you building your own keyword lists into the lexer, but this means that the lexer must be rebuilt if more keywords are added.</p> - <p><b id="SCI_DESCRIBEKEYWORDSETS">SCI_DESCRIBEKEYWORDSETS(<unused>, char *descriptions)</b><br /> + <p><b id="SCI_DESCRIBEKEYWORDSETS">SCI_DESCRIBEKEYWORDSETS(<unused>, char *descriptions NUL-terminated)</b><br /> A description of all of the keyword sets separated by "\n" is returned by <code>SCI_DESCRIBEKEYWORDSETS</code>.</p> <h3 id="Substyles">Substyles</h3> @@ -6237,7 +6239,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ each purpose. Lexers have to explicitly support this feature by implementing the methods in <code>ILexerWithSubStyles</code>.</p> - <p><b id="SCI_GETSUBSTYLEBASES">SCI_GETSUBSTYLEBASES(<unused>, char *styles)</b><br /> + <p><b id="SCI_GETSUBSTYLEBASES">SCI_GETSUBSTYLEBASES(<unused>, char *styles NUL-terminated)</b><br /> Fill <code>styles</code> with a byte for each style that can be split into substyles.</p> <p><b id="SCI_DISTANCETOSECONDARYSTYLES">SCI_DISTANCETOSECONDARYSTYLES</b><br /> |