本文整理汇总了C++中show_status函数的典型用法代码示例。如果您正苦于以下问题:C++ show_status函数的具体用法?C++ show_status怎么用?C++ show_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了show_status函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: update_status
static void
update_status(WINDOW *win, STATUS * sp)
{
switch (sp->ch) {
case ' ': /* next test-iteration */
if (has_colors()) {
if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) {
sp->c_msg = color_params(sp->c = 0, &(sp->pair));
if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
sp->v_msg = video_params(sp->v = 0, &(sp->attr));
}
}
} else {
if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
sp->v_msg = video_params(sp->v = 0, &(sp->attr));
}
}
sp->count = 0;
show_status(win, sp);
break;
case KEY_LEFT:
case 'h':
if (sp->x_val > 0)
wmove(win, sp->y_val, --(sp->x_val));
break;
case KEY_DOWN:
case 'j':
if (sp->y_val < sp->y_max)
wmove(win, ++(sp->y_val), sp->x_val);
break;
case KEY_UP:
case 'k':
if (sp->y_val > 0)
wmove(win, --(sp->y_val), sp->x_val);
break;
case KEY_RIGHT:
case 'l':
if (sp->x_val < sp->x_max)
wmove(win, sp->y_val, ++(sp->x_val));
break;
case 't':
touchline(win, sp->y_val, 1);
break;
case '=':
sp->count = 0;
show_status(win, sp);
break;
case '?':
do_subwindow(win, sp, show_help);
break;
default:
if (isdigit(sp->ch)) {
sp->count = (sp->count * 10) + (sp->ch - '0');
show_status(win, sp);
} else {
beep();
}
break;
}
}
开发者ID:tizenorg,项目名称:external.ncurses,代码行数:60,代码来源:insdelln.c
示例2: update_status_time
/*
* Update the online time.
*/
static void update_status_time(void)
{
time_t now;
time(&now);
if (status_message_showing)
{
if (now > status_display_msg_until)
{
/* time over for status message, restore standard status line */
status_message_showing = 0;
show_status();
}
else
show_status_fmt("%$");
}
if (old_online == online || online <= (old_online + 59))
return;
if (P_LOGCONN[0] == 'Y' && old_online >= 0 && online < 0)
do_log(_("Gone offline (%ld:%02ld:%02ld)"),
old_online / 3600, (old_online / 60) % 60, old_online % 60);
old_online = online;
if (!status_message_showing)
show_status();
mc_wflush();
}
开发者ID:feir777,项目名称:minicom,代码行数:33,代码来源:main.c
示例3: main
int main (int argc, char **argv) {
int value;
if (argc != 2) {
usage();
exit(1);
}
else if (strcmp(argv[1],"on") == 0) {
value=read_control();
if (value > 0)
value--;
show_status(write_control(value));
}
else if (strcmp(argv[1],"off") == 0) {
show_status(write_control(read_control() + 1));
}
else if (strcmp(argv[1],"status") == 0) {
verify_daemon_running();
show_status(read_control());
}
else {
usage();
exit(1);
}
exit(0);
}
开发者ID:andrewshadura,项目名称:sleepd,代码行数:26,代码来源:sleepctl.c
示例4: update_core_config
static int update_core_config(unsigned int cpunumber, bool up)
{
int ret = -EINVAL;
unsigned int nr_cpus = num_online_cpus();
int max_cpus = tegra_cpq_max_cpus();
int min_cpus = tegra_cpq_min_cpus();
#if CPUQUIET_DEBUG_VERBOSE
pr_info(CPUQUIET_TAG "%s\n", __func__);
#endif
if (cpq_state == TEGRA_CPQ_DISABLED || cpunumber >= nr_cpu_ids)
return ret;
/* sync with tegra_cpuquiet_work_func
else if we are currently switching to LP and an up
comes we can end up with more then 1 core up and
governor stopped and !lp mode */
if (!mutex_trylock (&hotplug_lock)){
#if CPUQUIET_DEBUG_VERBOSE
pr_info(CPUQUIET_TAG "%s failed to get hotplug_lock\n", __func__);
#endif
return -EBUSY;
}
if (up) {
if(is_lp_cluster()) {
ret = -EBUSY;
} else {
if (nr_cpus < max_cpus){
show_status("UP", 0, cpunumber);
ret = cpu_up(cpunumber);
}
}
} else {
if (is_lp_cluster()) {
ret = -EBUSY;
} else {
if (nr_cpus > 1 && nr_cpus > min_cpus){
show_status("DOWN", 0, cpunumber);
ret = cpu_down(cpunumber);
}
}
}
mutex_unlock(&hotplug_lock);
return ret;
}
开发者ID:hyl,项目名称:enrc2b-kernel-BLADE,代码行数:49,代码来源:cpuquiet.c
示例5: shjump
static void shjump(int sig)
{
char *sh;
int pid;
int status;
int f;
(void)sig;
sh = getenv("SHELL");
if (sh == NULL) {
werror(_("SHELL variable not set"));
return;
}
if ((pid = fork()) == -1) {
werror(_("Out of memory: could not fork()"));
return;
}
if (pid != 0)
mc_wleave();
if (pid == 0) {
for (f = 1; f < _NSIG; f++)
signal(f, SIG_DFL);
for (f = 3; f < 20; f++)
close(f);
fputs(_("Shelled out. Type \"exit\" to return.\n"), stdout);
execl(sh, sh, NULL);
exit(1);
}
m_wait(&status);
mc_wreturn();
if (use_status)
show_status();
}
开发者ID:jekywong,项目名称:minicom,代码行数:33,代码来源:minicom.c
示例6: read_all_groups
void read_all_groups(void)
{
int rc,c;
char the_path[FMSIZE],directory[15];
/* char status[50]; */
if (ncn<0) { return; }
strcpy( the_path, article_path ); /* save article_path */
for (c=0;c<maximum_group+1;c++) {
if (group[c].first_msg<=group[c].last_msg) { /* any articles? */
use_status( 2 ); /* use window info line */
newsgroup_to_directory( group[c].name, directory );
mkdir( article_path, S_IWRITE|S_IREAD );
show_status( group[c].name );
evnt_timer( 1200, 0 ); /* wait 1.2 seconds */
if (ncn>=0) {
rc = news_group( group[c].name );
read_all_articles( c, article_path );
group[c].viewed = VIEWED;
}
hide_status();
}
}
unload_group( current_newsgroup );
strcpy( article_path, the_path ); /* restore article_path */
}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:26,代码来源:OFFLINE.C
示例7: read_all_articles
void read_all_articles(int g, char *the_path)
{
long c,first,last;
int x;
char status[50];
first = group[g].first_msg;
last = group[g].last_msg;
fprintf( log, "newsgroup: %s, first: %ld, last: %ld\n", group[g].name, first, last ); fflush(log);
use_status( 2 ); /* use overview window info line */
if (first<=last) {
for (c=first;c<last+1;c++) {
sprintf( current_article, "%s\\%ld.txt", the_path, c );
/* sprintf( status, "%s %ld", ErrMsg(EM_RetrieveArt), c ); */
/* sprintf( status, "%s %ld, %ld more", ErrMsg(EM_RetrieveArt), c, group[g].num_msgs ); */
sprintf( status, ErrMsg(EM_RetrieveArt), c, group[g].num_msgs );
show_status( status );
x = news_article( c, current_article );
if (x==1) { break; } /* file write error, eject */
if (x==4) { break; } /* leave if escape key used */
if (x==3) { break; } /* loss of carrier, etc. */
if (x==0) { /* update group display */
group[g].first_msg++;
group[g].num_msgs--;
}
if (memcmp(header, "4", 1)==0) { /* 412, 420, 423, 430 responses */
remove( current_article );
} else {
create_xover_header( c, current_article );
}
}
}
hide_status();
}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:34,代码来源:OFFLINE.C
示例8: min_cpus_change
static void min_cpus_change(void)
{
bool g_cluster = false;
cputime64_t on_time = 0;
if (cpq_state == TEGRA_CPQ_DISABLED)
return;
mutex_lock(tegra3_cpu_lock);
if ((tegra_cpq_min_cpus() >= 2) && is_lp_cluster()) {
if (switch_clk_to_gmode()){
pr_err(CPUQUIET_TAG "min_cpus_change - switch_clk_to_gmode failed\n");
mutex_unlock(tegra3_cpu_lock);
return;
}
on_time = ktime_to_ms(ktime_get()) - lp_on_time;
show_status("LP -> off - min_cpus_change", on_time, -1);
g_cluster = true;
}
tegra_cpu_set_speed_cap(NULL);
mutex_unlock(tegra3_cpu_lock);
schedule_work(&minmax_work);
if (g_cluster && !manual_hotplug)
cpuquiet_device_free();
}
开发者ID:hyl,项目名称:enrc2b-kernel-BLADE,代码行数:31,代码来源:cpuquiet.c
示例9: mlast_frame
mlast_frame()
{
register WORD **myframe;
register WORD *frame;
if (screen_ct >= MAX_SCREENS)
{
too_many_frames();
return;
}
if (mem_free < 32000 + 8000)
{
outta_memory();
return;
}
if ((frame = alloc(32000)) == NULL)
{
outta_memory();
return;
}
save_undo();
myframe = screens+screen_ix;
copy_pointers(myframe, myframe+1, screen_ct - screen_ix);
*myframe = frame;
copy_screen(cscreen, frame);
screen_ct++;
show_status();
}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:28,代码来源:FRAMES.C
示例10: tegra_cpuquiet_force_gmode
int tegra_cpuquiet_force_gmode(void)
{
cputime64_t on_time = 0;
if (no_lp)
return -EBUSY;
if (!is_g_cluster_present())
return -EBUSY;
if (cpq_state == TEGRA_CPQ_DISABLED)
return -EBUSY;
if (is_lp_cluster()) {
mutex_lock(tegra3_cpu_lock);
if (switch_clk_to_gmode()) {
pr_err(CPUQUIET_TAG "tegra_cpuquiet_force_gmode - switch_clk_to_gmode failed\n");
mutex_unlock(tegra3_cpu_lock);
return -EBUSY;
}
on_time = ktime_to_ms(ktime_get()) - lp_on_time;
show_status("LP -> off - force", on_time, -1);
mutex_unlock(tegra3_cpu_lock);
if (!manual_hotplug)
cpuquiet_device_free();
}
return 0;
}
开发者ID:hyl,项目名称:enrc2b-kernel-BLADE,代码行数:33,代码来源:cpuquiet.c
示例11: main
int main(int argc, char **argv)
{
if (argc > 1)
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
printf("\n Usage: %s [ThreadCount]\n", argv[0]);
printf("\n Default: %s 4\n", argv[0]);
exit(1);
}
if (argc > 1)
thread_count = atoi(argv[1]);
rlimit of = {1000000, 1000000};
if (-1 == setrlimit(RLIMIT_NOFILE, &of)) {
perror("setrlimit");
exit(1);
}
go server;
boost::thread_group tg;
for (int i = 0; i < thread_count; ++i)
tg.create_thread([] { g_Scheduler.RunUntilNoTask(); });
//tg.join_all();
for (;;)
{
sleep(1);
show_status();
}
return 0;
}
开发者ID:HyEvil,项目名称:libgo,代码行数:31,代码来源:high_concurrency_server.cpp
示例12: main
// Gets the cfg from the command line, reads it, updates the registers,
// reads the MIPS instructions from the elf file and inserts them into
// memory. Lastly, main initializes the stackpointer,
// interprets the instructions and shows the status of the registers
// after completing them.
int main(int argc, char *argv[]) {
int read;
if (argc == 3) {
read = read_config(argv[1]);
}
else {
printf(ERROR_INVALID_ARGS);
return -1;
}
if (read == 0) {
int retElfDump = elf_dump(argv[2], &PC, &mem[0], MEMSZ);
if(retElfDump != 0) {
printf(ERROR_ELF_DUMP);
return -2;
}
SP = MIPS_RESERVE + MEMSZ;
int retInterp = interp();
if (retInterp != SAW_SYSCALL && retInterp != 0) {
printf(ERROR_INTERP);
return -3;
}
show_status();
}
else {
printf(ERROR_READ_CONFIG);
return -4;
}
return 0;
}
开发者ID:nicolaslarsen,项目名称:AndersNicolas,代码行数:38,代码来源:sim.c
示例13: move_next
void move_next(WINDOW *win, struct status_node *current, int direction) {
if(!current)
return;
struct status_node *next = 0;
struct status_node *boundary = 0;
if(direction > 0) {
next = current->next;
boundary = timelines[current_tl_index]->current_bottom;
}
else {
next = current->prev;
boundary = timelines[current_tl_index]->current_top;
}
if(!next) { // reached the bottom
if(direction > 0)
notify_state_change(states[STATE_REACHED_BOTTOM]);
else
notify_state_change(states[STATE_REACHED_TOP]);
return;
}
if(current != boundary) {
wmove(win,current->y_min,0);
show_status(win,current);
}
else
move_next_page(win,current,direction);
highlight_status(win,next);
timelines[current_tl_index]->current = next;
}
开发者ID:bgee,项目名称:twilc,代码行数:32,代码来源:main.c
示例14: test_NtGdiDdGetScanLine
/*
* Test see if we can delete a DirectDrawObject from win32k
*
*/
void
test_NtGdiDdGetScanLine(HANDLE hDirectDrawLocal)
{
int fails=0;
BOOL retValue=FALSE;
DD_GETSCANLINEDATA puGetScanLineData;
printf("Start testing of NtGdiDdGetScanLine\n");
RtlZeroMemory(&puGetScanLineData,sizeof(DD_GETSCANLINEDATA));
retValue = OsThunkDdGetScanLine(NULL,NULL);
testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"1. NtGdiDdGetScanLine(NULL,NULL);\0");
retValue = OsThunkDdGetScanLine(hDirectDrawLocal,NULL);
testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"2. NtGdiDdGetScanLine(hDirectDrawLocal,NULL);\0");
puGetScanLineData.ddRVal = DDERR_GENERIC;
retValue = OsThunkDdGetScanLine(hDirectDrawLocal,&puGetScanLineData);
testing_eq(retValue,DDHAL_DRIVER_NOTHANDLED,fails,"3. NtGdiDdGetScanLine(hDirectDrawLocal,puGetScanLineData);\0");
testing_noteq(puGetScanLineData.ddRVal,DD_OK,fails,"4. NtGdiDdGetScanLine(hDirectDrawLocal,puGetScanLineData);\0");
testing_eq(puGetScanLineData.dwScanLine,0,fails,"4. NtGdiDdGetScanLine(hDirectDrawLocal,puGetScanLineData);\0");
/* FIXME DDERR_VERTICALBLANKINPROGRESS test */
show_status(fails, "NtGdiDdGetScanLine\0");
}
开发者ID:hoangduit,项目名称:reactos,代码行数:31,代码来源:NtGdiDdGetScanLine.c
示例15: received_status_stop
void
received_status_stop()
{
pthread_mutex_lock(&ui_status_cache_mutex);
ui_status_cache = STATUS_STOP;
pthread_mutex_unlock(&ui_status_cache_mutex);
show_status();
}
开发者ID:estibi,项目名称:audioplayer,代码行数:8,代码来源:ui.c
示例16: gtk_widget_set_sensitive
void
on_bt_con_connect_clicked (GtkButton *button,
gpointer user_data)
{
GtkWidget * widget;
gtk_widget_set_sensitive( GTK_WIDGET( mainwindow ), TRUE );
gtk_widget_set_sensitive( GTK_WIDGET( dialog_connect ), FALSE );
gtk_widget_hide( GTK_WIDGET( dialog_connect ) );
widget = lookup_widget( dialog_connect, "tx_con_server" );
predicthost=(char *)gtk_entry_get_text(GTK_ENTRY(widget));
widget = lookup_widget( dialog_connect, "tx_con_port" );
predictport=(char *)gtk_entry_get_text(GTK_ENTRY(widget));
/* Setup status bar */
sprintf(statusmsg,"Connecting to predict server %s ...", predicthost);
show_status(statusmsg);
if(connect_server()==0) {
/* if connected, disable connect button enable disconnect button */
widget=lookup_widget( mainwindow, "cb_connect" );
gtk_widget_set_sensitive( widget, FALSE );
widget=lookup_widget( mainwindow, "cb_disconnect" );
gtk_widget_set_sensitive( widget, TRUE );
widget=lookup_widget( mainwindow, "tb_footpsat" );
gtk_widget_set_sensitive( widget, TRUE );
widget=lookup_widget( mainwindow, "tb_footpqth" );
gtk_widget_set_sensitive( widget, TRUE );
widget=lookup_widget( mainwindow, "tb_track" );
gtk_widget_set_sensitive( widget, TRUE );
widget=lookup_widget( mainwindow, "tb_autofreq" );
gtk_widget_set_sensitive( widget, TRUE );
widget=lookup_widget( mainwindow, "bt_azelgraph" );
gtk_widget_set_sensitive( widget, TRUE );
connected=TRUE;
}
else {
show_status("Error connecting to predict server.");
connected=FALSE;
}
}
开发者ID:abrahamneben,项目名称:orbcomm_beam_mapping,代码行数:43,代码来源:callbacks.c
示例17: showtemp
/*
* Show status line temporarily
*/
static void showtemp(void)
{
if (st)
return;
st = mc_wopen(0, LINES - 1, COLS - 1, LINES - 1,
BNONE, st_attr, sfcolor, sbcolor, 1, 0, 1);
show_status();
tempst = 1;
}
开发者ID:feir777,项目名称:minicom,代码行数:13,代码来源:main.c
示例18: cpu_core_state_workfunc
static void cpu_core_state_workfunc(struct work_struct *work)
{
int i = 0;
int cpu = 0;
for (i = 0; i < 3; i++){
cpu = i + 1;
if (cpu_core_state[i] == 0 && cpu_online(cpu)){
show_status("DOWN", 0, cpu);
cpu_down(cpu);
} else if (cpu_core_state[i] == 1 && !cpu_online(cpu)){
if (is_lp_cluster())
tegra_cpuquiet_force_gmode();
show_status("UP", 0, cpu);
cpu_up(cpu);
}
}
}
开发者ID:hyl,项目名称:enrc2b-kernel-BLADE,代码行数:19,代码来源:cpuquiet.c
示例19: min_max_constraints_workfunc
static void min_max_constraints_workfunc(struct work_struct *work)
{
int count = -1;
bool up = false;
unsigned int cpu;
int nr_cpus = num_online_cpus();
int max_cpus = tegra_cpq_max_cpus();
int min_cpus = tegra_cpq_min_cpus();
if (cpq_state == TEGRA_CPQ_DISABLED)
return;
if (is_lp_cluster())
return;
if (nr_cpus < min_cpus) {
up = true;
count = min_cpus - nr_cpus;
} else if (nr_cpus > max_cpus && max_cpus >= min_cpus) {
count = nr_cpus - max_cpus;
}
for (;count > 0; count--) {
if (up) {
cpu = best_core_to_turn_up();
if (cpu < nr_cpu_ids){
show_status("UP", 0, cpu);
cpu_up(cpu);
}
else
break;
} else {
cpu = cpumask_next(0, cpu_online_mask);
if (cpu < nr_cpu_ids){
show_status("DOWN", 0, cpu);
cpu_down(cpu);
}
else
break;
}
}
}
开发者ID:hyl,项目名称:enrc2b-kernel-BLADE,代码行数:43,代码来源:cpuquiet.c
示例20: uart_init
/**
* baud_rate: only support [1,2,4,8] * 4800
* called by polling thread!
*/
gboolean uart_init()
{
log_info("UART init: message rate=%d ms, baud rate=%d...", SEND_RATE, BAUD_RATE);
show_status("Initializing GPS...");
/* open UART */
if (uart_open((U4)BAUD_RATE, TRUE) <= 0) {
log_error("Open UART failed");
return FALSE;
}
ubx_init(gps_dev_fd);
if (! ubx_cfg_rate((U2)SEND_RATE, TRUE))
return FALSE;
if (! ubx_cfg_prt(0x01, 0x01, 0x01, BAUD_RATE, TRUE))
return FALSE;
/* Disable NMEA to avoid flushing UBX binary output */
if (! ubx_cfg_msg_nmea_ubx(0x0, TRUE, TRUE))
return FALSE;
if (! ubx_cfg_msg_nmea_std(0x0, TRUE, TRUE))
return FALSE;
if (! ubx_cfg_sbas(TRUE, TRUE))
return FALSE;
show_status("Set initial AID data...");
/* no matter success or failure */
set_initial_aid_data();
uart_flush_output();
show_status("GPS was initialized.");
//ubx_mon_ver_poll(g_ubx_receiver_versions, sizeof(g_ubx_receiver_versions));
//show_status(g_ubx_receiver_versions);
return TRUE;
}
开发者ID:dss91,项目名称:omgps,代码行数:47,代码来源:uart.c
注:本文中的show_status函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论