Esempio n. 1
0
rtx
gen_rtx_fmt_ii (RTX_CODE code, enum machine_mode mode,
	int arg0,
	int arg1)
{
  rtx rt;
  rt = rtx_alloc (code);

  PUT_MODE (rt, mode);
  XINT (rt, 0) = arg0;
  XINT (rt, 1) = arg1;

  return rt;
}
Esempio n. 2
0
File: menu.c Progetto: stanis/emacs
static Lisp_Object
restore_menu_items (Lisp_Object saved)
{
  menu_items = XCAR (saved);
  menu_items_inuse = (! NILP (menu_items) ? Qt : Qnil);
  menu_items_allocated = (VECTORP (menu_items) ? ASIZE (menu_items) : 0);
  saved = XCDR (saved);
  menu_items_used = XINT (XCAR (saved));
  saved = XCDR (saved);
  menu_items_n_panes = XINT (XCAR (saved));
  saved = XCDR (saved);
  menu_items_submenu_depth = XINT (XCAR (saved));
  return Qnil;
}
Esempio n. 3
0
File: undo.c Progetto: yinsuhu/emacs
void
record_insert (ptrdiff_t beg, ptrdiff_t length)
{
  Lisp_Object lbeg, lend;

  if (EQ (BVAR (current_buffer, undo_list), Qt))
    return;

  record_point (beg);

  /* If this is following another insertion and consecutive with it
     in the buffer, combine the two.  */
  if (CONSP (BVAR (current_buffer, undo_list)))
    {
      Lisp_Object elt;
      elt = XCAR (BVAR (current_buffer, undo_list));
      if (CONSP (elt)
	  && INTEGERP (XCAR (elt))
	  && INTEGERP (XCDR (elt))
	  && XINT (XCDR (elt)) == beg)
	{
	  XSETCDR (elt, make_number (beg + length));
	  return;
	}
    }

  XSETFASTINT (lbeg, beg);
  XSETINT (lend, beg + length);
  bset_undo_list (current_buffer,
		  Fcons (Fcons (lbeg, lend), BVAR (current_buffer, undo_list)));
}
Esempio n. 4
0
static void
max_operand_1 (rtx x)
{
  RTX_CODE code;
  int i;
  int len;
  const char *fmt;

  if (x == 0)
    return;

  code = GET_CODE (x);

  if (code == MATCH_OPERAND || code == MATCH_OPERATOR
      || code == MATCH_PARALLEL)
    max_opno = MAX (max_opno, XINT (x, 0));

  fmt = GET_RTX_FORMAT (code);
  len = GET_RTX_LENGTH (code);
  for (i = 0; i < len; i++)
    {
      if (fmt[i] == 'e' || fmt[i] == 'u')
	max_operand_1 (XEXP (x, i));
      else if (fmt[i] == 'E')
	{
	  int j;
	  for (j = 0; j < XVECLEN (x, i); j++)
	    max_operand_1 (XVECEXP (x, i, j));
	}
    }
}
Esempio n. 5
0
static bool
xfont_chars_supported (Lisp_Object chars, XFontStruct *xfont,
		       struct charset *encoding, struct charset *repertory)
{
  struct charset *charset = repertory ? repertory : encoding;

  if (CONSP (chars))
    {
      for (; CONSP (chars); chars = XCDR (chars))
	{
	  int c = XINT (XCAR (chars));
	  unsigned code = ENCODE_CHAR (charset, c);
	  XChar2b char2b;

	  if (code == CHARSET_INVALID_CODE (charset))
	    break;
	  if (! xfont)
	    continue;
	  if (code >= 0x10000)
	    break;
	  char2b.byte1 = code >> 8;
	  char2b.byte2 = code & 0xFF;
	  if (! xfont_get_pcm (xfont, &char2b))
	    break;
	}
      return (NILP (chars));
    }
  else if (VECTORP (chars))
Esempio n. 6
0
bool
nds32_const_unspec_p (rtx x)
{
  if (GET_CODE (x) == CONST)
    {
      x = XEXP (x, 0);

      if (GET_CODE (x) == PLUS)
	x = XEXP (x, 0);

      if (GET_CODE (x) == UNSPEC)
	{
	  switch (XINT (x, 1))
	    {
	    case UNSPEC_GOTINIT:
	    case UNSPEC_GOT:
	    case UNSPEC_GOTOFF:
	    case UNSPEC_PLT:
	    case UNSPEC_TLSGD:
	    case UNSPEC_TLSLD:
	    case UNSPEC_TLSIE:
	    case UNSPEC_TLSLE:
	      return false;
	    default:
	      return true;
	    }
	}
    }

  if (GET_CODE (x) == SYMBOL_REF
      && SYMBOL_REF_TLS_MODEL (x))
    return false;

  return true;
}
Esempio n. 7
0
static void evict_lower_half (log_t *log)
{
  ptrdiff_t size = ASIZE (log->key_and_value) / 2;
  EMACS_INT median = approximate_median (log, 0, size);
  ptrdiff_t i;

  for (i = 0; i < size; i++)
    /* Evict not only values smaller but also values equal to the median,
       so as to make sure we evict something no matter what.  */
    if (XINT (HASH_VALUE (log, i)) <= median)
      {
	Lisp_Object key = HASH_KEY (log, i);
	{ /* FIXME: we could make this more efficient.  */
	  Lisp_Object tmp;
	  XSET_HASH_TABLE (tmp, log); /* FIXME: Use make_lisp_ptr.  */
	  Fremhash (key, tmp);
	}
	eassert (EQ (log->next_free, make_number (i)));
	{
	  int j;
	  eassert (VECTORP (key));
	  for (j = 0; j < ASIZE (key); j++)
	    ASET (key, j, Qnil);
	}
	set_hash_key_slot (log, i, key);
      }
}
Esempio n. 8
0
char* whatis(Lisp_Object object) {
  debug_print_buf[0] = '\0';
  debug_print_buf[80] = '\0';

  if (STRINGP(object)) {
    snprintf(debug_print_buf, 80, "String %s", SSDATA(object));
    return debug_print_buf;
  } else if (INTEGERP(object)) {
    int x = XINT(object);
    snprintf(debug_print_buf, 80, "Number %d", x);
    return debug_print_buf;
  } else if (FLOATP(object)) {
    struct Lisp_Float* floater = XFLOAT(object);
    return "It's a float number!";
  } else if (Qnil == object)
    return "It's a lisp null";
  else if (Qt == object)
    return "It's a lisp 't'";
  else if (SYMBOLP(object)) {
    snprintf(debug_print_buf, 80, "Symbol named %s", SYMBOL_NAME(object));
    return debug_print_buf;
  } else if (CONSP(object))
    return "It's a list!";
  else if (MISCP(object))
    return "It's a lisp misc!";
  else if (VECTORLIKEP(object))
    return "It's some kind of vector like thingie!";
  else
    return "I don't know what it is.";
}
Esempio n. 9
0
HOST_WIDE_INT
const_vector_to_hwint (rtx op)
{
  HOST_WIDE_INT hwint = 0;
  HOST_WIDE_INT mask;
  int i;
  int shift_adv;
  int shift = 0;
  int nelem;

  switch (GET_MODE (op))
    {
      case E_V2HImode:
	mask = 0xffff;
	shift_adv = 16;
	nelem = 2;
	break;
      case E_V4QImode:
	mask = 0xff;
	shift_adv = 8;
	nelem = 4;
	break;
      default:
	gcc_unreachable ();
    }

  if (TARGET_BIG_ENDIAN)
    {
      for (i = 0; i < nelem; ++i)
	{
	  HOST_WIDE_INT val = XINT (XVECEXP (op, 0, nelem - i - 1), 0);
	  hwint |= (val & mask) << shift;
	  shift = shift + shift_adv;
	}
    }
  else
    {
      for (i = 0; i < nelem; ++i)
	{
	  HOST_WIDE_INT val = XINT (XVECEXP (op, 0, i), 0);
	  hwint |= (val & mask) << shift;
	  shift = shift + shift_adv;
	}
    }

  return hwint;
}
Esempio n. 10
0
static void
xftfont_add_rendering_parameters (FcPattern *pat, Lisp_Object entity)
{
  Lisp_Object tail;
  int ival;

  for (tail = AREF (entity, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail))
    {
      Lisp_Object key = XCAR (XCAR (tail));
      Lisp_Object val = XCDR (XCAR (tail));

      if (EQ (key, QCantialias))
          FcPatternAddBool (pat, FC_ANTIALIAS, NILP (val) ? FcFalse : FcTrue);
      else if (EQ (key, QChinting))
	FcPatternAddBool (pat, FC_HINTING, NILP (val) ? FcFalse : FcTrue);
      else if (EQ (key, QCautohint))
	FcPatternAddBool (pat, FC_AUTOHINT, NILP (val) ? FcFalse : FcTrue);
      else if (EQ (key, QChintstyle))
	{
	  if (INTEGERP (val))
	    FcPatternAddInteger (pat, FC_HINT_STYLE, XINT (val));
          else if (SYMBOLP (val)
                   && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
	    FcPatternAddInteger (pat, FC_HINT_STYLE, ival);
	}
      else if (EQ (key, QCrgba))
	{
	  if (INTEGERP (val))
	    FcPatternAddInteger (pat, FC_RGBA, XINT (val));
          else if (SYMBOLP (val)
                   && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
	    FcPatternAddInteger (pat, FC_RGBA, ival);
	}
      else if (EQ (key, QClcdfilter))
	{
	  if (INTEGERP (val))
	    FcPatternAddInteger (pat, FC_LCD_FILTER, ival = XINT (val));
          else if (SYMBOLP (val)
                   && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
	    FcPatternAddInteger (pat, FC_LCD_FILTER, ival);
	}
#ifdef FC_EMBOLDEN
      else if (EQ (key, QCembolden))
	FcPatternAddBool (pat, FC_EMBOLDEN, NILP (val) ? FcFalse : FcTrue);
#endif
    }
}
Esempio n. 11
0
void
c54x_print_operand(FILE *stream, rtx op, char letter)
{
	rtx mem;
	rtx base;
	rtx disp;
	
	switch(GET_CODE(op)) {
	case REG:
		fprintf(stream, "%s", reg_names[REGNO(op)]);
		break;
	case CONST_INT:
		if(letter == 'I') {
			fprintf(stream, "#0%xh", 0xffff & XINT(op, 0));
		} else {
			fprintf(stream, "%d", XINT(op, 0));
		}
		break;
	case MEM:
		mem = XEXP(op, 0);
		switch(GET_CODE(mem)) {
		case LABEL_REF:
		case SYMBOL_REF:
			fprintf(stream, "%s", XSTR(mem, 0));
			break;
		case REG:
			fprintf(stream, "*%s", reg_names[REGNO(mem)]);
			break;
		case PLUS:
			base = XEXP(mem, 0);
			disp = XEXP(mem, 1);
			if( REG_P(base) && CONSTANT_P(disp) ) {
				fprintf(stream, "*%s(%d)", reg_names[REGNO(base)], XINT(disp, 0));
			}
			break;
		default:
			fprintf(stream, "mem:");
			print_rtl(stream, mem);
			break;
		}
		break;
	default:
		fprintf(stream, "op:");
		print_rtl(stream, op);
		break;
	}
}
Esempio n. 12
0
static intmax_t
module_extract_integer (emacs_env *env, emacs_value n)
{
  MODULE_FUNCTION_BEGIN (0);
  Lisp_Object l = value_to_lisp (n);
  CHECK_NUMBER (l);
  return XINT (l);
}
int
tp_or_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
  return (register_operand (op, mode)) || (((GET_CODE (op) == UNSPEC) && (
#line 496 "../.././gcc/config/i386/predicates.md"
(XINT (op, 1) == UNSPEC_TP))) && (
(mode == VOIDmode || GET_MODE (op) == mode)));
}
Esempio n. 14
0
double
extract_float (Lisp_Object num)
{
  CHECK_NUMBER_OR_FLOAT (num);

  if (FLOATP (num))
    return XFLOAT_DATA (num);
  return (double) XINT (num);
}
Esempio n. 15
0
static Bufpos
end_of_defun (struct buffer *buf, Bufpos pt)
{
  Lisp_Object retval = scan_lists (buf, pt, 1, 0, 0, 1);
  if (NILP (retval))
    return BUF_ZV (buf);
  else
    return XINT (retval);
}
Esempio n. 16
0
int
legitimate_address_p (enum machine_mode mode, rtx addr, int strict)
{
	int valid=0;
	rtx base, index;
	
	switch(GET_CODE(addr)) {
	case REG:
		valid = (AUX_REG_P(addr) || SP_REG_P(addr) || (!strict && PSEUDO_REG_P(addr)));
		break;
	case PLUS:
		base = XEXP(addr, 0);
		index = XEXP(addr, 1);

		valid =
			/* Indirect + offset Smem addressing */
			((AUX_REG_P(base) || (!strict && PSEUDO_REG_P(base)))
			 && (GET_CODE(index) == CONST_INT) && IN_RANGE_P(XINT(index, 0), -32768, 65535))
			/* Direct, offset from SP (cpl=1) */
			|| ((SP_REG_P(base) || (!strict && PSEUDO_REG_P(base)))
				&& (GET_CODE(index) == CONST_INT) && IN_RANGE_P(XINT(index, 0), 0, 128));
		break;
	case PRE_DEC:
	case POST_INC:
	case PRE_INC:
	case POST_DEC:
		base = XEXP(addr, 0);
		valid = AUX_REG_P(base) || ((!strict && PSEUDO_REG_P(base)));
		break;
	case CONST:
	case CONST_INT:
	case SYMBOL_REF:
/* 	case LABEL_REF: */
		valid = 1;
		break;
	default:
		break;
	}
	
	print_rtl(stderr, addr);
	fprintf(stderr, " valid: %s, strict: %s\n", (valid ? "yes" : "no"), (strict ? "yes" : "no" ));
	
	return valid;
}
Esempio n. 17
0
/*
 * Return value is Qt if we have dispatched the command,
 * or Qnil if id has not been mapped to a callback.
 * Window procedure may try other targets to route the
 * command if we return nil
 */
Lisp_Object
mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, LPARAM id)
{
  /* Try to map the command id through the proper hash table */
  Lisp_Object callback, callback_ex, image_instance, frame, event;

  XSETFRAME (frame, f);

  /* #### make_int should assert that --kkm */
  assert (XINT (make_int (id)) == id);

  image_instance = Fgethash (make_int (id), 
			     FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f), Qnil);
  /* It is possible for a widget action to cause it to get out of sync
     with its instantiator. Thus it is necessary to signal this
     possibility. */
  if (IMAGE_INSTANCEP (image_instance))
    XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (image_instance) = 1;
  callback = Fgethash (make_int (id), 
		       FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f), Qnil);
  callback_ex = Fgethash (make_int (id), 
			  FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f), Qnil);

  if (!NILP (callback_ex) && !UNBOUNDP (callback_ex))
    {
      event = Fmake_event (Qnil, Qnil);

      XEVENT (event)->event_type = misc_user_event;
      XEVENT (event)->channel = frame;
      XEVENT (event)->timestamp = GetTickCount ();
      XEVENT (event)->event.eval.function = Qeval;
      XEVENT (event)->event.eval.object =
	list4 (Qfuncall, callback_ex, image_instance, event);
    }
  else if (NILP (callback) || UNBOUNDP (callback))
    return Qnil;
  else
    {
      Lisp_Object fn, arg;

      event = Fmake_event (Qnil, Qnil);

      get_gui_callback (callback, &fn, &arg);
      XEVENT (event)->event_type = misc_user_event;
      XEVENT (event)->channel = frame;
      XEVENT (event)->timestamp = GetTickCount ();
      XEVENT (event)->event.eval.function = fn;
      XEVENT (event)->event.eval.object = arg;
    }

  mswindows_enqueue_dispatch_event (event);
  /* The result of this evaluation could cause other instances to change so 
     enqueue an update callback to check this. */
  enqueue_magic_eval_event (update_widget_instances, frame);
  return Qt;
}
static inline int
pic_32bit_operand_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
#line 339 "../.././gcc/config/i386/predicates.md"
{
  if (!flag_pic)
    return 0;
  /* Rule out relocations that translate into 64bit constants.  */
  if (TARGET_64BIT && GET_CODE (op) == CONST)
    {
      op = XEXP (op, 0);
      if (GET_CODE (op) == PLUS && CONST_INT_P (XEXP (op, 1)))
	op = XEXP (op, 0);
      if (GET_CODE (op) == UNSPEC
	  && (XINT (op, 1) == UNSPEC_GOTOFF
	      || XINT (op, 1) == UNSPEC_GOT))
	return 0;
    }
  return symbolic_operand (op, mode);
}
Esempio n. 19
0
static void
collect_insn_data (rtx pattern, int *palt, int *pmax)
{
  const char *fmt;
  enum rtx_code code;
  int i, j, len;

  code = GET_CODE (pattern);
  switch (code)
    {
    case MATCH_OPERAND:
      i = n_alternatives (XSTR (pattern, 2));
      *palt = (i > *palt ? i : *palt);
      /* Fall through.  */

    case MATCH_OPERATOR:
    case MATCH_SCRATCH:
    case MATCH_PARALLEL:
    case MATCH_INSN:
      i = XINT (pattern, 0);
      if (i > *pmax)
	*pmax = i;
      break;

    default:
      break;
    }

  fmt = GET_RTX_FORMAT (code);
  len = GET_RTX_LENGTH (code);
  for (i = 0; i < len; i++)
    {
      switch (fmt[i])
	{
	case 'e': case 'u':
	  collect_insn_data (XEXP (pattern, i), palt, pmax);
	  break;

	case 'V':
	  if (XVEC (pattern, i) == NULL)
	    break;
	  /* Fall through.  */
	case 'E':
	  for (j = XVECLEN (pattern, i) - 1; j >= 0; --j)
	    collect_insn_data (XVECEXP (pattern, i, j), palt, pmax);
	  break;

	case 'i': case 'w': case '0': case 's': case 'S': case 'T':
	  break;

	default:
	  abort ();
	}
    }
}
Esempio n. 20
0
static int
gtk_get_button_size (struct frame *f, Lisp_Object window,
		     struct toolbar_button *tb, int vert, int pos)
{
  int shadow_thickness = 2;
  int size;

  if (tb->blank)
    {
      if (!NILP (tb->down_glyph))
	size = XINT (tb->down_glyph);
      else
	size = DEFAULT_TOOLBAR_BLANK_SIZE;
    }
  else
    {
      struct window *w = XWINDOW (window);
      Lisp_Object glyph = get_toolbar_button_glyph (w, tb);

      /* Unless, of course, the user has done something stupid like
         change the glyph out from under us.  Use a blank placeholder
         in that case. */
      if (NILP (glyph))
	return XINT (f->toolbar_size[pos]);

      if (vert)
	size = glyph_height (glyph, window);
      else
	size = glyph_width (glyph, window);
    }

  if (!size)
    {
      /* If the glyph doesn't have a size we'll insert a blank
         placeholder instead. */
      return XINT (f->toolbar_size[pos]);
    }

  size += shadow_thickness * 2;

  return (size);
}
static inline int
symbolic_operand_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
#line 369 "../.././gcc/config/i386/predicates.md"
{
  switch (GET_CODE (op))
    {
    case SYMBOL_REF:
    case LABEL_REF:
      return 1;

    case CONST:
      op = XEXP (op, 0);
      if (GET_CODE (op) == SYMBOL_REF
	  || GET_CODE (op) == LABEL_REF
	  || (GET_CODE (op) == UNSPEC
	      && (XINT (op, 1) == UNSPEC_GOT
		  || XINT (op, 1) == UNSPEC_GOTOFF
		  || XINT (op, 1) == UNSPEC_GOTPCREL)))
	return 1;
      if (GET_CODE (op) != PLUS
	  || !CONST_INT_P (XEXP (op, 1)))
	return 0;

      op = XEXP (op, 0);
      if (GET_CODE (op) == SYMBOL_REF
	  || GET_CODE (op) == LABEL_REF)
	return 1;
      /* Only @GOTOFF gets offsets.  */
      if (GET_CODE (op) != UNSPEC
	  || XINT (op, 1) != UNSPEC_GOTOFF)
	return 0;

      op = XVECEXP (op, 0, 0);
      if (GET_CODE (op) == SYMBOL_REF
	  || GET_CODE (op) == LABEL_REF)
	return 1;
      return 0;

    default:
      gcc_unreachable ();
    }
}
Esempio n. 22
0
static void
gen_rtx_scratch (rtx x, enum rtx_code subroutine_type)
{
  if (subroutine_type == DEFINE_PEEPHOLE2)
    {
      printf ("operand%d", XINT (x, 0));
    }
  else
    {
      printf ("gen_rtx_SCRATCH (%smode)", GET_MODE_NAME (GET_MODE (x)));
    }
}
Esempio n. 23
0
static intmax_t
module_extract_integer (emacs_env *env, emacs_value n)
{
  MODULE_FUNCTION_BEGIN (0);
  Lisp_Object l = value_to_lisp (n);
  if (! INTEGERP (l))
    {
      module_wrong_type (env, Qintegerp, l);
      return 0;
    }
  return XINT (l);
}
Esempio n. 24
0
static inline Lisp_Object
_ase_metric_trivial_ndim(Lisp_Object a, Lisp_Object b)
{
	int i, dim = XASE_CARTESIAN_DIMENSION(a);
	Lisp_Object *aos = XASE_CARTESIAN_OBJECTS(a);
	Lisp_Object *bos = XASE_CARTESIAN_OBJECTS(b);

	for (i = 0; i < dim; i++) {
		if (XINT(_ase_metric_trivial_1dim(aos[i], bos[i])) == 1)
			return make_int(1);
	}
	return Qzero;
}
Esempio n. 25
0
rtx
gen_rtx_fmt_i00 (RTX_CODE code, enum machine_mode mode,
	int arg0)
{
  rtx rt;
  rt = rtx_alloc (code);

  PUT_MODE (rt, mode);
  XINT (rt, 0) = arg0;
  X0EXP (rt, 1) = NULL_RTX;
  X0EXP (rt, 2) = NULL_RTX;

  return rt;
}
Esempio n. 26
0
File: cmds.c Progetto: satote2/xyz
static Lisp_Object
move_point (Lisp_Object n, bool forward)
{
    EMACS_INT new_point;

    if (NILP (n))
        XSETFASTINT (n, 1);

    new_point = PT + (forward ? XINT(n) : - XINT(n));

    if (new_point < BEGV)
    {
        SET_PT (BEGV);
        //xsignal0
    }
    if (new_point > ZV)
    {
        SET_PT (ZV);
        //xsignal0
    }

    SET_PT (new_point);
    return Qnil;
}
Esempio n. 27
0
rtx
gen_rtx_fmt_iuuB00is (RTX_CODE code, enum machine_mode mode,
	int arg0,
	rtx arg1,
	rtx arg2,
	struct basic_block_def *arg3,
	int arg4,
	const char *arg5)
{
  rtx rt;
  rt = rtx_alloc (code);

  PUT_MODE (rt, mode);
  XINT (rt, 0) = arg0;
  XEXP (rt, 1) = arg1;
  XEXP (rt, 2) = arg2;
  XBBDEF (rt, 3) = arg3;
  X0EXP (rt, 4) = NULL_RTX;
  X0EXP (rt, 5) = NULL_RTX;
  XINT (rt, 6) = arg4;
  XSTR (rt, 7) = arg5;

  return rt;
}
Esempio n. 28
0
/* C_FILBUF -- Fill the FIO file buffer.  Called by the GETC macro to fill
** the file buffer when the end of the buffer is reached.  The function
** value is either the first char in the refilled buffer or EOF.  If the
** file is connected to a child process the filter PRFILBUF is called to
** handle the XMIT and XFER requests.
*/
int
c_filbuf (FILE *fp)
{
	register int	nchars;
	XINT	x_fd = fileno(fp);
	XINT	(*fillbuffer)();
	XINT	PRFILBUF(), FILBUF();


	fillbuffer = ((fp->_fflags & _FIPC) ? PRFILBUF : FILBUF);

	iferr (nchars = (int) (*fillbuffer)(&x_fd)) {
	    fp->_fflags |= _FERR;
	    return (EOF);
	} else if (nchars == XEOF) {
Esempio n. 29
0
rtx
gen_rtx_fmt_ssiEEsi (RTX_CODE code, enum machine_mode mode,
	const char *arg0,
	const char *arg1,
	int arg2,
	rtvec arg3,
	rtvec arg4,
	const char *arg5,
	int arg6)
{
  rtx rt;
  rt = rtx_alloc (code);

  PUT_MODE (rt, mode);
  XSTR (rt, 0) = arg0;
  XSTR (rt, 1) = arg1;
  XINT (rt, 2) = arg2;
  XVEC (rt, 3) = arg3;
  XVEC (rt, 4) = arg4;
  XSTR (rt, 5) = arg5;
  XINT (rt, 6) = arg6;

  return rt;
}
Esempio n. 30
0
File: menu.c Progetto: ueno/emacs
/* Set up data in menu_items for a menu bar item
   whose event type is ITEM_KEY (with string ITEM_NAME)
   and whose contents come from the list of keymaps MAPS.  */
bool
parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name,
		      Lisp_Object maps)
{
  Lisp_Object length;
  EMACS_INT len;
  Lisp_Object *mapvec;
  ptrdiff_t i;
  bool top_level_items = 0;
  USE_SAFE_ALLOCA;

  length = Flength (maps);
  len = XINT (length);

  /* Convert the list MAPS into a vector MAPVEC.  */
  SAFE_ALLOCA_LISP (mapvec, len);
  for (i = 0; i < len; i++)
    {
      mapvec[i] = Fcar (maps);
      maps = Fcdr (maps);
    }

  /* Loop over the given keymaps, making a pane for each map.
     But don't make a pane that is empty--ignore that map instead.  */
  for (i = 0; i < len; i++)
    {
      if (!KEYMAPP (mapvec[i]))
	{
	  /* Here we have a command at top level in the menu bar
	     as opposed to a submenu.  */
	  top_level_items = 1;
	  push_menu_pane (Qnil, Qnil);
	  push_menu_item (item_name, Qt, item_key, mapvec[i],
			  Qnil, Qnil, Qnil, Qnil);
	}
      else
	{
	  Lisp_Object prompt;
	  prompt = Fkeymap_prompt (mapvec[i]);
	  single_keymap_panes (mapvec[i],
			       !NILP (prompt) ? prompt : item_name,
			       item_key, 10);
	}
    }

  SAFE_FREE ();
  return top_level_items;
}