Skip to content

Commit 5e4e4a0

Browse files
author
Colin Robertson
committed
Fix Markdig issues
1 parent a3bb04f commit 5e4e4a0

File tree

198 files changed

+5589
-5166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+5589
-5166
lines changed

docs/c-runtime-library/32-bit-windows-time-date-formats.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,26 @@ ms.author: "corob"
1313
ms.workload: ["cplusplus"]
1414
---
1515
# 32-Bit Windows Time/Date Formats
16-
The file time and the date are stored individually, using unsigned integers as bit fields. File time and date are packed as follows:
17-
18-
### Time
19-
20-
|Bit position:|0 1 2 3 4|5 6 7 8 9 A|B C D E F|
21-
|-------------------|-----------------------|---------------------------|-----------------------|
22-
|Length:|5|6|5|
23-
|Contents:|hours|minutes|2-second increments|
24-
|Value Range:|0-23|0-59|0-29 in 2-second intervals|
25-
26-
### Date
27-
28-
|Bit position:|0 1 2 3 4 5 6|7 8 9 A|B C D E F|
29-
|-------------------|-------------------------------|-------------------|-----------------------|
30-
|Length:|7|4|5|
31-
|Contents:|year|month|day|
32-
|Value Range:|0-119|1-12|1-31|
33-
||(relative to 1980)|||
34-
35-
## See Also
36-
[Global Constants](../c-runtime-library/global-constants.md)
16+
17+
The file time and the date are stored individually, using unsigned integers as bit fields. File time and date are packed as follows:
18+
19+
### Time
20+
21+
|Bit position:|0 1 2 3 4|5 6 7 8 9 A|B C D E F|
22+
|-------------------|-----------------------|---------------------------|-----------------------|
23+
|Length:|5|6|5|
24+
|Contents:|hours|minutes|2-second increments|
25+
|Value Range:|0-23|0-59|0-29 in 2-second intervals|
26+
27+
### Date
28+
29+
|Bit position:|0 1 2 3 4 5 6|7 8 9 A|B C D E F|
30+
|-------------------|-------------------------------|-------------------|-----------------------|
31+
|Length:|7|4|5|
32+
|Contents:|year|month|day|
33+
|Value Range:|0-119|1-12|1-31|
34+
||(relative to 1980)|||
35+
36+
## See Also
37+
38+
[Global Constants](../c-runtime-library/global-constants.md)

docs/c-runtime-library/a-sample-generic-text-program.md

Lines changed: 166 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -12,167 +12,169 @@ ms.author: "corob"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# A Sample Generic-Text Program
15-
**Microsoft Specific**
16-
17-
The following program, GENTEXT.C, provides a more detailed illustration of the use of generic-text mappings defined in TCHAR.H:
18-
19-
```
20-
// GENTEXT.C
21-
// use of generic-text mappings defined in TCHAR.H
22-
23-
#include <stdio.h>
24-
#include <stdlib.h>
25-
#include <string.h>
26-
#include <direct.h>
27-
#include <errno.h>
28-
#include <tchar.h>
29-
30-
int __cdecl _tmain(int argc, _TCHAR **argv, _TCHAR **envp)
31-
{
32-
_TCHAR buff[_MAX_PATH];
33-
_TCHAR *str = _T("Astring");
34-
char *amsg = "Reversed";
35-
wchar_t *wmsg = L"Is";
36-
37-
#ifdef _UNICODE
38-
printf("Unicode version\n");
39-
#else /* _UNICODE */
40-
#ifdef _MBCS
41-
printf("MBCS version\n");
42-
#else
43-
printf("SBCS version\n");
44-
#endif
45-
#endif /* _UNICODE */
46-
47-
if (_tgetcwd(buff, _MAX_PATH) == NULL)
48-
printf("Can't Get Current Directory - errno=%d\n", errno);
49-
else
50-
_tprintf(_T("Current Directory is '%s'\n"), buff);
51-
_tprintf(_T("'%s' %hs %ls:\n"), str, amsg, wmsg);
52-
_tprintf(_T("'%s'\n"), _tcsrev(_tcsdup(str)));
53-
return 0;
54-
}
55-
56-
```
57-
58-
If `_MBCS` has been defined, GENTEXT.C maps to the following MBCS program:
59-
60-
```
61-
// crt_mbcsgtxt.c
62-
63-
/*
64-
* Use of generic-text mappings defined in TCHAR.H
65-
* Generic-Text-Mapping example program
66-
* MBCS version of GENTEXT.C
67-
*/
68-
69-
#include <stdio.h>
70-
#include <stdlib.h>
71-
#include <mbstring.h>
72-
#include <direct.h>
73-
74-
int __cdecl main(int argc, char **argv, char **envp)
75-
{
76-
char buff[_MAX_PATH];
77-
char *str = "Astring";
78-
char *amsg = "Reversed";
79-
wchar_t *wmsg = L"Is";
80-
81-
printf("MBCS version\n");
82-
83-
if (_getcwd(buff, _MAX_PATH) == NULL) {
84-
printf("Can't Get Current Directory - errno=%d\n", errno);
85-
}
86-
else {
87-
printf("Current Directory is '%s'\n", buff);
88-
}
89-
90-
printf("'%s' %hs %ls:\n", str, amsg, wmsg);
91-
printf("'%s'\n", _mbsrev(_mbsdup((unsigned char*) str)));
92-
return 0;
93-
}
94-
```
95-
96-
If `_UNICODE` has been defined, GENTEXT.C maps to the following Unicode version of the program. For more information about using `wmain` in Unicode programs as a replacement for `main`, see [Using wmain](../c-language/using-wmain.md) in *C Language Reference*.
97-
98-
```
99-
// crt_unicgtxt.c
100-
101-
/*
102-
* Use of generic-text mappings defined in TCHAR.H
103-
* Generic-Text-Mapping example program
104-
* Unicode version of GENTEXT.C
105-
*/
106-
107-
#include <stdio.h>
108-
#include <stdlib.h>
109-
#include <string.h>
110-
#include <direct.h>
111-
112-
int __cdecl wmain(int argc, wchar_t **argv, wchar_t **envp)
113-
{
114-
wchar_t buff[_MAX_PATH];
115-
wchar_t *str = L"Astring";
116-
char *amsg = "Reversed";
117-
wchar_t *wmsg = L"Is";
118-
119-
printf("Unicode version\n");
120-
121-
if (_wgetcwd(buff, _MAX_PATH) == NULL) {
122-
printf("Can't Get Current Directory - errno=%d\n", errno);
123-
}
124-
else {
125-
wprintf(L"Current Directory is '%s'\n", buff);
126-
}
127-
128-
wprintf(L"'%s' %hs %ls:\n", str, amsg, wmsg);
129-
wprintf(L"'%s'\n", wcsrev(wcsdup(str)));
130-
return 0;
131-
}
132-
```
133-
134-
If neither `_MBCS` nor `_UNICODE` has been defined, GENTEXT.C maps to single-byte ASCII code, as follows:
135-
136-
```
137-
// crt_sbcsgtxt.c
138-
/*
139-
* Use of generic-text mappings defined in TCHAR.H
140-
* Generic-Text-Mapping example program
141-
* Single-byte (SBCS) Ascii version of GENTEXT.C
142-
*/
143-
144-
#include <stdio.h>
145-
#include <stdlib.h>
146-
#include <string.h>
147-
#include <direct.h>
148-
149-
int __cdecl main(int argc, char **argv, char **envp)
150-
{
151-
char buff[_MAX_PATH];
152-
char *str = "Astring";
153-
char *amsg = "Reversed";
154-
wchar_t *wmsg = L"Is";
155-
156-
printf("SBCS version\n");
157-
158-
if (_getcwd(buff, _MAX_PATH) == NULL) {
159-
printf("Can't Get Current Directory - errno=%d\n", errno);
160-
}
161-
else {
162-
printf("Current Directory is '%s'\n", buff);
163-
}
164-
165-
printf("'%s' %hs %ls:\n", str, amsg, wmsg);
166-
printf("'%s'\n", strrev(strdup(str)));
167-
return 0;
168-
}
169-
```
170-
171-
**END Microsoft Specific**
172-
173-
## See Also
174-
[Generic-Text Mappings](../c-runtime-library/generic-text-mappings.md)
175-
[Data Type Mappings](../c-runtime-library/data-type-mappings.md)
176-
[Constant and Global Variable Mappings](../c-runtime-library/constant-and-global-variable-mappings.md)
177-
[Routine Mappings](../c-runtime-library/routine-mappings.md)
178-
[Using Generic-Text Mappings](../c-runtime-library/using-generic-text-mappings.md)
15+
16+
**Microsoft Specific**
17+
18+
The following program, GENTEXT.C, provides a more detailed illustration of the use of generic-text mappings defined in TCHAR.H:
19+
20+
```
21+
// GENTEXT.C
22+
// use of generic-text mappings defined in TCHAR.H
23+
24+
#include <stdio.h>
25+
#include <stdlib.h>
26+
#include <string.h>
27+
#include <direct.h>
28+
#include <errno.h>
29+
#include <tchar.h>
30+
31+
int __cdecl _tmain(int argc, _TCHAR **argv, _TCHAR **envp)
32+
{
33+
_TCHAR buff[_MAX_PATH];
34+
_TCHAR *str = _T("Astring");
35+
char *amsg = "Reversed";
36+
wchar_t *wmsg = L"Is";
37+
38+
#ifdef _UNICODE
39+
printf("Unicode version\n");
40+
#else /* _UNICODE */
41+
#ifdef _MBCS
42+
printf("MBCS version\n");
43+
#else
44+
printf("SBCS version\n");
45+
#endif
46+
#endif /* _UNICODE */
47+
48+
if (_tgetcwd(buff, _MAX_PATH) == NULL)
49+
printf("Can't Get Current Directory - errno=%d\n", errno);
50+
else
51+
_tprintf(_T("Current Directory is '%s'\n"), buff);
52+
_tprintf(_T("'%s' %hs %ls:\n"), str, amsg, wmsg);
53+
_tprintf(_T("'%s'\n"), _tcsrev(_tcsdup(str)));
54+
return 0;
55+
}
56+
57+
```
58+
59+
If `_MBCS` has been defined, GENTEXT.C maps to the following MBCS program:
60+
61+
```
62+
// crt_mbcsgtxt.c
63+
64+
/*
65+
* Use of generic-text mappings defined in TCHAR.H
66+
* Generic-Text-Mapping example program
67+
* MBCS version of GENTEXT.C
68+
*/
69+
70+
#include <stdio.h>
71+
#include <stdlib.h>
72+
#include <mbstring.h>
73+
#include <direct.h>
74+
75+
int __cdecl main(int argc, char **argv, char **envp)
76+
{
77+
char buff[_MAX_PATH];
78+
char *str = "Astring";
79+
char *amsg = "Reversed";
80+
wchar_t *wmsg = L"Is";
81+
82+
printf("MBCS version\n");
83+
84+
if (_getcwd(buff, _MAX_PATH) == NULL) {
85+
printf("Can't Get Current Directory - errno=%d\n", errno);
86+
}
87+
else {
88+
printf("Current Directory is '%s'\n", buff);
89+
}
90+
91+
printf("'%s' %hs %ls:\n", str, amsg, wmsg);
92+
printf("'%s'\n", _mbsrev(_mbsdup((unsigned char*) str)));
93+
return 0;
94+
}
95+
```
96+
97+
If `_UNICODE` has been defined, GENTEXT.C maps to the following Unicode version of the program. For more information about using `wmain` in Unicode programs as a replacement for `main`, see [Using wmain](../c-language/using-wmain.md) in *C Language Reference*.
98+
99+
```
100+
// crt_unicgtxt.c
101+
102+
/*
103+
* Use of generic-text mappings defined in TCHAR.H
104+
* Generic-Text-Mapping example program
105+
* Unicode version of GENTEXT.C
106+
*/
107+
108+
#include <stdio.h>
109+
#include <stdlib.h>
110+
#include <string.h>
111+
#include <direct.h>
112+
113+
int __cdecl wmain(int argc, wchar_t **argv, wchar_t **envp)
114+
{
115+
wchar_t buff[_MAX_PATH];
116+
wchar_t *str = L"Astring";
117+
char *amsg = "Reversed";
118+
wchar_t *wmsg = L"Is";
119+
120+
printf("Unicode version\n");
121+
122+
if (_wgetcwd(buff, _MAX_PATH) == NULL) {
123+
printf("Can't Get Current Directory - errno=%d\n", errno);
124+
}
125+
else {
126+
wprintf(L"Current Directory is '%s'\n", buff);
127+
}
128+
129+
wprintf(L"'%s' %hs %ls:\n", str, amsg, wmsg);
130+
wprintf(L"'%s'\n", wcsrev(wcsdup(str)));
131+
return 0;
132+
}
133+
```
134+
135+
If neither `_MBCS` nor `_UNICODE` has been defined, GENTEXT.C maps to single-byte ASCII code, as follows:
136+
137+
```
138+
// crt_sbcsgtxt.c
139+
/*
140+
* Use of generic-text mappings defined in TCHAR.H
141+
* Generic-Text-Mapping example program
142+
* Single-byte (SBCS) Ascii version of GENTEXT.C
143+
*/
144+
145+
#include <stdio.h>
146+
#include <stdlib.h>
147+
#include <string.h>
148+
#include <direct.h>
149+
150+
int __cdecl main(int argc, char **argv, char **envp)
151+
{
152+
char buff[_MAX_PATH];
153+
char *str = "Astring";
154+
char *amsg = "Reversed";
155+
wchar_t *wmsg = L"Is";
156+
157+
printf("SBCS version\n");
158+
159+
if (_getcwd(buff, _MAX_PATH) == NULL) {
160+
printf("Can't Get Current Directory - errno=%d\n", errno);
161+
}
162+
else {
163+
printf("Current Directory is '%s'\n", buff);
164+
}
165+
166+
printf("'%s' %hs %ls:\n", str, amsg, wmsg);
167+
printf("'%s'\n", strrev(strdup(str)));
168+
return 0;
169+
}
170+
```
171+
172+
**END Microsoft Specific**
173+
174+
## See Also
175+
176+
[Generic-Text Mappings](../c-runtime-library/generic-text-mappings.md)<br/>
177+
[Data Type Mappings](../c-runtime-library/data-type-mappings.md)<br/>
178+
[Constant and Global Variable Mappings](../c-runtime-library/constant-and-global-variable-mappings.md)<br/>
179+
[Routine Mappings](../c-runtime-library/routine-mappings.md)<br/>
180+
[Using Generic-Text Mappings](../c-runtime-library/using-generic-text-mappings.md)

0 commit comments

Comments
 (0)