本文整理汇总了C++中set_status函数的典型用法代码示例。如果您正苦于以下问题:C++ set_status函数的具体用法?C++ set_status怎么用?C++ set_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_status函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: update_status
/*
update the state of the sensor
*/
void AP_RangeFinder_LightWareSerial::update(void)
{
if (get_reading(state.distance_cm)) {
// update range_valid state based on distance measured
last_reading_ms = hal.scheduler->millis();
update_status();
} else if (hal.scheduler->millis() - last_reading_ms > 200) {
set_status(RangeFinder::RangeFinder_NoData);
}
}
开发者ID:AurelienRoy,项目名称:ardupilot,代码行数:13,代码来源:AP_RangeFinder_LightWareSerial.cpp
示例2: configure_package
void configure_package(deb_file_t *deb_file)
{
const char *package_name = name_hashtable[package_hashtable[deb_file->package]->name];
const char *package_version = name_hashtable[package_hashtable[deb_file->package]->version];
const int status_num = search_status_hashtable(package_name);
int return_value;
printf("Setting up %s (%s)\n", package_name, package_version);
/* Run the preinst prior to extracting */
return_value = run_package_script(package_name, "postinst");
if (return_value == -1) {
/* TODO: handle failure gracefully */
error_msg_and_die("postrm failure.. set status to what?");
}
/* Change status to reflect success */
set_status(status_num, "install", 1);
set_status(status_num, "installed", 3);
}
开发者ID:BackupTheBerlios,项目名称:wl530g-svn,代码行数:19,代码来源:dpkg.c
示例3: move_to_top
static void move_to_top (MaintainrProjectbox *box, MaintainrShell *item)
{
MaintainrProjectconf *conf;
conf = maintainr_projectbox_get_conf (box);
maintainr_config_force_top (item->priv->conf, conf);
set_status (item);
maintainr_config_save (item->priv->conf);
gtk_box_reorder_child (GTK_BOX (item->priv->projects_box), GTK_WIDGET (box), 0);
}
开发者ID:madbob,项目名称:Maintainr,代码行数:10,代码来源:maintainr-shell.c
示例4: update_status
/*
update the state of the sensor
*/
void AP_RangeFinder_LeddarOne::update(void)
{
if (get_reading(state.distance_cm)) {
// update range_valid state based on distance measured
last_reading_ms = AP_HAL::millis();
update_status();
} else if (AP_HAL::millis() - last_reading_ms > 200) {
set_status(RangeFinder::RangeFinder_NoData);
}
}
开发者ID:BrendanSmith,项目名称:ardupilot,代码行数:13,代码来源:AP_RangeFinder_LeddarOne.cpp
示例5: set_last_status
int set_last_status(alphabet_game_t *alphabet_game, status_t status)
{
alphabet_game_t *ag=alphabet_game;
status_t stts=status;
if(NULL==ag){
return RET_FAILED;
}
return set_status(&ag->last_status,stts);
}
开发者ID:handsomezhou,项目名称:programming_notes_for_c,代码行数:10,代码来源:alphabet_game.c
示例6: set_ready_to_punch_if_standing_long
/**
* if we are not moving for a while, set we are ready to punch
*/
void set_ready_to_punch_if_standing_long(int *standing_cycles_count)
{
// standing for long enough
if (*standing_cycles_count > CALIBRATION_CALM_COUNTER_LIMIT)
{
// get ready to punch!
*standing_cycles_count = 0;
set_status(STATE_PUNCH_READY);
}
}
开发者ID:jirihelmich,项目名称:PunchPress,代码行数:13,代码来源:punch.c
示例7: InstallCallback_OnStartBinding
static HRESULT WINAPI InstallCallback_OnStartBinding(IBindStatusCallback *iface,
DWORD dwReserved, IBinding *pib)
{
set_status(IDS_DOWNLOADING);
IBinding_AddRef(pib);
dwl_binding = pib;
return S_OK;
}
开发者ID:CepGamer,项目名称:wine,代码行数:10,代码来源:addons.c
示例8: received_message
/*
* Messages incoming from the phone
*/
void received_message(DictionaryIterator *received, void *context) {
Event temp_event;
Tuple *tuple = dict_find(received, RECONNECT_KEY);
if (tuple) {
vibes_short_pulse();
calendar_request();
}
// Gather the bits of a calendar together
tuple = dict_find(received, CALENDAR_RESPONSE_KEY);
if (tuple) {
set_status(STATUS_REPLY);
uint8_t i, j;
if (g_count > g_received_rows) {
i = g_received_rows;
j = 0;
} else {
g_count = tuple->value->data[0];
i = 0;
j = 1;
}
while (i < g_count && j < tuple->length) {
memcpy(&temp_event, &tuple->value->data[j], sizeof(Event));
if (temp_event.index < MAX_EVENTS)
memcpy(&g_events[temp_event.index], &temp_event, sizeof(Event));
i++;
j += sizeof(Event);
}
g_received_rows = i;
if (g_count == g_received_rows) {
g_max_entries = g_count;
process_rot_events();
if (nothing_showing) {
nothing_showing = false;
show_next_event();
}
battery_request();
}
}
tuple = dict_find(received, BATTERY_RESPONSE_KEY);
if (tuple) {
memcpy(&g_battery_status, &tuple->value->data[0], sizeof(BatteryStatus));
set_battery(g_battery_status.state, g_battery_status.level);
}
}
开发者ID:falkobuttler,项目名称:diaryface20,代码行数:58,代码来源:calendar.c
示例9: rcv_arp
void
rcv_arp(void)
{
if ((ARP_P->hw_type != ARETH) || (ARP_P->protocol != ARIP))
goto leave;
if (ARP_P->his_proto_addr != tcpipcfg.c_myip) {
//rprintf("[ARP:NOT FOR ME]");
goto leave;
}
//rprintf("[ARP]");
//print_packet(ARP_P, 0);
switch (ARP_P->opcode) {
case ARREQ : // Incomming Request
statistics.arpInRequests++;
copy_hw_addr(ETH_P->destination, ARP_P->my_hw_addr);
ARP_P->his_proto_addr = ARP_P->my_proto_addr;
copy_hw_addr(ARP_P->his_hw_addr, ARP_P->my_hw_addr);
copy_hw_addr(ARP_P->my_hw_addr, ARP_STUB.my_hw_addr);
ARP_P->my_proto_addr = tcpipcfg.c_myip;
ARP_P->opcode = ARREP;
snd_packet(ARP_P, ARP_PLEN);
break;
case ARREP : { // Response for my ARP Request
struct TCB *tp;
int i;
//rprintf("[R_A-REP]");
for (tp = tcb, i = 0; i < num_socket; i++, tp++) {
if (!(IP_STUB(tp)->transport))
continue;
// Update All TCB's with matching IP address
if ((tp->status & TCB_ARP_ING) && (arp_target(tp) == ARP_P->my_proto_addr)) {
//rprintf("[ARP-OK %d]", i);
copy_hw_addr(ETH_STUB(tp)->destination, ARP_P->my_hw_addr);
if (tp->status & TCB_ARP_ING) {
tp->arp_retrytimer = 0; // Stop timer
tp->timeout_count = 0;
clr_status(tp, TCB_ARP_ING);
set_status(tp, TCB_ARP_ED);
statistics.arpInReplys++;
}
check_tcp_send(tp);
check_udp_send(tp);
}
}
break;
}
default :
break;
}
leave:
;
}
开发者ID:barmi,项目名称:tcpip,代码行数:55,代码来源:PACKET.C
示例10: jfetch_initialize
int
jfetch_initialize(
jfetch_status *status,
const char *input,
bool is_file
)
{
int result = JFETCH_ERR_NONE;
TRACE_ENTRY();
if(!status) {
result = JFETCH_ERR_INVALID;
goto exit;
}
memset(status, 0, sizeof(jfetch_status));
if(!input) {
result = JFETCH_ERR_INVALID;
goto exit;
}
if(g_manager) {
result = jfetch_destroy(status);
if(JFETCH_FAILURE(result)) {
goto exit;
}
}
try {
g_library = json::acquire();
if(!g_library) {
result = JFETCH_ERR_UNINIT;
goto exit;
}
g_library->initialize(input, is_file);
g_manager = g_library->acquire_manager();
if(!g_manager) {
result = JFETCH_ERR_UNINIT;
goto exit;
}
} catch(std::runtime_error &exc) {
set_status(status, exc.what());
result = JFETCH_ERR_FAIL;
goto exit;
}
exit:
TRACE_EXIT("Return Value: 0x%x", result);
return result;
}
开发者ID:majestic53,项目名称:jfetch,代码行数:55,代码来源:jfetch.cpp
示例11: set_status_from_gdb
void set_status_from_gdb(const string& text)
{
if (private_gdb_input)
return;
if (!show_next_line_in_status && !text.contains(gdb->prompt(), -1))
return;
// Fetch line before prompt in GDB window
String s = XmTextGetString(gdb_w);
string message = s + messagePosition;
XtFree(s);
if (message.empty() && text.contains('\n'))
message = text;
if (show_next_line_in_status &&
(message.empty() || message[message.length() - 1] != '\n'))
return;
// Skip prompt and uncomplete lines
int idx = message.index('\n', -1);
if (idx >= 0)
message = message.before(idx);
strip_trailing_newlines(message);
if (message.empty() && text.contains('\n'))
message = text;
if (show_next_line_in_status)
{
messagePosition = XmTextGetLastPosition(gdb_w) + text.length();
show_next_line_in_status = false;
message.gsub('\n', ' ');
}
else
{
// Show first line only
while (!message.empty() && message[0] == '\n')
message = message.after('\n');
if (message.contains('\n'))
message = message.before('\n');
}
strip_trailing_newlines(message);
message.gsub('\t', ' ');
if (message.empty())
return;
// Don't log this stuff - it's already logged
bool old_log_status = log_status;
log_status = false;
set_status(message);
log_status = old_log_status;
}
开发者ID:fooeybartoni,项目名称:CSI702,代码行数:55,代码来源:status.C
示例12: mir_utf8encodeT
int __cdecl CYahooProto::SetAwayMsg( int status, const PROTOCHAR* msg )
{
char *c = msg && msg[0] ? mir_utf8encodeT(msg) : NULL;
debugLogA("[YahooSetAwayMessage] Status: %S, Msg: %s", pcli->pfnGetStatusModeDescription(status, 0), (char*)c);
if (!m_bLoggedIn) {
if (m_iStatus == ID_STATUS_OFFLINE) {
debugLogA("[YahooSetAwayMessage] WARNING: WE ARE OFFLINE!");
mir_free(c);
return 1;
} else {
if (m_startMsg) free(m_startMsg);
m_startMsg = c ? strdup(c) : NULL;
mir_free(c);
return 0;
}
}
/* need to tell ALL plugins that we are changing status */
BroadcastStatus(status);
if (m_startMsg) free(m_startMsg);
/* now decide what we tell the server */
if (c != 0) {
m_startMsg = strdup(c);
if (status == ID_STATUS_ONLINE) {
set_status(YAHOO_CUSTOM_STATUS, c, 0);
} else if (status != ID_STATUS_INVISIBLE) {
set_status(YAHOO_CUSTOM_STATUS, c, 1);
}
} else {
set_status(status, NULL, 0);
m_startMsg = NULL;
}
mir_free(c);
return 0;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:42,代码来源:proto.cpp
示例13: lock
int PrefixInfo::set_read_write_status(uint64_t prefix, int status)
{
int err = 0;
tbsys::CWLock lock(&rw_lock_);
if (status == 0)
{
err = set_status(prefix, 0);
if (0 != err)
{
TBSYS_LOG(WARN, "failed to set status, prefix=%lu, err=%d", prefix, err);
}
}
else
{
lock.lock();
int ori_status = 0;
err = get_status(prefix, ori_status);
if (0 != err)
{
TBSYS_LOG(WARN, "failed to get ori status, prefix=%lu, err=%d", prefix, err);
}
else
{
if (ori_status != 0)
{
err = READ_WRITE_CONFLICT;
}
else
{
err = set_status(prefix, status);
if (0 != err)
{
TBSYS_LOG(WARN, "failed to set status, prefix=%lu, status=%d, err=%d", prefix, status, err);
}
}
}
lock.unlock();
}
return err;
}
开发者ID:Abioy,项目名称:oceanbase,代码行数:42,代码来源:prefix_info.cpp
示例14: Vehicle
/*- -------------------------------------------------------------- -*/
ResearchRobot::ResearchRobot(int id, int width, int height) : Vehicle(width, height) {
set_type('S');
set_num_id(id);
// setting the robot status
def_status = 50;
set_status(def_status);
// initially the robot hasn't deployed any flags
flagsDeployed = 0;
}
开发者ID:bpapaspyros,项目名称:RobSim,代码行数:12,代码来源:ResearchRobot.cpp
示例15: set_status
void CompassCalibrator::start(bool retry, float delay, uint16_t offset_max) {
if(running()) {
return;
}
_offset_max = offset_max;
_attempt = 1;
_retry = retry;
_delay_start_sec = delay;
_start_time_ms = AP_HAL::millis();
set_status(COMPASS_CAL_WAITING_TO_START);
}
开发者ID:BrendanSmith,项目名称:ardupilot,代码行数:11,代码来源:CompassCalibrator.cpp
示例16: SelectSourceCB
// Select a source; show the full path name in the status line
static void SelectSourceCB(Widget w, XtPointer, XtPointer call_data)
{
XmListCallbackStruct *cbs = (XmListCallbackStruct *)call_data;
int pos = cbs->item_position;
ListSetAndSelectPos(w, pos);
pos--;
if (pos < 0)
pos = all_sources.size() - 1;
set_status(all_sources[pos]);
}
开发者ID:KrisChaplin,项目名称:octeon_toolchain-4.1,代码行数:12,代码来源:file.C
示例17: GOOGLE_CHECK_NE
void BattleResultRequest::MergeFrom(const BattleResultRequest& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_did()) {
set_did(from.did());
}
if (from.has_status()) {
set_status(from.status());
}
}
}
开发者ID:wanggan768q,项目名称:GameWork,代码行数:11,代码来源:BattleResult.pb.cpp
示例18: InstallCallback_OnStopBinding
static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface,
HRESULT hresult, LPCWSTR szError)
{
if(FAILED(hresult)) {
ERR("Binding failed %08x\n", hresult);
return S_OK;
}
set_status(IDS_INSTALLING);
return S_OK;
}
开发者ID:YokoZar,项目名称:wine,代码行数:11,代码来源:addons.c
示例19: InitInstance
BOOL InitInstance (int CmdShow)
{
WNDCLASS wc;
wc.style = 0;
wc.lpfnWndProc = (WNDPROC) MainWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = g_hinst;
wc.hIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON));
wc.hCursor = 0;
wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = 0;
wc.lpszClassName = _T("Osmophone");
RegisterClass(&wc);
#ifdef _WIN32_WCE
int style = WS_VISIBLE;
#else
int style = WS_POPUP;
#endif
g_hwnd = CreateWindow(_T("Osmophone"), _T("Osmophone"),
style,
0, caption_h, disp_w, disp_h,
NULL, NULL, g_hinst, NULL);
if (!g_hwnd) return FALSE;
ShowWindow(g_hwnd, CmdShow);
refresh_recent_files();
::SetTimer(g_hwnd, STATE_TIMER_ID, STATE_TIMER_DUR, NULL);
do_layout(1);
set_status("Loading Terminal");
PostMessage(g_hwnd, WM_LOADTERM, 0, 0);
set_status("Ready");
return TRUE;
}
开发者ID:jnorthrup,项目名称:gpac,代码行数:41,代码来源:main.cpp
示例20: adc_inst
void adc_inst(ARMProc *proc, UWord instruction) {
#ifdef DEBUG
printf("Ejecutaste un adc\n");
#endif
//Instrucciones de DP
ARMAddr *modes = addr_modes_dp();
ARMAddr *mode;
Word S;
Word Rn;
Word Rd;
Word carry;
Word last_rd;
ARMAddrDPReturn result;
if(!cond(proc, instruction))
return;
S = get_bits(instruction,20,1);
Rn = get_bits(instruction,16,4);
Rd = get_bits(instruction,12,4);
//---Parte indispensable para obtener el result
mode = fetch_addr(modes, instruction);
if(mode != NULL)
mode->execute(proc, instruction, &result);
//---
last_rd = *proc->r[Rd];
*proc->r[Rd] = AddCarryFrom(*proc->r[Rn],result.shifter_operand + get_bits(*proc->cpsr,29,1),&carry);
if(S && Rd == 15) {
if(proc->cpsr != NULL) {
*proc->cpsr = *proc->spsr;
}
} else if(S == 1) {
set_status(proc, status_n, get_bits(*proc->r[Rd], 31, 1));
set_status(proc, status_z, *proc->r[Rd] == 0);
set_status(proc, status_c, carry);
set_status(proc, status_v, OverflowFrom(last_rd,*proc->r[Rd]));
}
}
开发者ID:iamedu,项目名称:armdev,代码行数:41,代码来源:adc.c
注:本文中的set_status函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论