예제 #1
0
파일: file.c 프로젝트: kahrs/cda
Point
inpoint(FILE *fp)
{
	Point p;
	p.x = inint(fp);
	p.y = inint(fp);
	if (showgrey) {
		p.x <<= 1;
		p.y <<= 1;
	}
	return p;
}
예제 #2
0
파일: serial_lld.c 프로젝트: Paluche/Hubert
bool_t sd_lld_interrupt_pending(void) {
  bool_t b;

  CH_IRQ_PROLOGUE();

  b =  connint(&SD1) || connint(&SD2) ||
       inint(&SD1)   || inint(&SD2)   ||
       outint(&SD1)  || outint(&SD2);

  CH_IRQ_EPILOGUE();

  return b;
}
예제 #3
0
파일: font.c 프로젝트: shattered/dmd-tc630
/*
 * sets the new point size, as dictated by the troff input
 */
newsize()
{
	extern double scalefac;
	extern int scaled;

	/* read the desired point size from troff */
	ptsz = inint();

	/*
	 * if we're in scale mode, scale the request, so it's
	 * appropriate for our needs.
	 */
	if(scaled)
		ptsz = ptsz * scalefac;

	/*
	 * Generate the name of the font file that will contain
	 * the necessary font.
	 * e.g. this generates an fname that might appear like:
	 *	R.8
	 */
	(void)sprintf(fname, "%s.%d", family[famnum], ptsz);

	/* load the font before printing again */
	newfont = 1;
}
예제 #4
0
bool sd_lld_interrupt_pending(void) {
  bool b = false;

  CH_IRQ_PROLOGUE();

#if USE_WIN32_SERIAL1
  b |= connint(&SD1) || inint(&SD1) || outint(&SD1);
#endif

#if USE_WIN32_SERIAL2
  b |= connint(&SD2) || inint(&SD2) || outint(&SD2);
#endif

  CH_IRQ_EPILOGUE();

  return b;
}
예제 #5
0
파일: font.c 프로젝트: shattered/dmd-tc630
/*
 * requests that the mounted font 'n' be used, as dictated by the
 * troff input.
 */
newfamily()
{
	/* get requested mount table entry number from troff */
	famnum = inint();
	if (famnum < 0)
		famnum = 0;

	/* (see comment in newsize, above) */
	(void)sprintf(fname, "%s.%d", family[famnum], ptsz);

	/* load the font before printing again */
	newfont = 1;
}
예제 #6
0
파일: font.c 프로젝트: shattered/dmd-tc630
/*
 * loads the font dictated by the troff input into the family
 * structure.  This doesn't do anything but make the name known.
 */
getfamily()
{
	register char *s;
	register c, i;

	/* skip over possible "ont", as in "font" */
	while ((c = inchar()) != ' ')
	    /* empty */;

	/* get mount position */
	i = inint();

	/*
	 * skip over what?  This probably exits immediately.
	 * But it gobbles one space.
	 */
	while ((c = inchar()) != ' ')
	    /* empty */;

	if (i >= NUMFAMILIES) {
#	    ifdef DEBUG
	    if (debug)
		fprintf (debug, "family number too large: %d\n", i);
#	    endif /* DEBUG */
	    /* eat up family name */
	    while ((c = inchar()) != '\n' && c != ' ')
		/* empty */;
	    return;
	}

	for (s = family[i]; (c = inchar()) != '\n' && c != ' '; *s++ = c)
	    /* empty */;

	*s = 0;

#	ifdef DEBUG
	    if (debug && verbose)
		fprintf (debug, "newfamily: is %s\n", family [i]);
#	endif /* DEBUG */
}
예제 #7
0
파일: file.c 프로젝트: kahrs/cda
Line *
inlist(FILE *fp)
{
	int c,i;
	char *s;
	Point p;
	Line *l=0;
	while (1) {
		c=fgetc(fp);
		switch (c) {
		case '\n':
			break;
		default:
			do
				c = fgetc(fp);
			while (c != '\n');
			break;
		case 'w':
		case 'l':
			l = newline(inpoint(fp),l);
			l->Q = inpoint(fp);
			break;
		case 'b':
			l = newbox(inpoint(fp),l);
			l->Q = inpoint(fp);
			break;
		case 'd':
			l = newdots(inpoint(fp),l);
			l->Q = inpoint(fp);
			break;
		case 'z':
			l = newmacro(inpoint(fp),l);
			l->Q = inpoint(fp);
			break;
		case 's':
			s = instring(fp);
			i = inint(fp);
			p = inpoint(fp);
			if (*s != 0) {
				l = newstring(p,i,l);
				setstring((String *)l,s);
			}
			break;
		case 't':		/* turn a jraw text into two graw strings */
			s = instring(fp);
			i = jtog(inint(fp));
			p = Pt(0,(showgrey ? GRID*2 : GRID));
			l = newstring(p,i,l);
			setstring((String *)l,s);
			s = instring(fp);
			inint(fp);
			p = inpoint(fp);
			if (*s != 0) {		/* gad, what a mess */
				l = newstring(add(p,l->P),i,l);
				setstring((String *)l,s);
				l->next->P = p;
			}
			else			/* watch carefully */
				l->P = p;
			break;
		case 'r':
			l = newref(intern(instring(fp)),l);
			break;
		case 'i':
			s = intern(instring(fp));
			l = newinst(inpoint(fp),s,l);
			break;
		case 'm':
			nest = 1;
			l = newmaster(intern(instring(fp)),l);
			((Master *)l)->dl = inlist(fp);
			break;
		case 'e':
			if (nest == 0)
				dprint("found end of no macro\n");
			nest = 0;
		case -1:
			return l;
		}
	}
}
예제 #8
0
파일: MAXLIB.C 프로젝트: StevenKTurner/IPO
PIXEL inpix (PIXEL p, char *name)
{
	inint (&(p->row), name);
	inint (&(p->col), name);
	return p;
}
예제 #9
0
void JSDDateTime::NormDate()
{
  const double epsilon = 1.0e-12 ;

  int k, iu, iv, iw ;
  double u, v, w, ru, rv, rw ;


  w = _day0hTU.get_julianDate() - 0.5 ;
  if (fabs (w - fnint (w)) < epsilon)
  {
    iw = (int)inint(w) ;
    rw = 0.0 ;
  }
  else
  {
    iw = (int)w ;
    rw = w - (double)iw ;
    if ((iw < 0) && (rw != 0.0))
    {
    iw = iw - 1 ;
    rw = rw + 1.0 ;
    }
  }

  v = _second + rw * CivilDateTime::JOURCIVIL_LENGTH ;
  if (fabs(v - fnint (v)) < epsilon)
  {
    iv = (int)inint (v) ;
    rv = 0.0 ;
  }
  else
  {
    iv = (int)v ;
    rv = v - (double)iv ;
    if ((iv < 0) && (rv != 0.0))
    {
      iv = iv - 1 ;
      rv = rv + 1.0 ;
    }
  }

  u  = _decimal + rv ;
  iu = (int)u ;
  ru = u - (double)iu ;
  if ((iu < 0) && (ru != 0.0))
  {
    iu = iu - 1 ;
    ru = ru + 1.0 ;
  }

  iv = iv + iu ;
  k  = iv / ((int)inint(CivilDateTime::JOURCIVIL_LENGTH)) ;
  iw = iw + k ;
  iv = iv - k * ((int)inint(CivilDateTime::JOURCIVIL_LENGTH)) ;
  if (iv < 0)
  {
    iw = iw - 1 ;
    iv = iv + (int)inint(CivilDateTime::JOURCIVIL_LENGTH) ;
  }

  _decimal    = ru ;
  _second  = (double)iv ;
  _day0hTU = (double)iw + 0.5 ;
}