Skip to content

Commit a5ef82a

Browse files
author
Colin Robertson
committed
Fix formatting, link typo
1 parent dc759c7 commit a5ef82a

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

docs/c-runtime-library/reference/strtok-s-strtok-s-l-wcstok-s-wcstok-s-l-mbstok-s-mbstok-s-l.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,20 @@ unsigned char* _mbstok_s(
128128
### Parameters
129129

130130
*str*
131-
String containing the token or tokens to find.
131+
A string containing the token or tokens to find.
132132

133-
*delimiters*
134-
Set of delimiter characters.
133+
*delimiters*
134+
The set of delimiter characters to use.
135135

136-
*context*
137-
Used to store position information between calls to `strtok_s`
136+
*context*
137+
Used to store position information between calls to the function.
138138

139-
`locale`
140-
Locale to use.
139+
*locale*
140+
The locale to use.
141141

142142
## Return Value
143-
Returns a pointer to the next token found in *str*. They return `NULL` when no more tokens are found. Each call modifies *str* by substituting a `NULL` character for the first delimiter that occurs after the returned token.
143+
144+
Returns a pointer to the next token found in *str*. Returns `NULL` when no more tokens are found. Each call modifies *str* by substituting a `NULL` character for the first delimiter that occurs after the returned token.
144145

145146
### Error Conditions
146147

@@ -150,25 +151,19 @@ unsigned char* _mbstok_s(
150151
|any|`NULL`|any|`NULL`|`EINVAL`|
151152
|any|any|`NULL`|`NULL`|`EINVAL`|
152153

153-
If *str* is `NULL` but context is a pointer to a valid context pointer, there is no error.
154+
If *str* is `NULL` but *context* is a pointer to a valid context pointer, there is no error.
154155

155156
## Remarks
156-
The `strtok_s` function finds the next token in *str*. The set of characters in *delimiters* specifies possible delimiters of the token to be found in *str* on the current call. `wcstok_s` and `_mbstok_s` are wide-character and multibyte-character versions of `strtok_s`. The arguments and return values of `wcstok_s` and `_wcstok_s_l` are wide-character strings; those of `_mbstok_s` and `_mbstok_s_l` are multibyte-character strings. These three functions behave identically otherwise.
157-
158-
This function validates its parameters. If an error condition occurs, as in the Error Conditions table, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set `errno` to `EINVAL` and return `NULL`.
159157

160-
### Generic-Text Routine Mappings
158+
The `strtok_s` family of functions finds the next token in *str*. The set of characters in *delimiters* specifies possible delimiters of the token to be found in *str* on the current call. `wcstok_s` and `_mbstok_s` are wide-character and multibyte-character versions of `strtok_s`. The arguments and return values of `wcstok_s` and `_wcstok_s_l` are wide-character strings; those of `_mbstok_s` and `_mbstok_s_l` are multibyte-character strings. These functions behave identically otherwise.
161159

162-
|TCHAR.H routine|_UNICODE & _MBCS not defined|_MBCS defined|_UNICODE defined|
163-
|---------------------|------------------------------------|--------------------|-----------------------|
164-
|`_tcstok_s`|`strtok_s`|`_mbstok_s`|`wcstok_s`|
165-
|`_tcstok_s_l`|`_strtok_s_l`|`_mbstok_s_l`|`_wcstok_s_l`|
160+
This function validates its parameters. If an error condition occurs, as in the Error Conditions table, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set `errno` to `EINVAL` and return `NULL`.
166161

167162
On the first call to `strtok_s` the function skips leading delimiters and returns a pointer to the first token in *str*, terminating the token with a null character. More tokens can be broken out of the remainder of *str* by a series of calls to `strtok_s`. Each call to `strtok_s` modifies *str* by inserting a null character after the token returned by that call. The *context* pointer keeps track of which string is being read and where in the string the next token is to be read. To read the next token from *str*, call `strtok_s` with a `NULL` value for the *str* argument, and pass the same *context* parameter. The `NULL` *str* argument causes `strtok_s` to search for the next token in the modified *str*. The *delimiters* argument can take any value from one call to the next so that the set of delimiters may vary.
168163

169164
Since the *context* parameter supersedes the static buffers used in `strtok` and `_strtok_l`, it is possible to parse two strings simultaneously in the same thread.
170165

171-
The output value is affected by the setting of the `LC_CTYPE` category setting of the locale; see [setlocale](../../c-runtime-library/reference/setlocale-wsetlocale.md) for more information. The versions of these functions without the `_l` suffix use the current locale for this locale-dependent behavior; the versions with the `_l` suffix are identical except that they use the locale parameter passed in instead. For more information, see [Locale](../../c-runtime-library/locale.md).
166+
The output value is affected by the setting of the `LC_CTYPE` category setting of the locale; see [setlocale](../../c-runtime-library/reference/setlocale-wsetlocale.md) for more information. The versions of these functions without the `_l` suffix use the current thread locale for this locale-dependent behavior. The versions with the `_l` suffix are identical except that they instead use the *locale* parameter. For more information, see [Locale](../../c-runtime-library/locale.md).
172167

173168
## Requirements
174169

@@ -181,6 +176,13 @@ The output value is affected by the setting of the `LC_CTYPE` category setting o
181176

182177
For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
183178

179+
### Generic-Text Routine Mappings
180+
181+
|TCHAR.H routine|\_UNICODE & \_MBCS not defined|\_MBCS defined|_UNICODE defined|
182+
|---------------------|------------------------------------|--------------------|-----------------------|
183+
|`_tcstok_s`|`strtok_s`|`_mbstok_s`|`wcstok_s`|
184+
|`_tcstok_s_l`|`_strtok_s_l`|`_mbstok_s_l`|`_wcstok_s_l`|
185+
184186
## Example
185187

186188
```C

docs/error-messages/compiler-errors-1/fatal-error-c1001.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ translation.priority.ht:
4040
4141
The compiler cannot generate correct code for a construct, often due to the combination of a particular expression and an optimization option, or an issue in parsing. If the compiler file listed has a utc or C2 path segment, it is probably an optimization error. If the file has a cxxfe or c1xx path segment, or is msc1.cpp, it is probably a parser error. If the file named is cl.exe, there is no other information available.
4242

43-
You can often fix an optimization problem by removing one or more optimization options. To determine which option is at fault, remove options one at a time and recompile until the error message goes away. The options most commonly responsible are [/Og (Global optimizations)](../../build/reference/og-global-optimizations.md) and [/Oi (Generate Intrinsic Functions)](../../build/reference/og-generate-intrinsic-functions.md). Once you determine which optimization option is responsible, you can disable it around the function where the error occurs by using the [optimize](../../preprocessor/optimize.md) pragma, and continue to use the option for the rest of the module. For more information about optimization options, see [Optimization best practices](../../build/reference/optimization-best-practices.md).
43+
You can often fix an optimization problem by removing one or more optimization options. To determine which option is at fault, remove options one at a time and recompile until the error message goes away. The options most commonly responsible are [/Og (Global optimizations)](../../build/reference/og-global-optimizations.md) and [/Oi (Generate Intrinsic Functions)](../../build/reference/oi-generate-intrinsic-functions.md). Once you determine which optimization option is responsible, you can disable it around the function where the error occurs by using the [optimize](../../preprocessor/optimize.md) pragma, and continue to use the option for the rest of the module. For more information about optimization options, see [Optimization best practices](../../build/reference/optimization-best-practices.md).
4444

4545
If optimizations are not responsible for the error, try rewriting the line where the error is reported, or several lines of code surrounding that line. To see the code the way the compiler sees it after preprocessing, you can use the [/P (Preprocess to a file)](../../build/reference/p-preprocess-to-a-file.md) option.
4646

0 commit comments

Comments
 (0)