本文整理匯總了C++中DEFINE函數的典型用法代碼示例。如果您正苦於以下問題:C++ DEFINE函數的具體用法?C++ DEFINE怎麽用?C++ DEFINE使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DEFINE函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: board_read_group
void board_read_group(const char *cmd)
{
char buf[16];
snprintf(buf, sizeof(buf), "EGROUP%c", *cmd);
choose_board_t cbrd;
memset(&cbrd, 0, sizeof(cbrd));
cbrd.prefix = sysconf_str(buf);
cbrd.newflag = DEFINE(DEF_NEWPOST);
cbrd.parent = -1;
choose_board(&cbrd);
}
示例2: output_ptreg_defines
void output_ptreg_defines(void)
{
COMMENT("MIPS pt_regs offsets.");
OFFSET(PT_R0, pt_regs, regs[0]);
OFFSET(PT_R1, pt_regs, regs[1]);
OFFSET(PT_R2, pt_regs, regs[2]);
OFFSET(PT_R3, pt_regs, regs[3]);
OFFSET(PT_R4, pt_regs, regs[4]);
OFFSET(PT_R5, pt_regs, regs[5]);
OFFSET(PT_R6, pt_regs, regs[6]);
OFFSET(PT_R7, pt_regs, regs[7]);
OFFSET(PT_R8, pt_regs, regs[8]);
OFFSET(PT_R9, pt_regs, regs[9]);
OFFSET(PT_R10, pt_regs, regs[10]);
OFFSET(PT_R11, pt_regs, regs[11]);
OFFSET(PT_R12, pt_regs, regs[12]);
OFFSET(PT_R13, pt_regs, regs[13]);
OFFSET(PT_R14, pt_regs, regs[14]);
OFFSET(PT_R15, pt_regs, regs[15]);
OFFSET(PT_R16, pt_regs, regs[16]);
OFFSET(PT_R17, pt_regs, regs[17]);
OFFSET(PT_R18, pt_regs, regs[18]);
OFFSET(PT_R19, pt_regs, regs[19]);
OFFSET(PT_R20, pt_regs, regs[20]);
OFFSET(PT_R21, pt_regs, regs[21]);
OFFSET(PT_R22, pt_regs, regs[22]);
OFFSET(PT_R23, pt_regs, regs[23]);
OFFSET(PT_R24, pt_regs, regs[24]);
OFFSET(PT_R25, pt_regs, regs[25]);
OFFSET(PT_R26, pt_regs, regs[26]);
OFFSET(PT_R27, pt_regs, regs[27]);
OFFSET(PT_R28, pt_regs, regs[28]);
OFFSET(PT_R29, pt_regs, regs[29]);
OFFSET(PT_R30, pt_regs, regs[30]);
OFFSET(PT_R31, pt_regs, regs[31]);
OFFSET(PT_LO, pt_regs, lo);
OFFSET(PT_HI, pt_regs, hi);
#ifdef CONFIG_CPU_HAS_SMARTMIPS
OFFSET(PT_ACX, pt_regs, acx);
#endif
OFFSET(PT_EPC, pt_regs, cp0_epc);
OFFSET(PT_BVADDR, pt_regs, cp0_badvaddr);
OFFSET(PT_STATUS, pt_regs, cp0_status);
OFFSET(PT_CAUSE, pt_regs, cp0_cause);
#ifdef CONFIG_CPU_CAVIUM_OCTEON
OFFSET(PT_MPL, pt_regs, mpl);
OFFSET(PT_MTP, pt_regs, mtp);
#endif /* CONFIG_CPU_CAVIUM_OCTEON */
DEFINE(PT_SIZE, sizeof(struct pt_regs));
BLANK();
}
示例3: init_dbg
static void
init_dbg(void)
{
l_debug_mode = 0;
DEFINE("%debug-macro-compiler", MAKE_INT(DBG_COMPILER));
DEFINE("%debug-macro-matcher", MAKE_INT(DBG_MATCHER));
DEFINE("%debug-macro-transcriptor", MAKE_INT(DBG_TRANSCRIPTOR));
DEFINE("%debug-macro-funcall", MAKE_INT(DBG_FUNCALL));
DEFINE("%debug-macro-pvar", MAKE_INT(DBG_PVAR));
DEFINE("%debug-macro-return", MAKE_INT(DBG_RETURN));
DEFINE("%debug-macro-unwrap", MAKE_INT(DBG_UNWRAP));
DEFINE("%debug-macro-expander", MAKE_INT(DBG_EXPANDER));
scm_register_funcs(dbg_funcs);
}
示例4: main
int
main(void)
{
// Memory layout values
DEFINE(CYGMEM_REGION_sdram, CYGMEM_REGION_sdram);
DEFINE(CYGMEM_REGION_sdram_SIZE, CYGMEM_REGION_sdram_SIZE);
DEFINE(CYGMEM_REGION_devs, CYGMEM_REGION_devs);
DEFINE(CYGMEM_REGION_devs_SIZE, CYGMEM_REGION_devs_SIZE);
DEFINE(CYGMEM_REGION_sram, CYGMEM_REGION_sram);
DEFINE(CYGMEM_REGION_sram_SIZE, CYGMEM_REGION_sram_SIZE);
DEFINE(CYGMEM_REGION_flash, CYGMEM_REGION_flash);
DEFINE(CYGMEM_REGION_flash_SIZE, CYGMEM_REGION_flash_SIZE);
return 0;
}
示例5: output_task_defines
void output_task_defines(void)
{
COMMENT("MIPS task_struct offsets.");
OFFSET(TASK_STATE, task_struct, state);
OFFSET(TASK_THREAD_INFO, task_struct, stack);
OFFSET(TASK_FLAGS, task_struct, flags);
OFFSET(TASK_MM, task_struct, mm);
OFFSET(TASK_PID, task_struct, pid);
#if defined(CONFIG_CC_STACKPROTECTOR)
OFFSET(TASK_STACK_CANARY, task_struct, stack_canary);
#endif
DEFINE(TASK_STRUCT_SIZE, sizeof(struct task_struct));
BLANK();
}
示例6: PROCESSLINE
//PROCESSLINE Function
void PROCESSLINE()
{
int i;
for(i=0;i<namcount;i++) //till the total no. of macros
if(!strcmp(opcode,mynamtab[i].name)) //if opcode matches in the NAMTAB
{
EXPAND();return; //then expand
}
{
if(!strcmp(opcode,"MACRO")) //if "MACRO" keyword is encountered
DEFINE(); //then define
else fprintf(expanded,"%s",line); //otherwise copy it into the expanded file
}
}//end processline
示例7: asm_offsets
void asm_offsets(void)
{
OFFSET(TASK_THREAD_INFO, task_struct, stack);
OFFSET(THREAD_PC, task_struct, thread.pc);
OFFSET(THREAD_SP, task_struct, thread.sp);
#ifdef CONFIG_FRAME_POINTER
OFFSET(THREAD_FP, task_struct, thread.fp);
#endif /* CONFIG_FRAME_POINTER */
OFFSET(TI_FLAGS, thread_info, flags);
DEFINE(PT_SIZE, sizeof(struct pt_regs));
OFFSET(PT_ZERO, pt_regs, zero);
OFFSET(PT_RA, pt_regs, ra);
OFFSET(PT_FP, pt_regs, s[0]);
OFFSET(PT_S0, pt_regs, s[0]);
OFFSET(PT_S1, pt_regs, s[1]);
OFFSET(PT_S2, pt_regs, s[2]);
OFFSET(PT_S3, pt_regs, s[3]);
OFFSET(PT_S4, pt_regs, s[4]);
OFFSET(PT_S5, pt_regs, s[5]);
OFFSET(PT_S6, pt_regs, s[6]);
OFFSET(PT_S7, pt_regs, s[7]);
OFFSET(PT_S8, pt_regs, s[8]);
OFFSET(PT_S9, pt_regs, s[9]);
OFFSET(PT_S10, pt_regs, s[10]);
OFFSET(PT_S11, pt_regs, s[11]);
OFFSET(PT_SP, pt_regs, sp);
OFFSET(PT_TP, pt_regs, tp);
OFFSET(PT_V0, pt_regs, v[0]);
OFFSET(PT_V1, pt_regs, v[1]);
OFFSET(PT_A0, pt_regs, a[0]);
OFFSET(PT_A1, pt_regs, a[1]);
OFFSET(PT_A2, pt_regs, a[2]);
OFFSET(PT_A3, pt_regs, a[3]);
OFFSET(PT_A4, pt_regs, a[4]);
OFFSET(PT_A5, pt_regs, a[5]);
OFFSET(PT_A6, pt_regs, a[6]);
OFFSET(PT_A7, pt_regs, a[7]);
OFFSET(PT_A8, pt_regs, a[8]);
OFFSET(PT_A9, pt_regs, a[9]);
OFFSET(PT_A10, pt_regs, a[10]);
OFFSET(PT_A11, pt_regs, a[11]);
OFFSET(PT_A12, pt_regs, a[12]);
OFFSET(PT_A13, pt_regs, a[13]);
OFFSET(PT_STATUS, pt_regs, status);
OFFSET(PT_EPC, pt_regs, epc);
OFFSET(PT_BADVADDR, pt_regs, badvaddr);
OFFSET(PT_CAUSE, pt_regs, cause);
}
示例8: load_pager
static int load_pager(void)
{
int pager = 0;
if (DEFINE(DEF_FRIENDCALL)) {
pager |= FRIEND_PAGER;
}
if (currentuser.flags[0] & PAGER_FLAG) {
pager |= ALL_PAGER;
pager |= FRIEND_PAGER;
}
if (DEFINE(DEF_FRIENDMSG)) {
pager |= FRIENDMSG_PAGER;
}
if (DEFINE(DEF_ALLMSG)) {
pager |= ALLMSG_PAGER;
pager |= FRIENDMSG_PAGER;
}
if (DEFINE(DEF_LOGOFFMSG)) {
pager |= LOGOFFMSG_PAGER;
}
return pager;
}
示例9: foo
int foo(void)
{
DEFINE(AOFF_task_thread, offsetof(struct task_struct, thread));
BLANK();
/* XXX This is the stuff for sclow.S, kill it. */
DEFINE(AOFF_task_pid, offsetof(struct task_struct, pid));
DEFINE(AOFF_task_uid, offsetof(struct task_struct, uid));
DEFINE(AOFF_task_gid, offsetof(struct task_struct, gid));
DEFINE(AOFF_task_euid, offsetof(struct task_struct, euid));
DEFINE(AOFF_task_egid, offsetof(struct task_struct, egid));
/* DEFINE(THREAD_INFO, offsetof(struct task_struct, stack)); */
DEFINE(ASIZ_task_uid, sizeof(current->uid));
DEFINE(ASIZ_task_gid, sizeof(current->gid));
DEFINE(ASIZ_task_euid, sizeof(current->euid));
DEFINE(ASIZ_task_egid, sizeof(current->egid));
BLANK();
DEFINE(AOFF_thread_fork_kpsr,
offsetof(struct thread_struct, fork_kpsr));
BLANK();
DEFINE(AOFF_mm_context, offsetof(struct mm_struct, context));
/* DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); */
return 0;
}
示例10: prepare
static void
prepare (void)
{
/* Flags. */
MUSCLE_INSERT_BOOL ("debug_flag", debug_flag);
MUSCLE_INSERT_BOOL ("defines_flag", defines_flag);
MUSCLE_INSERT_BOOL ("error_verbose_flag", error_verbose);
MUSCLE_INSERT_BOOL ("locations_flag", locations_flag);
MUSCLE_INSERT_BOOL ("pure_flag", pure_parser);
MUSCLE_INSERT_BOOL ("synclines_flag", !no_lines_flag);
/* File names. */
MUSCLE_INSERT_STRING ("prefix", spec_name_prefix ? spec_name_prefix : "yy");
#define DEFINE(Name) MUSCLE_INSERT_STRING (#Name, Name ? Name : "")
DEFINE (dir_prefix);
DEFINE (parser_file_name);
DEFINE (spec_defines_file);
DEFINE (spec_file_prefix);
DEFINE (spec_graph_file);
DEFINE (spec_name_prefix);
DEFINE (spec_outfile);
DEFINE (spec_verbose_file);
#undef DEFINE
/* User Code. */
obstack_1grow (&pre_prologue_obstack, 0);
obstack_1grow (&post_prologue_obstack, 0);
muscle_insert ("pre_prologue", obstack_finish (&pre_prologue_obstack));
muscle_insert ("post_prologue", obstack_finish (&post_prologue_obstack));
/* Find the right skeleton file. */
if (!skeleton)
{
if (glr_parser || nondeterministic_parser)
skeleton = "glr.c";
else
skeleton = "yacc.c";
}
/* About the skeletons. */
{
char const *pkgdatadir = getenv ("BISON_PKGDATADIR");
MUSCLE_INSERT_STRING ("pkgdatadir", pkgdatadir ? pkgdatadir : PKGDATADIR);
MUSCLE_INSERT_C_STRING ("skeleton", skeleton);
}
}
示例11: common
void common(void) {
BLANK();
OFFSET(TI_flags, thread_info, flags);
OFFSET(TI_status, thread_info, status);
OFFSET(TI_addr_limit, thread_info, addr_limit);
OFFSET(TI_preempt_count, thread_info, preempt_count);
OFFSET(TI_preempt_lazy_count, thread_info, preempt_lazy_count);
BLANK();
OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
BLANK();
OFFSET(pbe_address, pbe, address);
OFFSET(pbe_orig_address, pbe, orig_address);
OFFSET(pbe_next, pbe, next);
#ifdef CONFIG_PARAVIRT
BLANK();
OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled);
OFFSET(PARAVIRT_PATCH_pv_cpu_ops, paravirt_patch_template, pv_cpu_ops);
OFFSET(PARAVIRT_PATCH_pv_irq_ops, paravirt_patch_template, pv_irq_ops);
OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable);
OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable);
OFFSET(PV_CPU_iret, pv_cpu_ops, iret);
OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit);
OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0);
OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2);
#endif
#ifdef CONFIG_XEN
BLANK();
OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
#endif
BLANK();
OFFSET(BP_scratch, boot_params, scratch);
OFFSET(BP_loadflags, boot_params, hdr.loadflags);
OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
OFFSET(BP_version, boot_params, hdr.version);
OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
OFFSET(BP_pref_address, boot_params, hdr.pref_address);
OFFSET(BP_code32_start, boot_params, hdr.code32_start);
BLANK();
DEFINE(PTREGS_SIZE, sizeof(struct pt_regs));
}
示例12: output_ptreg_defines
void output_ptreg_defines(void)
{
COMMENT("MIPS pt_regs offsets.");
OFFSET(PT_R0, pt_regs, regs[0]);
OFFSET(PT_R1, pt_regs, regs[1]);
OFFSET(PT_R2, pt_regs, regs[2]);
OFFSET(PT_R3, pt_regs, regs[3]);
OFFSET(PT_R4, pt_regs, regs[4]);
OFFSET(PT_R5, pt_regs, regs[5]);
OFFSET(PT_R6, pt_regs, regs[6]);
OFFSET(PT_R7, pt_regs, regs[7]);
OFFSET(PT_R8, pt_regs, regs[8]);
OFFSET(PT_R9, pt_regs, regs[9]);
OFFSET(PT_R10, pt_regs, regs[10]);
OFFSET(PT_R11, pt_regs, regs[11]);
OFFSET(PT_R12, pt_regs, regs[12]);
OFFSET(PT_R13, pt_regs, regs[13]);
OFFSET(PT_R14, pt_regs, regs[14]);
OFFSET(PT_R15, pt_regs, regs[15]);
OFFSET(PT_R16, pt_regs, regs[16]);
OFFSET(PT_R17, pt_regs, regs[17]);
OFFSET(PT_R18, pt_regs, regs[18]);
OFFSET(PT_R19, pt_regs, regs[19]);
OFFSET(PT_R20, pt_regs, regs[20]);
OFFSET(PT_R21, pt_regs, regs[21]);
OFFSET(PT_R22, pt_regs, regs[22]);
OFFSET(PT_R23, pt_regs, regs[23]);
OFFSET(PT_R24, pt_regs, regs[24]);
OFFSET(PT_R25, pt_regs, regs[25]);
OFFSET(PT_R26, pt_regs, regs[26]);
OFFSET(PT_R27, pt_regs, regs[27]);
OFFSET(PT_R28, pt_regs, regs[28]);
OFFSET(PT_R29, pt_regs, regs[29]);
OFFSET(PT_R30, pt_regs, regs[30]);
OFFSET(PT_R31, pt_regs, regs[31]);
OFFSET(PT_LO, pt_regs, lo);
OFFSET(PT_HI, pt_regs, hi);
OFFSET(PT_EPC, pt_regs, cp0_epc);
OFFSET(PT_BVADDR, pt_regs, cp0_badvaddr);
OFFSET(PT_STATUS, pt_regs, cp0_status);
OFFSET(PT_CAUSE, pt_regs, cp0_cause);
DEFINE(PT_SIZE, sizeof(struct pt_regs));
BLANK();
}
示例13: main
int main(void)
{
OFFSET(S_X0, pt_regs, regs[0]);
OFFSET(S_X1, pt_regs, regs[1]);
OFFSET(S_X2, pt_regs, regs[2]);
OFFSET(S_X3, pt_regs, regs[3]);
OFFSET(S_X4, pt_regs, regs[4]);
OFFSET(S_X5, pt_regs, regs[5]);
OFFSET(S_X6, pt_regs, regs[6]);
OFFSET(S_X7, pt_regs, regs[7]);
OFFSET(S_LR, pt_regs, regs[30]);
OFFSET(S_SP, pt_regs, sp);
OFFSET(S_PC, pt_regs, pc);
OFFSET(S_PSTATE, pt_regs, pstate);
OFFSET(S_ORIG_X0, pt_regs, orig_x0);
OFFSET(S_SYSCALLNO, pt_regs, syscallno);
DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs));
return 0;
}
示例14: main
int main(void)
{
DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
BLANK();
DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm));
DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags));
BLANK();
DEFINE(VM_EXEC, VM_EXEC);
BLANK();
BLANK();
DEFINE(PAGE_PRESENT, _PAGE_PRESENT);
DEFINE(PAGE_READONLY, _PAGE_READONLY);
DEFINE(PAGE_NOT_USER, _PAGE_NOT_USER);
DEFINE(PAGE_OLD, _PAGE_OLD);
DEFINE(PAGE_CLEAN, _PAGE_CLEAN);
BLANK();
DEFINE(PAGE_SZ, PAGE_SIZE);
BLANK();
DEFINE(SYS_ERROR0, 0x9f0000);
return 0;
}
示例15: choose_board_read
static int choose_board_read(choose_t *cp)
{
choose_board_t *cbrd = cp->data;
board_data_t *ptr = cbrd->brds + cp->cur;
if (ptr->flag & BOARD_DIR_FLAG) {
int parent = cbrd->parent;
const char *prefix = cbrd->prefix;
bool recursive = cbrd->recursive;
bool goodbrd = cbrd->goodbrd;
int cur = cp->cur;
cbrd->parent = ptr->pos;
cbrd->prefix = NULL;
cbrd->recursive = true;
cbrd->goodbrd = (ptr->flag & BOARD_CUSTOM_FLAG) ? true : false;
choose_board(cbrd);
cbrd->parent = parent;
cbrd->prefix = prefix;
cbrd->recursive = recursive;
cbrd->goodbrd = goodbrd;
cp->cur = cur;
} else {
brc_initial(currentuser.userid, ptr->name);
changeboard(&currbp, currboard, ptr->name);
memcpy(currBM, ptr->BM, BM_LEN - 1);
char buf[STRLEN];
if (DEFINE(DEF_FIRSTNEW)) {
setbdir(buf, currboard);
int tmp = unread_position(buf, ptr);
int page = tmp - t_lines / 2;
getkeep(buf, page > 1 ? page : 1, tmp + 1);
}
board_read();
brc_zapbuf(cbrd->zapbuf + ptr->pos);
ptr->total = -1;
currBM[0] = '\0';
}
return FULLUPDATE;
}