Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
3f90a544
Commit
3f90a544
authored
17 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Added optional terminator character to comReadBuf().
parent
3bbcef92
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/comio/comio.h
+2
-1
2 additions, 1 deletion
src/comio/comio.h
src/comio/comio_win32.c
+4
-1
4 additions, 1 deletion
src/comio/comio_win32.c
with
6 additions
and
2 deletions
src/comio/comio.h
+
2
−
1
View file @
3f90a544
...
...
@@ -79,7 +79,8 @@ BOOL comWriteByte(COM_HANDLE, BYTE);
int
comWriteBuf
(
COM_HANDLE
,
const
BYTE
*
,
size_t
buflen
);
int
comWriteString
(
COM_HANDLE
,
const
char
*
);
BOOL
comReadByte
(
COM_HANDLE
,
BYTE
*
);
size_t
comReadBuf
(
COM_HANDLE
,
char
*
buf
,
size_t
buflen
,
int
timeout
/* in milliseconds */
);
size_t
comReadBuf
(
COM_HANDLE
,
char
*
buf
,
size_t
buflen
,
char
terminator
,
int
timeout
/* in milliseconds */
);
BOOL
comPurgeInput
(
COM_HANDLE
);
BOOL
comPurgeOutput
(
COM_HANDLE
);
...
...
This diff is collapsed.
Click to expand it.
src/comio/comio_win32.c
+
4
−
1
View file @
3f90a544
...
...
@@ -150,7 +150,7 @@ BOOL comReadByte(COM_HANDLE handle, BYTE* ch)
return
ReadFile
(
handle
,
ch
,
sizeof
(
BYTE
),
&
rd
,
NULL
)
&&
rd
==
sizeof
(
BYTE
);
}
size_t
comReadBuf
(
COM_HANDLE
handle
,
char
*
buf
,
size_t
buflen
,
int
timeout
)
size_t
comReadBuf
(
COM_HANDLE
handle
,
char
*
buf
,
size_t
buflen
,
char
terminator
,
int
timeout
)
{
BYTE
ch
;
size_t
len
=
0
;
...
...
@@ -163,6 +163,8 @@ size_t comReadBuf(COM_HANDLE handle, char* buf, size_t buflen, int timeout)
YIELD
();
continue
;
}
if
(
len
&&
terminator
&&
ch
==
terminator
)
break
;
buf
[
len
++
]
=
ch
;
}
...
...
@@ -178,3 +180,4 @@ BOOL comPurgeOutput(COM_HANDLE handle)
{
return
PurgeComm
(
handle
,
PURGE_TXCLEAR
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment