コード例 #1
0
ファイル: out.cpp プロジェクト: trietptm/usefulres
//--------------------------------------------------------------------------
// конец текста
void N78K_footer(void)
{
  char buf[MAXSTR];
  char *const end = buf + sizeof(buf);
  if (ash.end != NULL){
    MakeNull();
#if IDP_INTERFACE_VERSION > 37
    char *ptr = tag_addstr(buf, end, COLOR_ASMDIR, ash.end);
    char name[MAXSTR];
    if (get_colored_name(BADADDR, inf.beginEA, name, sizeof(name)) != NULL){
		register int i = strlen(ash.end);
		do APPCHAR(ptr, end, ' '); while(++i < 8);
		APPEND(ptr, end, name);
    }
    MakeLine(buf,inf.indent);
#else
    register char *p = tag_addstr(buf, COLOR_ASMDIR, ash.end);
    const char *start = get_colored_name(inf.beginEA);
    if(start != NULL) {
      *p++ = ' ';
      strcpy(p, start);
    }
    MakeLine(buf);
#endif
  } else gen_cmt_line("end of file");
}
コード例 #2
0
ファイル: out.cpp プロジェクト: trietptm/usefulres
//--------------------------------------------------------------------------
void header(void)
{
  gen_cmt_line("Processor       : %-8.8s", inf.procName);
  gen_cmt_line("Target assembler: %s", ash.name);
  gen_cmt_line("Byte sex        : %s, %s",
                  inf.mf ? "big-endian" : "little-endian",
                  inf.wide_high_byte_first ? "high_byte_first" : "high_byte_last");
  if ( ash.header != NULL )
    for ( const char **ptr=ash.header; *ptr != NULL; ptr++ )
      printf_line(0,COLSTR("%s",SCOLOR_ASMDIR),*ptr);
  MakeNull();
  printf_line(0,COLSTR("MY_BYTE .macro BYTE",SCOLOR_ASMDIR));
  printf_line(0,COLSTR("        .emsg \"ERROR - Impossible to generate 8bit bytes on this processor. Please convert them to 16bit words.\"",SCOLOR_ASMDIR));
  printf_line(0,COLSTR("        .endm",SCOLOR_ASMDIR));
  MakeNull();
}
コード例 #3
0
ファイル: graph-bfs.cpp プロジェクト: silent1993/c-language
void BFS(AdjGraph G,int i)
{
    int k;
    EdgeNode p;
    QUEUE Q;
    MakeNull(Q);
    EnQueue(k,Q);
    while(!Empty(Q));
    {
        i=DeQueue(Q);
        p=G.verlist[i].firstedge;
        while(p)
        {
            if(!visit[p->adjvex])
            {
                 LineList[++edgenum].head=G.verlist[i].vertex;
                 LineList[++edgenum].tail=G.verlist[p->adjvex].vertex;
                visit[p->adjvex]=1;
                EnQueue(p->adjvex,Q);
            }
            p=p->next;
        }
    }

}
コード例 #4
0
ファイル: http.cpp プロジェクト: asdlei00/tinyrss
bool CMyByteArray::Duplicate( void** ppData, bool bMakeNull /*= false*/ )
{
	int addition = bMakeNull ? sizeof(int) : 0;
	if(bMakeNull) MakeNull();
	char* p = new char[GetSpaceUsed()+addition];
	memcpy(p,GetData(),GetSize()+addition);
	*ppData = p;
	return true;
}
コード例 #5
0
ファイル: oututil.cpp プロジェクト: nealey/vera
//--------------------------------------------------------------------------
void myBorder(void)
{
  MakeNull();
  if ( user_limiter ) {
    inf.s_limiter = LMT_THIN;
    MakeBorder();
  }
  inf.s_limiter = 0;  // fo not output border between method & vars :(
}
コード例 #6
0
ファイル: out.cpp プロジェクト: nealey/vera
//--------------------------------------------------------------------------
void header(void) {
  gen_cmt_line("Processor       : %-8.8s", inf.procName);
//  gen_cmt_line("Target assembler: %s", ash.name);
//  gen_cmt_line("Byte sex        : %s", inf.mf ? "Big endian" : "Little endian");
  if ( ash.header != NULL )
    for ( const char **ptr=ash.header; *ptr != NULL; ptr++ )
      printf_line(0,COLSTR("%s",SCOLOR_ASMDIR),*ptr);
  MakeNull();
}
コード例 #7
0
ファイル: out.cpp プロジェクト: nealey/vera
// --------------------------------------------------------------------------
// generate end of the disassembly
void idaapi footer(void) {
  char buf[MAXSTR];

  // if assembler supplies end statement, output it
  if (ash.end != NULL) {
    MakeNull();
    tag_addstr(buf, buf+sizeof(buf), COLOR_ASMDIR, ash.end);
    MakeLine(buf, inf.indent);
  }
}
コード例 #8
0
//--------------------------------------------------------------------------
void idaapi footer(void)
{
  char buf[MAXSTR];

  MakeNull();

  tag_addstr(buf, buf+sizeof(buf), COLOR_ASMDIR, ash.end);
  MakeLine(buf, inf.indent);

  gen_cmt_line("end of file");
}
コード例 #9
0
ファイル: out.cpp プロジェクト: trietptm/usefulres
static int out_equ(ea_t ea)
{
  char buf[MAXSTR];
  char *const end = buf + sizeof(buf);
  segment_t *s = getseg(ea);
  if ( s != NULL && s->type == SEG_IMEM && ash.a_equ != NULL)
  {
    char nbuf[MAXSTR];
    char *name = get_name(BADADDR, ea, nbuf, sizeof(nbuf));
    if ( name != NULL
      && ((ash.uflag & UAS_PBYTNODEF) == 0 || !IsPredefined(name)) )
    {
      get_colored_name(BADADDR, ea, buf, sizeof(buf));
      uchar off = uchar(ea - get_segm_base(s));
      do_out_equ(buf, ash.a_equ, off);
      if ( (ash.uflag & UAS_AUBIT) == 0 && (off & 0xF8) == off )
      {
        char *ptr = tag_on(tail(buf), end, COLOR_SYMBOL);
        APPCHAR(ptr, end, ash.uflag & UAS_NOBIT ? '_' : '.');
        APPCHAR(ptr, end, '0');
        tag_off(ptr, end, COLOR_SYMBOL);
        for ( int i=0; i < 8; i++ )
        {
          const ioport_bit_t *b = find_bit(off, i);
          char *p2 = ptr;
          if ( b == NULL || b->name == NULL )
            ptr[-1] = '0' + i;
          else
            p2 = tag_addstr(ptr-1, end, COLOR_HIDNAME, b->name);
          tag_off(p2, end, COLOR_SYMBOL);
          do_out_equ(buf, ash.a_equ, off+i);
        }
        MakeNull();
      }
    }
    else
    {
      gl_name = 0;
      MakeLine("");
    }
    return 1;
  }
  if ( ash.uflag & UAS_NODS )
  {
    if ( !isLoaded(ea) && s->type == SEG_CODE )
    {
      adiff_t org = ea - get_segm_base(s) + get_item_size(ea);
      btoa(buf, sizeof(buf), org);
      printf_line(inf.indent, COLSTR("%s %s", SCOLOR_ASMDIR), ash.origin, buf);
      return 1;
    }
  }
  return 0;
}
コード例 #10
0
ファイル: out.cpp プロジェクト: nealey/vera
//--------------------------------------------------------------------------
void idaapi header(void)
{
  gen_cmt_line("Processor       : %-8.8s", inf.procName);
  gen_cmt_line("Target assembler: %s", ash.name);
  gen_cmt_line("Byte sex        : %s, %s",
                  inf.mf ? "big-endian" : "little-endian",
                  inf.wide_high_byte_first ? "high_byte_first" : "high_byte_last");
  if ( ash.header != NULL )
    for ( const char **ptr=ash.header; *ptr != NULL; ptr++ )
      printf_line(0,COLSTR("%s",SCOLOR_ASMDIR),*ptr);
  MakeNull();
}
コード例 #11
0
ファイル: oututil.cpp プロジェクト: nealey/vera
//--------------------------------------------------------------------------
uchar out_problems(char str[MAXSTR], const char *prefix)
{
  if ( curClass.extflg & XFL_C_ERRLOAD ) {
    myBorder();
    printf_line(inf.indent,
       COLSTR("%s This class has had loading time problem(s)", SCOLOR_ERROR),
                prefix);
    if ( curClass.msgNode ) {
      MakeNull();
      if ( print_loader_messages(str, prefix) == -1) return(1 );
    }
    myBorder();
  }
  return(0);
}
コード例 #12
0
ファイル: out.cpp プロジェクト: nealey/vera
// Generate disassembly footer
void footer(void) {
    char buf[MAXSTR];
    char *const end = buf + sizeof(buf);
    if ( ash.end != NULL ) {
        MakeNull();
        register char *p = tag_addstr(buf, end, COLOR_ASMDIR, ash.end);
        char name[MAXSTR];
        if ( get_colored_name(BADADDR, inf.beginEA, name, sizeof(name)) != NULL ) {
            APPCHAR(p, end, ' ');
            APPEND(p, end, name);
        }
        MakeLine(buf, inf.indent);
    }
    else {
        gen_cmt_line("end of file");
    }
}
コード例 #13
0
ファイル: stack.cpp プロジェクト: 1130310223/lab4
int main(){
    int temp;
    STACK t={4,{1,2,3,4,5}};
    char order;
    while(true){
        scanf("%c",&order);
        switch (order){
            case 'M':
                MakeNull(&t);
                displaySTACK(&t);
                break;
            case 'P':
                temp=Pop(&t);
                printf("The top element is %d\n",temp);
                displaySTACK(&t);
                break;
            case 'I':
                scanf("%d",&temp);
                Push(&t,temp);
                displaySTACK(&t);
        }
    }
    return 0;
}
コード例 #14
0
//--------------------------------------------------------------------------
void idaapi header(void)
{
  gen_header(GH_PRINT_PROC | GH_PRINT_HEADER);
  MakeNull();
}
コード例 #15
0
ファイル: chain point.cpp プロジェクト: silent1993/c-language
int main()
{
    int i,j;
    position p;
    LIST L;
    L=new mylist;
    p=new mylist;
    printf("what do you want,1-creat,2-insert,3-deleat,4-next,5-retrieve,6-makenull,7-printf,8-locate,0-exit\n");
    while(scanf("%d",&j))
    {
        if(j==1)
        Creat(L);
    if(j==2)
    {printf("which position do you want to in,and what number\n");
    scanf("%d %d",&p,&i);
    Insert(i,p);
    }
    if(j==3)
    {
     printf("which position do you want to deleat\n");
    scanf("%d %d",&p,&i);
    Delete(p);
    }
    if(j==4)
    {
        printf("which next\n");
        scanf("%d",&p);
        p=Next(p,L);
        printf("the next is %d\n",p->n);
    }
    if(j==5)
    {
        printf("which do you retrieve\n");
        scanf("%d",&p);
        printf("the element is %d\n",Retrieve(p,L));
    }
    if(j==6)
    {
        MakeNull(L);
    }
    if(j==7)
    {
        Prin(L);
    }
    if(j==8)
    {
        printf("which do you locate\n");
        scanf("%d",&i);
        p=Locate(i,L);
       if(p)
       {
           printf("%d",p->next->n);

       }
       else
        printf("no find");

    }
    if(j==0)
        return 0;
    }

}