~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to tools/perf/util/ui/helpline.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#define _GNU_SOURCE
2
2
#include <stdio.h>
3
3
#include <stdlib.h>
4
 
#include <newt.h>
 
4
#include <string.h>
5
5
 
6
6
#include "../debug.h"
7
7
#include "helpline.h"
8
8
#include "ui.h"
 
9
#include "libslang.h"
9
10
 
10
11
void ui_helpline__pop(void)
11
12
{
12
 
        newtPopHelpLine();
13
13
}
14
14
 
 
15
char ui_helpline__current[512];
 
16
 
15
17
void ui_helpline__push(const char *msg)
16
18
{
17
 
        newtPushHelpLine(msg);
 
19
        const size_t sz = sizeof(ui_helpline__current);
 
20
 
 
21
        SLsmg_gotorc(SLtt_Screen_Rows - 1, 0);
 
22
        SLsmg_set_color(0);
 
23
        SLsmg_write_nstring((char *)msg, SLtt_Screen_Cols);
 
24
        SLsmg_refresh();
 
25
        strncpy(ui_helpline__current, msg, sz)[sz - 1] = '\0';
18
26
}
19
27
 
20
28
void ui_helpline__vpush(const char *fmt, va_list ap)
63
71
 
64
72
        if (ui_helpline__last_msg[backlog - 1] == '\n') {
65
73
                ui_helpline__puts(ui_helpline__last_msg);
66
 
                newtRefresh();
 
74
                SLsmg_refresh();
67
75
                backlog = 0;
68
76
        }
69
77
        pthread_mutex_unlock(&ui__lock);