コード例 #1
0
ファイル: map.cpp プロジェクト: nealey/vera
//----------------------------------------------------------------------
static size_t wrtutf(void)
{
  *set_output_ptr(bufbeg) = '\0';
  qfprintf(myFile, "%s", bufbeg);
  if(!prompt()) return(0);
  return(maxpos - 1);
}
コード例 #2
0
ファイル: oututil.cpp プロジェクト: nealey/vera
//---------------------------------------------------------------------------
uchar putVal(op_t &x, uchar mode, uchar warn)
{
  char    str[MAXSTR];
  uint32  sv_bufsize = bufsize;
  char    *sv_bufbeg = bufbeg, *sv_ptr = get_output_ptr();

  init_output_buffer(str, sizeof(str));
  {
    flags_t sv_uFlag = uFlag;
    uFlag = 0;
    OutValue(x, mode);
    uFlag = sv_uFlag;
  }
  out_zero();
  init_output_buffer(sv_bufbeg, sv_bufsize);
  set_output_ptr(sv_ptr);
  if ( warn) out_tagon(COLOR_ERROR );
  {
    register size_t i;
    if ( !warn) i = tag_strlen(str );
    else      i = tag_remove(str, str, 0);
    if ( chkOutLine(str, i)) return(0 );
  }
  if ( warn) out_tagoff(COLOR_ERROR );
  return(1);
}
コード例 #3
0
//---------------------------------------------------------------------------
uchar putVal(const op_t &x, uchar mode, uchar warn)
{
  char *ptr = get_output_ptr();
  {
    flags_t sv_uFlag = uFlag;
    uFlag = 0;
    OutValue(x, mode);
    uFlag = sv_uFlag;
  }

  char str[MAXSTR];
  char *end = set_output_ptr(ptr);
  size_t len = end - ptr;
  qstrncpy(str, ptr, qmin(len+1, sizeof(str)));

  if ( warn )
    out_tagon(COLOR_ERROR);

  if ( warn )
    len = tag_remove(str, str, 0);
  else
    len = tag_strlen(str);

  if ( chkOutLine(str, len) )
    return 0;

  if ( warn )
    out_tagoff(COLOR_ERROR);
  return 1;
}
コード例 #4
0
ファイル: oututil.cpp プロジェクト: nealey/vera
//----------------------------------------------------------------------
bool change_line(bool main)
{
  *set_output_ptr(bufbeg) = '\0';
  outcnt = 0;
  uchar sv = inf.indent;
  inf.indent = (uchar)curpos;
  bool res = MakeLine(bufbeg, main ? -1 : curpos);
  inf.indent = sv;
  init_output_buffer(bufbeg, bufsize);  // for autocomment with call fmtName
  return res;
}
コード例 #5
0
ファイル: oututil.cpp プロジェクト: nealey/vera
//----------------------------------------------------------------------
//----------------------------------------------------------------------
void instr_beg(char str[MAXSTR*2], int mode)
{
  static const char *const addonce[] =
      { "", "_w", "_quick", "2_quick", "_quick_w" };

  init_prompted_output(str, 4);
  OutMnem(2, addonce[uchar(cmd.wid)]);
  out_zero();
  if ( mode) outcnt = tag_strlen(str );
  else {
    char *ptr = str + (outcnt = tag_remove(str, str, 0));
    set_output_ptr(ptr);
    *ptr = '\0';
  }
}
コード例 #6
0
ファイル: upgrade.cpp プロジェクト: Artorios/IDAplugins-1
//----------------------------------------------------------------------
static void make_new_name(ushort name, ushort subnam, uchar mode, unsigned ip)
{
  char  str[MAXNAMELEN];
  init_output_buffer(str, sizeof(str));
  if ( fmtString(name, sizeof(str)-2, fmt_fullname) ) {
trunc:
    trunc_name(ip, mode & 4);
  } else if ( (char)mode > 0 ) {
    register char *p = get_output_ptr();
    if ( p >= &str[sizeof(str)-3] ) goto trunc;
    *p++ = '.';
    set_output_ptr(p);
    if ( fmtString(subnam, &str[sizeof(str)-2] - p, fmt_name) ) goto trunc;
  }
  term_output_buffer();
  do_name_anyway(ip, convert_clsname(str));
  hide_name(ip);
}
コード例 #7
0
//----------------------------------------------------------------------
uchar putShort(ushort value, uchar wsym)
{
  char *p = get_output_ptr();

  out_tagon(COLOR_ERROR);
  if ( wsym )
    OutChar(wsym);
  OutLong(value,
#ifdef __debug__
                debugmode ? 16 :
#endif
                10);
  out_tagoff(COLOR_ERROR);

  char tmpstr[32];
  char *end = set_output_ptr(p);
  size_t len = end - p;
  qstrncpy(tmpstr, p, qmin(len+1, sizeof(tmpstr)));
  return chkOutLine(tmpstr, tag_strlen(tmpstr));
}
コード例 #8
0
ファイル: oututil.cpp プロジェクト: nealey/vera
//----------------------------------------------------------------------
uchar putShort(ushort value, uchar wsym)
{
  char  tmpstr[32];

  register char *p = get_output_ptr();

  out_tagon(COLOR_ERROR);
  if ( wsym) OutChar(wsym );
  OutLong(value,
#ifdef __debug__
                debugmode ? 16 :
#endif
                10);
  out_tagoff(COLOR_ERROR);

  register size_t len = get_output_ptr() - p;
  memcpy(tmpstr, p, len);
  tmpstr[len] ='\0';
  *p = '\0';
  set_output_ptr(p);
  return(chkOutLine(tmpstr, tag_strlen(tmpstr)));
}