Commit Graph

442 Commits

Author SHA1 Message Date
Tetralux
37a2356485 [sys/windows] Add DCB structure, SetCommState, GetCommState
These are the procedures for configuring a serial port.

You simply open the port with CreateFile (os.open), followed by a call to GetCommState,
setting the DCB as desired, followed by a SetCommState call.

The DCB structure uses C bitfields, so a configuration struct is provided along with a helper procedure to make it easier
to initialize in Odin code.
This makes it possible to initialize a DCB structure with one call to the helper:
```
dcb: DCB
windows.init_dcb_with_config(&dcb, {
	BaudRate = 115200,
	ByteSize = 8,
	Parity = .None,
	StopBits = .One,
})
```
(The parity and the stopbits are actually optional in this example, as their zero-values are None and One, respectively.)
2022-09-22 15:14:14 +00:00
gingerBill
f50fc33749 Clean up of the core library to make the stream vtables not be pointers directly. 2022-09-15 10:00:50 +01:00
hikari
164ba944ac sys/windows: add definitions 2022-09-14 11:42:19 +03:00
Ryan Chan
183a02c584 Add windows.timeGetTime()
Here is the windows documentation for it: https://docs.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timegettime
2022-09-10 16:54:34 +04:00
gingerBill
826a3b3012 Begin work in helgrind calls 2022-09-06 13:50:23 +01:00
Jeroen van Rijn
b6ed117726 [sys/info] Indentation nitpick. 2022-09-05 19:18:18 +02:00
Jeroen van Rijn
4b23decb08 Silence vet some more. 2022-09-05 19:04:18 +02:00
Jeroen van Rijn
a70ea6579d Silence -vet. 2022-09-05 18:55:33 +02:00
Jeroen van Rijn
1ca641f718 [sys/info] Add doc.odin with explanation. 2022-09-05 18:39:57 +02:00
Jeroen van Rijn
6222e7be78 Merge branch 'master' into sysinfo 2022-09-05 18:28:18 +02:00
gingerBill
12687a63f4 Merge pull request #1951 from IanLilleyT/wstring_allocation
smaller allocation for non-null-terminated wstring
2022-09-05 15:48:43 +01:00
Jeroen van Rijn
426f02906b [sys/info] Add OpenBSD detection support. 2022-09-04 20:37:38 +02:00
Jeroen van Rijn
2f6347b924 [sys/info] Add detection for Tiger, Leopard, Snow Leopard, Lion, Mountain Lion, Mavericks, Yosemite 2022-09-03 20:49:19 +02:00
Jeroen van Rijn
3f3f4fafff [sys/info] Move FreeBSD sysctl to sys/unix. 2022-09-03 16:53:03 +02:00
Jeroen van Rijn
4367ae4acf Merge branch 'sysinfo' of github.com:Kelimion/Odin into sysinfo 2022-09-03 16:30:44 +02:00
Jeroen van Rijn
4eafb0ce7f [sys/info] Move macOS sysctl to sys/unix. 2022-09-03 16:30:31 +02:00
Jeroen van Rijn
7a4891b6b9 [sys/info] Grab FreeBSD kernel info using sysctl. 2022-09-03 15:26:28 +02:00
Jeroen van Rijn
0171c276f0 [sys/info] Support FreeBSD 13 2022-09-03 02:33:36 +02:00
Jeroen van Rijn
0743dd195d [sys/info] Add detection for El Capitan, Sierra, High Sierra, Mojave 2022-09-02 22:46:24 +02:00
Jeroen van Rijn
d1a204a784 [sys/info] Add detection for Catalina, Big Sur, Monterey. 2022-09-02 21:15:34 +02:00
Jeroen van Rijn
1637de3ebb [sys/info] Parse xnu kernel version 2022-09-02 04:11:02 +02:00
Jeroen van Rijn
45691a4622 [sys/info] Add sysctl MIBs for MacOS. 2022-09-02 02:14:48 +02:00
Jeroen van Rijn
9e47c72b98 [sys/info] Better sysctl wrapper 2022-09-02 01:45:04 +02:00
Jeroen van Rijn
f5d13dc568 [sys/info] Add MacOS memory size 2022-09-02 01:26:58 +02:00
Jeroen van Rijn
01e8668357 Merge branch 'master' into sysinfo 2022-09-01 18:30:26 +02:00
gingerBill
4858e16a11 Merge pull request #1976 from matias-eduardo/patch-2
Add Extended Window Styles (WS_EX)
2022-09-01 16:26:51 +01:00
Jeroen van Rijn
0f3cebd2b7 [sys/info] Retrieve GPU info on Windows. 2022-09-01 16:05:49 +02:00
Lucas Perlind
f3f51bd643 Kernel32: Add more window bindings and improve consistency 2022-09-01 22:57:27 +10:00
Jeroen van Rijn
7479ac48e8 [sys/info] Parse kernel/distro info. 2022-09-01 02:06:05 +02:00
Jeroen van Rijn
d5f94d73ad [sys/info] Initial version. 2022-09-01 00:43:47 +02:00
Lucas Perlind
d9adb0fd6b Add much of Win32's Raw Input API 2022-08-28 16:30:55 +10:00
matias
96e033b22c Add Extended Window Styles (WS_EX)
Featuring frequently used styles such as: `WS_EX_APPWINDOW`, `WS_EX_NOREDIRECTIONBITMAP`, `WS_EX_ACCEPTFILES`, `WS_EX_TOOLWINDOW`, `WS_EX_TOPMOST`, `WS_EX_NOACTIVATE`, `WS_EX_LAYERED`, and more.
2022-08-25 21:12:45 -04:00
gingerBill
cb9e16f4df Correct syscalls for linux_i386 2022-08-24 12:37:56 +01:00
gingerBill
2908923db9 Fix #1972 2022-08-24 12:18:42 +01:00
gingerBill
7fe36de069 Correct Try SRWLock related procedures to return BOOLEAN rather than BOOL 2022-08-22 22:24:51 +01:00
gingerBill
afec321db2 Add core:sys/valgrind package for valgrind, memcheck, and callgrind 2022-08-17 16:09:03 +01:00
Ian Lilley
87094ef96c smaller allocation for no
n-null-terminated wstring
2022-08-15 09:17:10 -04:00
matias
3dc62a67e0 Typo: "Get" -> "Set" 2022-08-14 07:16:54 -04:00
Fabian Sperber
e50648279d Add some wgl extensions
- fix upper case for wglSwapIntervalEXT to be the same as the exported name
2022-08-12 21:56:55 +02:00
Fabian Sperber
929af320da Add more windows bindings 2022-08-12 21:56:54 +02:00
Hyp-X
e6236e5c3e Update user32.odin
Added UnregisterClassW procedure to windows\user32.odin
2022-08-01 15:59:00 +02:00
gingerBill
220dfd7440 Minor clean up of wasi_api.odin 2022-07-25 17:00:32 +01:00
gingerBill
e1748a5dd1 Add MAKE_WORD 2022-07-21 17:08:11 +01:00
gingerBill
22a0c3fce1 Disallow proc() do stmt and only allow proc() { stmt } 2022-07-18 15:09:04 +01:00
gingerBill
c0d2359a91 Merge pull request #1826 from englerj/windows-bindings
Added additional Windows bindings.
2022-06-28 13:14:35 +01:00
Jimmy "Keeba" Lefevre
9e288b7ce8 Change LPCSTR to LPCWSTR in windows _W procedures 2022-06-27 21:48:02 +02:00
hikari
c6903fbcd5 sys/windows: add constants and macro 2022-06-17 15:14:21 +03:00
hikari
665db0f778 sys/windows: add RegSetKeyValueW 2022-06-16 22:54:59 +03:00
Josh Engler
50cbb8a1fc Fix tab spacing. 2022-06-12 15:55:38 -04:00
Josh Engler
6f80174f84 Merge branch 'master' into windows-bindings 2022-06-11 09:48:28 -04:00