Skip to content

Commit de44955

Browse files
authored
Merge pull request #4121 from craigcaseyMSFT/vcraigcasey0218
US1907300 - add md code escapes to code elements - PR15
2 parents a27ccf6 + 51510ec commit de44955

10 files changed

Lines changed: 653 additions & 639 deletions

File tree

docs/c-runtime-library/reference/abs-labs-llabs-abs64.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["stdlib/_abs64", "math/abs", "_abs64", "abs", "labs", "math/labs", "llabs", "math/llabs", "cmath/abs"]
1010
helpviewer_keywords: ["absolute values", "abs function", "abs64 function", "_abs64 function", "calculating absolute values"]
11-
ms.assetid: 60f789d1-4a1e-49f5-9e4e-0bdb277ea26a
1211
---
13-
# abs, labs, llabs, _abs64
12+
# `abs`, `labs`, `llabs`, `_abs64`
1413

1514
Calculates the absolute value of the argument.
1615

@@ -33,27 +32,27 @@ float abs( float n ); // C++ only
3332

3433
### Parameters
3534

36-
*n*\
35+
*`n`*\
3736
Numeric value.
3837

3938
## Return Value
4039

41-
The **abs**, **labs**, **llabs**, and **_abs64** functions return the absolute value of the parameter *n*. There's no error return.
40+
The **`abs`**, **`labs`**, **`llabs`**, and **`_abs64`** functions return the absolute value of the parameter *`n`*. There's no error return.
4241

4342
## Remarks
4443

45-
Because C++ allows overloading, you can call overloads of **abs** that take and return **`long`**, **`long long`**, **`float`**, **`double`**, and **`long double`** values. These overloads are defined in the \<cmath> header. In a C program, **abs** always takes and returns an **`int`**.
44+
Because C++ allows overloading, you can call overloads of **`abs`** that take and return **`long`**, **`long long`**, **`float`**, **`double`**, and **`long double`** values. These overloads are defined in the `<cmath>` header. In a C program, **`abs`** always takes and returns an **`int`**.
4645

47-
**Microsoft-specific**: Because the range of negative integers that can be represented by using any integral type is larger than the range of positive integers that can be represented by using that type, it's possible to supply an argument to these functions that can't be converted. If the absolute value of the argument cannot be represented by the return type, the **abs** functions return the argument value unchanged. Specifically, `abs(INT_MIN)` returns `INT_MIN`, `labs(LONG_MIN)` returns `LONG_MIN`, `llabs(LLONG_MIN)` returns `LLONG_MIN`, and `_abs64(_I64_MIN)` returns `_I64_MIN`. This means that the **abs** functions cannot be used to guarantee a positive value.
46+
**Microsoft-specific**: Because the range of negative integers that can be represented by using any integral type is larger than the range of positive integers that can be represented by using that type, it's possible to supply an argument to these functions that can't be converted. If the absolute value of the argument can’t be represented by the return type, the **`abs`** functions return the argument value unchanged. Specifically, `abs(INT_MIN)` returns `INT_MIN`, `labs(LONG_MIN)` returns `LONG_MIN`, `llabs(LLONG_MIN)` returns `LLONG_MIN`, and `_abs64(_I64_MIN)` returns `_I64_MIN`. This means that the **`abs`** functions can’t be used to guarantee a positive value.
4847

4948
## Requirements
5049

5150
|Routine|Required C header|Required C++ header|
5251
|-------------|-----------------------|---------------------------|
53-
|**abs**, **labs**, **llabs**|\<math.h> or \<stdlib.h>|\<cmath>, \<cstdlib>, \<stdlib.h> or \<math.h>|
54-
|**_abs64**|\<stdlib.h>|\<cstdlib> or \<stdlib.h>|
52+
|**`abs`**, **`labs`**, **`llabs`**|`<math.h>` or `<stdlib.h>`|`<cmath>`, `<cstdlib>`, `<stdlib.h>` or `<math.h>`|
53+
|**`_abs64`**|`<stdlib.h>`|`<cstdlib>` or `<stdlib.h>`|
5554

56-
To use the overloaded versions of **abs** in C++, you must include the \<cmath> header.
55+
To use the overloaded versions of **`abs`** in C++, you must include the `<cmath>` header.
5756

5857
## Example
5958

@@ -114,8 +113,8 @@ _abs64(_I64_MIN) returns 0x8000000000000000
114113

115114
## See also
116115

117-
[Data Conversion](../../c-runtime-library/data-conversion.md)<br/>
118-
[Floating-Point Support](../../c-runtime-library/floating-point-support.md)<br/>
119-
[_cabs](cabs.md)<br/>
120-
[fabs, fabsf, fabsl](fabs-fabsf-fabsl.md)<br/>
121-
[imaxabs](imaxabs.md)
116+
[Data Conversion](../../c-runtime-library/data-conversion.md)\
117+
[Floating-Point Support](../../c-runtime-library/floating-point-support.md)\
118+
[`_cabs`](cabs.md)\
119+
[`fabs`, `fabsf`, `fabsl`](fabs-fabsf-fabsl.md)\
120+
[`imaxabs`](imaxabs.md)

docs/c-runtime-library/reference/gmtime-gmtime32-gmtime64.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["gmtime", "_gmtime32", "_gmtime64"]
1010
helpviewer_keywords: ["gmtime32 function", "_gmtime64 function", "gmtime function", "time functions", "_gmtime32 function", "gmtime64 function", "time structure conversion"]
11-
ms.assetid: 315501f3-477e-475d-a414-ef100ee0db27
1211
---
1312
# `gmtime`, `_gmtime32`, `_gmtime64`
1413

@@ -41,15 +40,15 @@ A pointer to a structure of type [`tm`](../../c-runtime-library/standard-types.m
4140
|`tm_year`|Year (current year minus 1900).|
4241
|`tm_wday`|Day of week (0 - 6; Sunday = 0).|
4342
|`tm_yday`|Day of year (0 - 365; January 1 = 0).|
44-
|`tm_isdst`|Always 0 for **gmtime**.|
43+
|`tm_isdst`|Always 0 for **`gmtime`**.|
4544
4645
Both the 32-bit and 64-bit versions of **`gmtime`**, [`mktime`](mktime-mktime32-mktime64.md), [`mkgmtime`](mkgmtime-mkgmtime32-mkgmtime64.md), and [`localtime`](localtime-localtime32-localtime64.md) all use one common `tm` structure per thread for the conversion. Each call to one of these functions destroys the result of any previous call. If *`sourceTime`* represents a date before midnight, January 1, 1970, **`gmtime`** returns `NULL`. There's no error return.
4746
48-
**_gmtime64**, which uses the `__time64_t` structure, enables dates to be expressed up through 23:59:59, December 31, 3000, UTC. **`_gmtime32`** only represent dates through 23:59:59 January 18, 2038, UTC. Midnight, January 1, 1970, is the lower bound of the date range for both functions.
47+
**`_gmtime64`**, which uses the `__time64_t` structure, enables dates to be expressed up through 23:59:59, December 31, 3000, UTC. **`_gmtime32`** only represent dates through 23:59:59 January 18, 2038, UTC. Midnight, January 1, 1970, is the lower bound of the date range for both functions.
4948
50-
**`gmtime`** is an inline function that evaluates to **`_gmtime64`**, and `time_t` is equivalent to `__time64_t` unless `_USE_32BIT_TIME_T` is defined. If you must force the compiler to interpret `time_t` as the old 32-bit `time_t`, you can define `_USE_32BIT_TIME_T`, but doing so causes **`gmtime`** to be in-lined to **`_gmtime32`** and `time_t` to be defined as `__time32_t`. We don't recommend that you do this, because it isn't allowed on 64-bit platforms. In any case, your application may fail after January 18, 2038.
49+
**`gmtime`** is an inline function that evaluates to **`_gmtime64`**, and `time_t` is equivalent to `__time64_t` unless `_USE_32BIT_TIME_T` is defined. If you must force the compiler to interpret `time_t` as the old 32-bit `time_t`, you can define `_USE_32BIT_TIME_T`, but doing so causes **`gmtime`** to be in-lined to **`_gmtime32`** and `time_t` to be defined as `__time32_t`. We don't recommend that you do this, because it isn't allowed on 64-bit platforms. In any case, your application may fail after January 18, 2038.
5150
52-
These functions validate their parameters. If *`sourceTime`* is a null pointer, or if the *`sourceTime`* value is negative, these functions invoke an invalid parameter handler, as described in [Parameter validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, the functions return `NULL` and set `errno` to `EINVAL`.
51+
These functions validate their parameters. If *`sourceTime`* is a `NULL` pointer, or if the *`sourceTime`* value is negative, these functions invoke an invalid parameter handler, as described in [Parameter validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, the functions return `NULL` and set `errno` to `EINVAL`.
5352
5453
## Remarks
5554

docs/c-runtime-library/reference/open-osfhandle.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_open_osfhandle", "open_osfhandle"]
1010
helpviewer_keywords: ["open_osfhandle function", "file handles [C++], associating", "_open_osfhandle function"]
11-
ms.assetid: 30d94df4-7868-4667-a401-9eb67ecb7855
1211
---
13-
# _open_osfhandle
12+
# `_open_osfhandle`
1413

1514
Associates a C run-time file descriptor with an existing operating system file handle.
1615

@@ -25,42 +24,42 @@ int _open_osfhandle (
2524

2625
### Parameters
2726

28-
*osfhandle*<br/>
27+
*`osfhandle`*\
2928
Operating system file handle.
3029

31-
*flags*<br/>
30+
*`flags`*\
3231
Types of operations allowed.
3332

3433
## Return Value
3534

36-
If successful, **_open_osfhandle** returns a C run-time file descriptor. Otherwise, it returns -1.
35+
If successful, **`_open_osfhandle`** returns a C run-time file descriptor. Otherwise, it returns -1.
3736

3837
## Remarks
3938

40-
The **_open_osfhandle** function allocates a C run-time file descriptor. It associates this file descriptor with the operating system file handle specified by *osfhandle*. To avoid a compiler warning, cast the *osfhandle* argument from **HANDLE** to **intptr_t**. The *flags* argument is an integer expression formed from one or more of the manifest constants defined in \<fcntl.h>. You can use the bitwise-OR operator ( **&#124;** ) to combine two or more manifest constants to form the *flags* argument.
39+
The **`_open_osfhandle`** function allocates a C run-time file descriptor. It associates this file descriptor with the operating system file handle specified by *`osfhandle`*. To avoid a compiler warning, cast the *`osfhandle`* argument from **`HANDLE`** to **`intptr_t`**. The *`flags`* argument is an integer expression formed from one or more of the manifest constants defined in `<fcntl.h>`. You can use the bitwise "or" (`|`) operator to combine two or more manifest constants to form the *`flags`* argument.
4140

42-
These manifest constants are defined in \<fcntl.h>:
41+
These manifest constants are defined in `<fcntl.h>`:
4342

4443
| Constant | Description |
4544
|--|--|
46-
| **\_O\_APPEND** | Positions a file pointer to the end of the file before every write operation. |
47-
| **\_O\_RDONLY** | Opens the file for reading only. |
48-
| **\_O\_TEXT** | Opens the file in text (translated) mode. |
49-
| **\_O\_WTEXT** | Opens the file in Unicode (translated UTF-16) mode. |
45+
| **`_O_APPEND`** | Positions a file pointer to the end of the file before every write operation. |
46+
| **`_O_RDONLY`** | Opens the file for reading only. |
47+
| **`_O_TEXT`** | Opens the file in text (translated) mode. |
48+
| **`_O_WTEXT`** | Opens the file in Unicode (translated UTF-16) mode. |
5049

51-
The **_open_osfhandle** call transfers ownership of the Win32 file handle to the file descriptor. To close a file opened by using **_open_osfhandle**, call [\_close](close.md). The underlying OS file handle is also closed by a call to **_close**. Don't call the Win32 function **CloseHandle** on the original handle. If the file descriptor is owned by a `FILE *` stream, then a call to [fclose](fclose-fcloseall.md) closes both the file descriptor and the underlying handle. In this case, don't call **_close** on the file descriptor or **CloseHandle** on the original handle.
50+
The **`_open_osfhandle`** call transfers ownership of the Win32 file handle to the file descriptor. To close a file opened by using **`_open_osfhandle`**, call [`_close`](close.md). The underlying OS file handle is also closed by a call to **`_close`**. Don't call the Win32 function **`CloseHandle`** on the original handle. If the file descriptor is owned by a `FILE *` stream, then a call to [`fclose`](fclose-fcloseall.md) closes both the file descriptor and the underlying handle. In this case, don't call **`_close`** on the file descriptor or **`CloseHandle`** on the original handle.
5251

5352
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
5453

5554
## Requirements
5655

5756
|Routine|Required header|
5857
|-------------|---------------------|
59-
|**_open_osfhandle**|\<io.h>|
58+
|**`_open_osfhandle`**|`<io.h>`|
6059

6160
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
6261

6362
## See also
6463

65-
[File Handling](../../c-runtime-library/file-handling.md)<br/>
66-
[\_get_osfhandle](get-osfhandle.md)
64+
[File Handling](../../c-runtime-library/file-handling.md)\
65+
[`_get_osfhandle`](get-osfhandle.md)

docs/c-runtime-library/reference/putenv-wputenv.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_tputenv", "_wputenv", "_putenv", "wputenv", "tputenv"]
1010
helpviewer_keywords: ["_putenv function", "environment variables, deleting", "putenv function", "tputenv function", "environment variables, creating", "wputenv function", "_wputenv function", "_tputenv function", "environment variables, modifying"]
11-
ms.assetid: 9ba9b7fd-276e-45df-8420-d70c4204b8bd
1211
---
13-
# _putenv, _wputenv
12+
# `_putenv`, `_wputenv`
1413

15-
Creates, modifies, or removes environment variables. More secure versions of these functions are available; see [_putenv_s, _wputenv_s](putenv-s-wputenv-s.md).
14+
Creates, modifies, or removes environment variables. More secure versions of these functions are available; see [`_putenv_s`, `_wputenv_s`](putenv-s-wputenv-s.md).
1615

1716
> [!IMPORTANT]
1817
> This API cannot be used in applications that execute in the Windows Runtime. For more information, see [CRT functions not supported in Universal Windows Platform apps](../../cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md).
@@ -30,7 +29,7 @@ int _wputenv(
3029

3130
### Parameters
3231

33-
*envstring*<br/>
32+
*`envstring`*\
3433
Environment-string definition.
3534

3635
## Return Value
@@ -39,42 +38,42 @@ Return 0 if successful or -1 in the case of an error.
3938

4039
## Remarks
4140

42-
The **_putenv** function adds new environment variables or modifies the values of existing environment variables. Environment variables define the environment in which a process executes (for example, the default search path for libraries to be linked with a program). **_wputenv** is a wide-character version of **_putenv**; the *envstring* argument to **_wputenv** is a wide-character string.
41+
The **`_putenv`** function adds new environment variables or modifies the values of existing environment variables. Environment variables define the environment in which a process executes (for example, the default search path for libraries to be linked with a program). **`_wputenv`** is a wide-character version of **`_putenv`**; the *`envstring`* argument to **`_wputenv`** is a wide-character string.
4342

4443
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
4544

4645
### Generic-Text Routine Mappings
4746

48-
|Tchar.h routine|_UNICODE and _MBCS not defined|_MBCS defined|_UNICODE defined|
47+
|`Tchar.h` routine|`_UNICODE and _MBCS` not defined|`_MBCS` defined|`_UNICODE` defined|
4948
|---------------------|--------------------------------------|--------------------|-----------------------|
50-
|**_tputenv**|**_putenv**|**_putenv**|**_wputenv**|
49+
|**`_tputenv`**|**`_putenv`**|**`_putenv`**|**`_wputenv`**|
5150

52-
The *envstring* argument must be a pointer to a string of the form *varname*=*value_string*, where *varname* is the name of the environment variable to be added or modified and *value_string* is the variable's value. If *varname* is already part of the environment, its value is replaced by *value_string*; otherwise, the new *varname* variable and its *value_string* value are added to the environment. You can remove a variable from the environment by specifying an empty *value_string*, or in other words, by specifying only *varname*=.
51+
The *`envstring`* argument must be a pointer to a string of the form *`varname=value_string`*, where *`varname`* is the name of the environment variable to be added or modified and *`value_string`* is the variable's value. If *`varname`* is already part of the environment, its value is replaced by *`value_string`*; otherwise, the new *`varname`* variable and its *`value_string`* value are added to the environment. You can remove a variable from the environment by specifying an empty *`value_string`*, or in other words, by specifying only *`varname`*=.
5352

54-
**_putenv** and **_wputenv** affect only the environment that is local to the current process; you cannot use them to modify the command-level environment. That is, these functions operate only on data structures accessible to the run-time library and not on the environment segment created for a process by the operating system. When the current process terminates, the environment reverts to the level of the calling process (in most cases, the operating-system level). However, the modified environment can be passed to any new processes created by **_spawn**, **_exec**, or **system**, and these new processes get any new items added by **_putenv** and **_wputenv**.
53+
**`_putenv`** and **`_wputenv`** affect only the environment that is local to the current process; you can’t use them to modify the command-level environment. That is, these functions operate only on data structures accessible to the run-time library and not on the environment segment created for a process by the operating system. When the current process terminates, the environment reverts to the level of the calling process (in most cases, the operating-system level). However, the modified environment can be passed to any new processes created by **`_spawn`**, **`_exec`**, or **`system`**, and these new processes get any new items added by **`_putenv`** and **`_wputenv`**.
5554

56-
Do not change an environment entry directly: instead, use **_putenv** or **_wputenv** to change it. In particular, direct freeing elements of the **_environ[]** global array might lead to invalid memory being addressed.
55+
Don't change an environment entry directly: instead, use **`_putenv`** or **`_wputenv`** to change it. In particular, direct freeing elements of the **`_environ[]`** global array might lead to invalid memory being addressed.
5756

58-
**getenv** and **_putenv** use the global variable **_environ** to access the environment table; **_wgetenv** and **_wputenv** use **_wenviron**. **_putenv** and **_wputenv** might change the value of **_environ** and **_wenviron**, thus invalidating the **_envp** argument to **main** and the **_wenvp** argument to **wmain**. Therefore, it is safer to use **_environ** or **_wenviron** to access the environment information. For more information about the relation of **_putenv** and **_wputenv** to global variables, see [_environ, _wenviron](../../c-runtime-library/environ-wenviron.md).
57+
**`_getenv`** and **`_putenv`** use the global variable **`_environ`** to access the environment table; **`_wgetenv`** and **`_wputenv`** use **`_wenviron`**. **`_putenv`** and **`_wputenv`** might change the value of **`_environ`** and **`_wenviron`**, thus invalidating the **`_envp`** argument to **`main`** and the **`_wenvp`** argument to **`wmain`**. Therefore, it's safer to use **`_environ`** or **`_wenviron`** to access the environment information. For more information about the relation of **`_putenv`** and **`_wputenv`** to global variables, see [`_environ`, `_wenviron`](../../c-runtime-library/environ-wenviron.md).
5958

6059
> [!NOTE]
61-
> The **_putenv** and **_getenv** families of functions are not thread-safe. **_getenv** could return a string pointer while **_putenv** is modifying the string, causing random failures. Make sure that calls to these functions are synchronized.
60+
> The **`_putenv`** and **`_getenv`** families of functions are not thread-safe. **`_getenv`** could return a string pointer while **`_putenv`** is modifying the string, causing random failures. Make sure that calls to these functions are synchronized.
6261
6362
## Requirements
6463

6564
|Routine|Required header|
6665
|-------------|---------------------|
67-
|**_putenv**|\<stdlib.h>|
68-
|**_wputenv**|\<stdlib.h> or \<wchar.h>|
66+
|**`_putenv`**|`<stdlib.h>`|
67+
|**`_wputenv`**|`<stdlib.h>` or `<wchar.h>`|
6968

7069
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
7170

7271
## Example
7372

74-
For a sample of how to use **_putenv**, see [getenv, _wgetenv](getenv-wgetenv.md).
73+
For a sample of how to use **`_putenv`**, see [`getenv`, `_wgetenv`](getenv-wgetenv.md).
7574

7675
## See also
7776

78-
[Process and Environment Control](../../c-runtime-library/process-and-environment-control.md)<br/>
79-
[getenv, _wgetenv](getenv-wgetenv.md)<br/>
80-
[_searchenv, _wsearchenv](searchenv-wsearchenv.md)<br/>
77+
[Process and Environment Control](../../c-runtime-library/process-and-environment-control.md)\
78+
[`getenv`, `_wgetenv`](getenv-wgetenv.md)\
79+
[`_searchenv`, `_wsearchenv`](searchenv-wsearchenv.md)

0 commit comments

Comments
 (0)