Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
steam-runtime-tools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
steam-runtime-tools
Commits
08d1339f
Commit
08d1339f
authored
10 years ago
by
Colin Walters
Browse files
Options
Downloads
Patches
Plain Diff
console: Make glnx_console_lines and columns public
They'll be used by rpm-ostree at least.
parent
cf2a89f5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
glnx-console.c
+15
-7
15 additions, 7 deletions
glnx-console.c
glnx-console.h
+4
-0
4 additions, 0 deletions
glnx-console.h
with
19 additions
and
7 deletions
glnx-console.c
+
15
−
7
View file @
08d1339f
...
...
@@ -65,8 +65,13 @@ fd_columns (int fd)
return
ws
.
ws_col
;
}
static
guint
columns
(
void
)
/**
* glnx_console_columns:
*
* Returns: The number of columns for terminal output
*/
guint
glnx_console_columns
(
void
)
{
if
(
G_UNLIKELY
(
cached_columns
==
0
))
{
...
...
@@ -86,7 +91,6 @@ columns (void)
return
cached_columns
;
}
#if 0
static
int
fd_lines
(
int
fd
)
{
...
...
@@ -101,8 +105,13 @@ fd_lines (int fd)
return
ws
.
ws_row
;
}
static guint
lines (void)
/**
* glnx_console_lines:
*
* Returns: The number of lines for terminal output
*/
guint
glnx_console_lines
(
void
)
{
if
(
G_UNLIKELY
(
cached_lines
==
0
))
{
...
...
@@ -118,7 +127,6 @@ lines (void)
return
cached_lines
;
}
#endif
static
void
on_sigwinch
(
int
signum
)
...
...
@@ -188,7 +196,7 @@ glnx_console_progress_text_percent (const char *text,
const
guint
n_equals
=
sizeof
(
equals
)
-
1
;
static
const
char
spaces
[]
=
" "
;
const
guint
n_spaces
=
sizeof
(
spaces
)
-
1
;
const
guint
ncolumns
=
columns
();
const
guint
ncolumns
=
glnx_console_
columns
();
const
guint
bar_min
=
10
;
const
guint
input_textlen
=
text
?
strlen
(
text
)
:
0
;
guint
textlen
;
...
...
This diff is collapsed.
Click to expand it.
glnx-console.h
+
4
−
0
View file @
08d1339f
...
...
@@ -37,6 +37,10 @@ void glnx_console_progress_text_percent (const char *text,
void
glnx_console_unlock
(
GLnxConsoleRef
*
ref
);
guint
glnx_console_lines
(
void
);
guint
glnx_console_columns
(
void
);
static
inline
void
glnx_console_ref_cleanup
(
GLnxConsoleRef
*
p
)
{
...
...
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