本文整理汇总了C++中print_address函数的典型用法代码示例。如果您正苦于以下问题:C++ print_address函数的具体用法?C++ print_address怎么用?C++ print_address使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_address函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: toggleSwitches
void toggleSwitches(void){
if (commands[0] == high(OW_DS2405_FAMILY_CODE)
&& commands[1] == low(OW_DS2405_FAMILY_CODE)
&& (commands[2] == COMMAND_OFF || commands[2] == COMMAND_ON)){
unsigned char stat = MT8870_GetStat();
for (unsigned char i=0; i<switchCurr; i++){
if (stat == COMMAND_OFF
&& DS24x05_GetState(owDevicesIDs[i]) == true){
DS24x05_Toggle(owDevicesIDs[i]);
printf("\r");
print_address(owDevicesIDs[i]);
printf(" - Switch OFF");
}else if (stat == COMMAND_ON
&& DS24x05_GetState(owDevicesIDs[i]) == false){
DS24x05_Toggle(owDevicesIDs[i]);
printf("\r");
print_address(owDevicesIDs[i]);
printf(" - Switch ON");
}
}
commands_Reset();
}
}
开发者ID:creepid,项目名称:Zummer-GSM-1-wire-firmware,代码行数:29,代码来源:main.c
示例2: print_addresses
/*---------------------------------------------------------------------------*/
void print_addresses(void)
{
uip_ds6_addr_t *lladdr;
printf("link-local IPv6 address: ");
lladdr = uip_ds6_get_link_local(-1);
if(lladdr != NULL){
print_address(lladdr);
printf("\r\n");
}
else
printf("None\r\n");
printf("global IPv6 address: ");
lladdr = uip_ds6_get_global(-1);
if(lladdr != NULL){
print_address(lladdr);
printf("\r\n");
}
else
printf("None\r\n");
}
开发者ID:chanhemow,项目名称:contiki-fork,代码行数:27,代码来源:contiki-init-net.c
示例3: main
int main(
int argc,
char *argv[])
{
BACNET_ADDRESS src = {
0
}; /* address where message came from */
uint16_t pdu_len = 0;
unsigned timeout = 100; /* milliseconds */
BACNET_ADDRESS my_address, broadcast_address;
(void) argc;
(void) argv;
Device_Set_Object_Instance_Number(4194300);
address_init();
Init_Service_Handlers();
dlenv_init();
datalink_get_broadcast_address(&broadcast_address);
print_address("Broadcast", &broadcast_address);
datalink_get_my_address(&my_address);
print_address("Address", &my_address);
printf("BACnet stack running...\n");
/* loop forever */
for (;;) {
/* input */
/* returns 0 bytes on timeout */
pdu_len = datalink_receive(&src, &Rx_Buf[0], MAX_MPDU, timeout);
/* process */
if (pdu_len) {
npdu_handler(&src, &Rx_Buf[0], pdu_len);
}
if (I_Am_Request) {
I_Am_Request = false;
Send_I_Am(&Handler_Transmit_Buffer[0]);
} else if (Who_Is_Request) {
Who_Is_Request = false;
Send_WhoIs(-1, -1);
} else {
Read_Properties();
}
/* output */
/* blink LEDs, Turn on or off outputs, etc */
/* wait for ESC from keyboard before quitting */
if (kbhit() && (getch() == 0x1B))
break;
}
print_address_cache();
return 0;
}
开发者ID:HITliuyu,项目名称:NES15_HEVC,代码行数:55,代码来源:main.c
示例4: at_return
static void
at_return(app_pc instr_addr, app_pc target_addr)
{
file_t f = (file_t)(ptr_uint_t) dr_get_tls_field(dr_get_current_drcontext());
#ifdef SHOW_SYMBOLS
print_address(f, instr_addr, "RETURN @ ");
print_address(f, target_addr, "\t to ");
#else
dr_fprintf(f, "RETURN @ "PFX" to "PFX"\n", instr_addr, target_addr);
#endif
}
开发者ID:chubbymaggie,项目名称:patharmor,代码行数:11,代码来源:instrcalls.c
示例5: print_ranges_property
print_ranges_property(device *me,
const device_property *property)
{
int range_nr;
range_property_spec range;
for (range_nr = 0;
device_find_range_array_property(me, property->name, range_nr, &range);
range_nr++) {
print_address(me, &range.child_address);
print_address(device_parent(me), &range.parent_address);
print_size(me, &range.size);
}
}
开发者ID:3125788,项目名称:android_toolchain_gdb,代码行数:13,代码来源:tree.c
示例6: break_should_continue
/***********************************************************************
* break_should_continue
*
* Determine if we should continue execution after a SIGTRAP signal when
* executing in the given mode.
*/
BOOL break_should_continue(ADDRESS64* addr, DWORD code)
{
enum dbg_exec_mode mode = dbg_curr_thread->exec_mode;
if (dbg_curr_thread->stopped_xpoint > 0)
{
if (!should_stop(dbg_curr_thread->stopped_xpoint)) return TRUE;
switch (dbg_curr_process->bp[dbg_curr_thread->stopped_xpoint].xpoint_type)
{
case be_xpoint_break:
case be_xpoint_watch_exec:
dbg_printf("Stopped on breakpoint %d at ", dbg_curr_thread->stopped_xpoint);
print_address(&dbg_curr_process->bp[dbg_curr_thread->stopped_xpoint].addr, TRUE);
dbg_printf("\n");
break;
case be_xpoint_watch_read:
case be_xpoint_watch_write:
dbg_printf("Stopped on watchpoint %d at ", dbg_curr_thread->stopped_xpoint);
print_address(addr, TRUE);
dbg_printf(" new value %s\n",
wine_dbgstr_longlong(dbg_curr_process->bp[dbg_curr_thread->stopped_xpoint].w.oldval));
}
return FALSE;
}
/*
* If our mode indicates that we are stepping line numbers,
* get the current function, and figure out if we are exactly
* on a line number or not.
*/
if (mode == dbg_exec_step_over_line || mode == dbg_exec_step_into_line)
{
if (symbol_get_function_line_status(addr) == dbg_on_a_line_number)
dbg_curr_thread->exec_count--;
}
else if (mode == dbg_exec_step_over_insn || mode == dbg_exec_step_into_insn)
dbg_curr_thread->exec_count--;
if (dbg_curr_thread->exec_count > 0 || mode == dbg_exec_finish)
{
/*
* We still need to execute more instructions.
*/
return TRUE;
}
/* no breakpoint, continue if in continuous mode */
return mode == dbg_exec_cont || mode == dbg_exec_finish;
}
开发者ID:yy221,项目名称:winedbg,代码行数:57,代码来源:break.c
示例7: at_call
static void
at_call(app_pc instr_addr, app_pc target_addr)
{
file_t f = (file_t)(ptr_uint_t) dr_get_tls_field(dr_get_current_drcontext());
dr_mcontext_t mc = {sizeof(mc),DR_MC_CONTROL/*only need xsp*/};
dr_get_mcontext(dr_get_current_drcontext(), &mc);
#ifdef SHOW_SYMBOLS
print_address(f, instr_addr, "CALL @ ");
print_address(f, target_addr, "\t to ");
dr_fprintf(f, "\tTOS is "PFX"\n", mc.xsp);
#else
dr_fprintf(f, "CALL @ "PFX" to "PFX", TOS is "PFX"\n",
instr_addr, target_addr, mc.xsp);
#endif
}
开发者ID:chubbymaggie,项目名称:patharmor,代码行数:15,代码来源:instrcalls.c
示例8: disasm_addr
retc_t
disasm_addr(struct ps_prochandle * ph, ulong_t addr, int num_inst)
{
ulong_t offset;
ulong_t end;
int vers = V8_MODE;
if (ph->pp_dmodel == PR_MODEL_LP64)
vers = V9_MODE | V9_SGI_MODE;
for (offset = addr,
end = addr + num_inst * 4;
offset < end; offset += 4) {
char * instr_str;
unsigned int instr;
if (ps_pread(ph, offset, (char *)&instr,
sizeof (unsigned)) != PS_OK)
perror("da: ps_pread");
cur_ph = ph;
instr_str = disassemble(instr, offset, print_address,
0, 0, vers);
printf("%-30s: %s\n", print_address(offset), instr_str);
}
return (RET_OK);
}
开发者ID:andreiw,项目名称:polaris,代码行数:28,代码来源:dis.c
示例9: dis_asm_print_address
/* Like print_address with slightly different parameters. */
static void
dis_asm_print_address (bfd_vma addr, struct disassemble_info *info)
{
struct gdbarch *gdbarch = info->application_data;
print_address (gdbarch, addr, info->stream);
}
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:8,代码来源:disasm.c
示例10: main
int main(int argc, const char * argv[]) {
struct address data[SIZE];
int i = 0, operation;
while (1) {
get_operation(&operation);
if (operation == 2) {
break;
}
else if (operation == 0){
if (i < SIZE){
data[i++] = input_address();
}
else
puts("\n\nDatensatz voll. Keine Aufnahme zusaetzlicher Daten moeglich.\n\n");
}
else if (operation == 1){
if(i == 0){
puts("\n\nEs sind noch keine Datensaetze vorhanden. Geben Sie bitte erst welche ein.\n\n");
}
else{
for (int j = 0; j < i ; j++) {
print_address(&data[j]);
}
}
}
}
return EXIT_SUCCESS;
}
开发者ID:reinka,项目名称:coding,代码行数:33,代码来源:menu.c
示例11: tui_disassemble
/* Function to set the disassembly window's content.
Disassemble count lines starting at pc.
Return address of the count'th instruction after pc. */
static CORE_ADDR
tui_disassemble (struct gdbarch *gdbarch, struct tui_asm_line *asm_lines,
CORE_ADDR pc, int count)
{
string_file gdb_dis_out;
/* Now construct each line. */
for (; count > 0; count--, asm_lines++)
{
if (asm_lines->addr_string)
xfree (asm_lines->addr_string);
if (asm_lines->insn)
xfree (asm_lines->insn);
print_address (gdbarch, pc, &gdb_dis_out);
asm_lines->addr = pc;
asm_lines->addr_string = xstrdup (gdb_dis_out.c_str ());
gdb_dis_out.clear ();
pc = pc + gdb_print_insn (gdbarch, pc, &gdb_dis_out, NULL);
asm_lines->insn = xstrdup (gdb_dis_out.c_str ());
/* Reset the buffer to empty. */
gdb_dis_out.clear ();
}
return pc;
}
开发者ID:bminor,项目名称:binutils-gdb,代码行数:32,代码来源:tui-disasm.c
示例12: print_node_conf
/*----------------------------------------------------------------------------*/
void
print_node_conf(void){
PRINTF("[CFG]: NODE: ");
print_address(&(conf.my_address));
PRINTF("\n");
PRINTF("[CFG]: - Network ID: %d\n[CFG]: - Beacon Period: %d\n[CFG]: - "
"Report Period: %d\n[CFG]: - Rules TTL: %d\n[CFG]: - Min RSSI: "
"%d\n[CFG]: - Packet TTL: %d\n[CFG]: - Next Hop -> Sink: ",
conf.my_net, conf.beacon_period, conf.report_period,
conf.rule_ttl, conf.rssi_min, conf.packet_ttl);
print_address(&(conf.nxh_vs_sink));
PRINTF(" (hops: %d, rssi: %d)\n", conf.hops_from_sink, conf.rssi_from_sink);
PRINTF("[CFG]: - Sink: ");
print_address(&(conf.sink_address));
PRINTF("\n");
}
开发者ID:suxiongye,项目名称:sdn-wise-contiki,代码行数:17,代码来源:node-conf.c
示例13: tui_disassemble
/* Function to set the disassembly window's content.
Disassemble count lines starting at pc.
Return address of the count'th instruction after pc. */
static CORE_ADDR
tui_disassemble (struct tui_asm_line* asm_lines, CORE_ADDR pc, int count)
{
struct ui_file *gdb_dis_out;
/* now init the ui_file structure */
gdb_dis_out = tui_sfileopen (256);
/* Now construct each line */
for (; count > 0; count--, asm_lines++)
{
if (asm_lines->addr_string)
xfree (asm_lines->addr_string);
if (asm_lines->insn)
xfree (asm_lines->insn);
print_address (pc, gdb_dis_out);
asm_lines->addr = pc;
asm_lines->addr_string = xstrdup (tui_file_get_strbuf (gdb_dis_out));
ui_file_rewind (gdb_dis_out);
pc = pc + gdb_print_insn (pc, gdb_dis_out);
asm_lines->insn = xstrdup (tui_file_get_strbuf (gdb_dis_out));
/* reset the buffer to empty */
ui_file_rewind (gdb_dis_out);
}
ui_file_delete (gdb_dis_out);
return pc;
}
开发者ID:3125788,项目名称:android_toolchain_gdb,代码行数:35,代码来源:tui-disasm.c
示例14: format_addr
static int format_addr(msp430_amode_t amode, uint16_t addr)
{
char name[64];
int numeric = 0;
const char *prefix = "";
switch (amode) {
case MSP430_AMODE_REGISTER:
case MSP430_AMODE_INDIRECT:
case MSP430_AMODE_INDIRECT_INC:
return 0;
case MSP430_AMODE_IMMEDIATE:
prefix = "#";
case MSP430_AMODE_INDEXED:
numeric = 1;
break;
case MSP430_AMODE_ABSOLUTE:
prefix = "&";
break;
case MSP430_AMODE_SYMBOLIC:
break;
}
print_address(addr, name, sizeof(name));
return printc("%s\x1b[1m%s\x1b[0m", prefix, name);
}
开发者ID:Murali8051,项目名称:Aurava,代码行数:29,代码来源:output_util.c
示例15: ble_central_bondmngr_init
uint32_t ble_central_bondmngr_init(ble_central_bondmngr_t * p_bm, ble_central_bondmngr_init_t * p_bm_init)
{
uint32_t err_code;
p_bm->p_sec_params = p_bm_init->p_sec_params;
bond_info.keyset.keys_periph.p_enc_key = &bond_info.enc_key;
if (p_bm_init->delete_bonds)
{
err_code = ble_flash_page_erase(BLE_CENTRAL_BONDMNGR_PAGE_NUM);
if (err_code != NRF_SUCCESS)
return err_code;
}
else
{
uint8_t size_to_read = sizeof(bond_info)/sizeof(uint32_t);
err_code = ble_flash_page_read(BLE_CENTRAL_BONDMNGR_PAGE_NUM, (uint32_t *) &bond_info, &size_to_read);
if (err_code != NRF_ERROR_NOT_FOUND && err_code != NRF_SUCCESS)
return err_code;
printf("Restoring data from %d, %d...\r\n", BLE_CENTRAL_BONDMNGR_PAGE_NUM, BLE_CENTRAL_BONDMNGR_PAGE_NUM*NRF_FICR->CODEPAGESIZE);
}
print_address(&bond_info.addr);
return NRF_SUCCESS;
}
开发者ID:huiyue000,项目名称:51822,代码行数:28,代码来源:ble_central_bondmngr.c
示例16: format_addr
static int format_addr(msp430_amode_t amode, address_t addr)
{
char name[MAX_SYMBOL_LENGTH];
const char *prefix = "";
switch (amode) {
case MSP430_AMODE_REGISTER:
case MSP430_AMODE_INDIRECT:
case MSP430_AMODE_INDIRECT_INC:
return 0;
case MSP430_AMODE_IMMEDIATE:
prefix = "#";
case MSP430_AMODE_INDEXED:
break;
case MSP430_AMODE_ABSOLUTE:
prefix = "&";
break;
case MSP430_AMODE_SYMBOLIC:
break;
}
print_address(addr, name, sizeof(name), PRINT_ADDRESS_EXACT);
return printc("%s\x1b[1m%s\x1b[0m", prefix, name);
}
开发者ID:Batov,项目名称:libusb_chrome_api,代码行数:27,代码来源:output_util.c
示例17: hexdump_line
/* uses default "hd" style, i.e. 16 bytes followed by ASCII */
static void hexdump_line(FILE *out, uint64_t address, unsigned char *buf) {
int i;
static char tbl[16] = "0123456789ABCDEF";
fprintf(out," ");
print_address(out, address);
fprintf(out," ");
/* hex */
for (i = 0; i < 16; i++) {
fprintf(out, "%c%c",
tbl[(unsigned char)buf[i]>> 4],
tbl[(unsigned char)buf[i] & 0x0f]);
fprintf(out," ");
if (i == 7)
fprintf(out," ");
}
fprintf(out," ");
/* ascii */
for (i = 0; i < 16; i++) {
if (isprint(buf[i])) {
fprintf(out, "%c", buf[i]);
} else {
fprintf(out, ".");
}
}
fprintf(out, "\n");
}
开发者ID:Distrotech,项目名称:cryptsetup,代码行数:31,代码来源:chk_luks_keyslots.c
示例18: print_ranges_property
static void
print_ranges_property (struct hw *me,
const struct hw_property *property,
struct printer *p)
{
int range_nr;
range_property_spec range;
for (range_nr = 0;
hw_find_range_array_property (me, property->name, range_nr, &range);
range_nr++)
{
print_address (me, &range.child_address, p);
print_address (hw_parent (me), &range.parent_address, p);
print_size (me, &range.size, p);
}
}
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:16,代码来源:hw-tree.c
示例19: TORRENT_UNUSED
bool dos_blocker::incoming(address const& addr, time_point const now, dht_logger* logger)
{
TORRENT_UNUSED(logger);
node_ban_entry* match = nullptr;
node_ban_entry* min = m_ban_nodes;
for (node_ban_entry* i = m_ban_nodes; i < m_ban_nodes + num_ban_nodes; ++i)
{
if (i->src == addr)
{
match = i;
break;
}
if (i->count < min->count) min = i;
else if (i->count == min->count
&& i->limit < min->limit) min = i;
}
if (match)
{
++match->count;
if (match->count >= m_message_rate_limit * 10)
{
if (now < match->limit)
{
if (match->count == m_message_rate_limit * 10)
{
#ifndef TORRENT_DISABLE_LOGGING
if (logger != nullptr && logger->should_log(dht_logger::tracker))
{
logger->log(dht_logger::tracker, "BANNING PEER [ ip: %s time: %d ms count: %d ]"
, print_address(addr).c_str()
, int(total_milliseconds((now - match->limit) + seconds(10)))
, match->count);
}
#else
TORRENT_UNUSED(logger);
#endif // TORRENT_DISABLE_LOGGING
// we've received too many messages in less than 10 seconds
// from this node. Ignore it until it's silent for 5 minutes
match->limit = now + seconds(m_block_timeout);
}
return false;
}
// the messages we received from this peer took more than 10
// seconds. Reset the counter and the timer
match->count = 0;
match->limit = now + seconds(10);
}
}
else
{
min->count = 1;
min->limit = now + seconds(10);
min->src = addr;
}
return true;
}
开发者ID:sudarshan-reddy,项目名称:libtorrent,代码行数:60,代码来源:dos_blocker.cpp
示例20: main
int main()
{
int Num = 5;
printf("%p\n", &Num);
print_address(Num);
return 0;
}
开发者ID:blame20,项目名称:C-Programming,代码行数:8,代码来源:9.04PrintIntegerAddress.c
注:本文中的print_address函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论