void btif_debug_conn_dump(int fd) { const uint8_t current_event_local = current_event; // Cache to avoid threading issues uint8_t dump_event = current_event_local; char ts_buffer[TEMP_BUFFER_SIZE] = {0}; char name_buffer[TEMP_BUFFER_SIZE] = {0}; dprintf(fd, "\nConnection Events:\n"); if (connection_events[dump_event].ts == 0) dprintf(fd, " None\n"); while (connection_events[dump_event].ts) { conn_event_t *evt = &connection_events[dump_event]; dprintf(fd, " %s %s %s", format_ts(evt->ts, ts_buffer, sizeof(ts_buffer)), format_state(evt->state), bdaddr_to_string(&evt->bda, name_buffer, sizeof(name_buffer)) ); if (evt->state == BTIF_DEBUG_DISCONNECTED) dprintf(fd, " reason=%d", evt->disconnect_reason); dprintf(fd,"\n"); // Go to previous event; wrap if needed if (dump_event > 0) --dump_event; else dump_event = NUM_CONNECTION_EVENTS - 1; // Check if we dumped all events if (dump_event == current_event_local) break; } }
char * format_next_process(caddr_t handle, char *(*get_userid) ()) { struct prpsinfo *pp; struct handle *hp; long cputime; /* find and remember the next proc structure */ hp = (struct handle *) handle; pp = *(hp->next_proc++); hp->remaining--; /* get the process cpu usage since startup */ cputime = pp->pr_time.tv_sec; /* format this entry */ sprintf(fmt, Proc_format, pp->pr_pid, pp->pr_pgrp, (*get_userid) (pp->pr_uid), format_prio(pp), format_k(pagetok(pp->pr_size)), format_k(pagetok(pp->pr_rssize)), format_state(pp), format_time(cputime), clip_percent(weighted_cpu(pp)), clip_percent(percent_cpu(pp)), printable(pp->pr_fname)); /* return the result */ return (fmt); }
DDetailScore::DDetailScore(CWnd* pParent /*=NULL*/) : CDialog(DDetailScore::IDD, pParent) { //{{AFX_DATA_INIT(POptionComm) //}}AFX_DATA_INIT for ( int i = 0; i < MAX_PLAYERS - 1; i++ ) format_state( i, &m_sScore[i] ); }
void DDetailScore::OnResetscore() { if ( AfxMessageBox( _T("지금까지 쌓아왔던 전적을 삭제하겠습니까?"), MB_YESNO | MB_ICONQUESTION ) == IDYES ) { for ( int i = 0; i < MAX_PLAYERS - 1; i++ ) { for ( int j = 0; j < 3; j++ ) Mo()->anPlayerState[i][j] = 0; format_state( i, &m_sScore[i] ); SetDlgItemText( IDC_SCORE1 + i, m_sScore[i] ); } } }