예제 #1
0
파일: draw.c 프로젝트: kahrs/cda
void
main(int argc, char **argv)
{
	int n;
	int dopts = 0;
	int dovb = 0;
	int dosigs = 0;
	extern int optind;

	chname = 0;
	while((n = getopt(argc, argv, "bfkprstv")) != -1)
		switch(n)
		{
		case 'k':	chname = 1; break;
		case 't':	chname = -1; break;
		case 'p':	dopts = 1; break;
		case 'v':	dovb = 1; break;
		case 'b':	boxed = 1; break;
		case 'r':	ruled = 0; break;
		case 'f':	framed = 1; break;
		case 's':	dosigs = 1; break;
		case '?':	break;
		}
	fizzinit();
	f_init(&b);
	if(optind == argc)
		argv[--optind] = "/dev/stdin";
	for(; optind < argc; optind++)
		if(n = f_crack(argv[optind], &b)){
			fprint(1, "%s: %d errors\n", *argv, n);
			exit(1);
		}
	fizzplane(&b);
	if(n = fizzplace()){
		/* complain but don't exit */
		fprint(2, "%d chips unplaced\n", n);
	}
	if(fizzprewrap())
		dosigs = 0;
	draw(dopts, dovb);
	if(dosigs){
		extern Signal *maxsig;
		extern void tsp(Signal *);

		symtraverse(S_SIGNAL, netlen);
		if(maxsig && ((maxsig->type & VSIG) != VSIG) && (maxsig->n >= MAXNET)){
			fprint(1, "net %s is too big (%d>=%d)\n", maxsig->name,
				maxsig->n, MAXNET);
			exits("bignet");
		}
		wwires = 0;
		wwraplen = 0;
		symtraverse(S_SIGNAL, tsp);
		symtraverse(S_SIGNAL, drawsig);
	}
	exit(0);
}
예제 #2
0
int32 wsfe (cilist *a, unit **fu, int f90sw)
#endif
{
   int32             n;
   unit             *ftnunit;

   if (!f77init)
      f_init ();

   if (n = c_sfe (a, fu))
      return n;

   ftnunit = *fu;
   if (ftnunit->uacc == DIRECT)
      errret(a->cierr, 171, "sequential write");

   ftnunit->f77cursor = ftnunit->f77recpos = ftnunit->f77recend = 0;
   ftnunit->f77cplus = 0;
   ftnunit->f77scale = 0;
#ifdef I90
   ftnunit->f90sw = f90sw;
   if (!f90sw) ftnunit->f77recpos = ftnunit->f77recend = 0;
   /* in f90 mode we initialize f77recpos and f77recend in the caller, dont
      know why. */
#else
   ftnunit->f77recpos = ftnunit->f77recend = 0;
#endif
   ftnunit->f77errlist.cierr = a->cierr;
   ftnunit->f77errlist.ciend = a->ciend;
   ftnunit->f77errlist.cieor = a->cieor;
   ftnunit->f77errlist.cisize = a->cisize;
   ftnunit->f77errlist.iciunit = 0; 
   ftnunit->f77fmtbuf = a->cifmt;
   if (ftnunit->uacc == KEYED) {
      ftnunit->f77idxlist.cimatch = a->cimatch;
      ftnunit->f77idxlist.cikeytype = a->cikeytype;
      ftnunit->f77idxlist.cikeyval.cicharval = a->cikeyval.cicharval;
      ftnunit->f77idxlist.cikeyid = a->cikeyid;
      ftnunit->f77idxlist.cinml = a->cinml;
      ftnunit->f77idxlist.cikeyvallen = a->cikeyvallen;
   }
   if (pars_f (ftnunit, ftnunit->f77fmtbuf) < 0)
      errret(a->cierr, 100, "startio");
   ftnunit->f77putn = x_putc;
   ftnunit->f77ungetn = x_ungetc;
   ftnunit->f77doed = w_ed;
   ftnunit->f77doned = w_ned;
   ftnunit->f77doend = xw_end;
   ftnunit->f77dorevert = xw_rev;
   ftnunit->f77donewrec = x_wSL;
   fmt_bg (ftnunit);
   ftnunit->f77cblank = ftnunit->ublnk;
   if (ftnunit->url > ftnunit->f77fio_size)
       check_buflen( ftnunit, ftnunit->url > FIO_ALLOC ? ftnunit->url : FIO_ALLOC );
   return 0;
}
예제 #3
0
/*
 * NAME:	vol->init()
 * DESCRIPTION:	initialize volume structure
 */
void v_init(hfsvol *vol, int flags)
{
    btree *ext = &vol->ext;
    btree *cat = &vol->cat;

    vol->priv       = 0;
    vol->flags      = flags;

    vol->pnum       = -1;
    vol->vstart     = 0;
    vol->vlen       = 0;
    vol->lpa        = 0;

    vol->cache      = 0;

    vol->vbm        = 0;
    vol->cwd        = HFS_CNID_ROOTDIR;

    f_init(&ext->f, vol, HFS_CNID_EXT, "extents overflow");

    ext->map        = 0;
    ext->mapsz      = 0;
    ext->flags      = 0;

    ext->keyunpack  = (keyunpackfunc)  r_unpackextkey;
    ext->keycompare = (keycomparefunc) r_compareextkeys;

    f_init(&cat->f, vol, HFS_CNID_CAT, "catalog");

    cat->map        = 0;
    cat->mapsz      = 0;
    cat->flags      = 0;

    cat->keyunpack  = (keyunpackfunc)  r_unpackcatkey;
    cat->keycompare = (keycomparefunc) r_comparecatkeys;

    vol->refs       = 0;
    vol->files      = 0;
    vol->dirs       = 0;

    vol->prev       = 0;
    vol->next       = 0;
}
예제 #4
0
// address: 8048824
int main(int argc, char *argv[], char *envp[]) {
    __size32 local0; 		// m[esp - 40]

    f_setarg();
    f_setsig();
    f_init();
    atexit();
    MAIN__(local0);
    exit(0);
    return;
}
예제 #5
0
파일: 1003_2.cpp 프로젝트: hphp/Algorithm
int routing(int a,int b)
{
	f_init();
	LCA_dfs(root[belong[a]],0);
	area=(int)sqrt(1.0*Ecnt);
	anum=Ecnt/area+(Ecnt%area!=0);
	int pa=R[a];
	int pb=R[b];
	int minner=pa<pb?pa:pb;
	int maxxer=pa>pb?pa:pb;
	return LCA_get(minner,maxxer,belong[a]);
}
예제 #6
0
GSN_STATUS
App_FsInit(APP_FS_T *pFsCtx)
{
	UINT32 memsize, memsize1;
	INT32 rc;
	UINT8 *pFsBuff, *pFsBuff1;
	
	pPartn_0_Info = &pFsCtx->partn[APP_FS_PARTN_CONFIG];
	pPartn_1_Info = &pFsCtx->partn[APP_FS_PARTN_WEB_PAGES];

	f_init();
	f_enterFS();
    App_ConfigPartnInfoSet(pFsCtx);
	/*Initialise Partition 0 (used cof storing configuration)*/
	memsize = fs_getmem_flashdrive(fs_phy_nor_n25q_32mb_3v_65nm_0);
	pFsBuff = gsn_malloc(memsize);
    if(pFsBuff != NULL)
    {
		rc = f_mountdrive(0, pFsBuff, memsize, (void *)fs_mount_flashdrive,
							fs_phy_nor_n25q_32mb_3v_65nm_0);
		if(rc == F_ERR_NOTFORMATTED)
		{
			f_format(0);
		}
	}
	else
	{
		while(1);
	}
	
#ifdef ADK_PROV_ENABLE/* Initialise Appropriate Web Pages Partition */

	App_WebPagesPartnInfoSet(pFsCtx);

	memsize1 = fs_getmem_flashdrive(fs_phy_nor_n25q_32mb_3v_65nm_1);
	pFsBuff1 = gsn_malloc(memsize1);
	if(pFsBuff != NULL)
	{
		rc = f_mountdrive(1, pFsBuff1, memsize1, (void *)fs_mount_flashdrive,
				fs_phy_nor_n25q_32mb_3v_65nm_1);
        if(rc == F_ERR_NOTFORMATTED)
		{
			return GSN_FAILURE;
		}
	}
	else
	{
		while(1);
	}

#endif	
    return GSN_SUCCESS;
}
예제 #7
0
파일: sue.c 프로젝트: Scarletts/LiteBSD
int
s_wsue(cilist *a)
{
	int n;
	if(!init) f_init();
	if((n=c_sue(a,WRITE))) return(n);
	reading=0;
	reclen=0;
	if(!curunit->uwrt) nowwriting(curunit);
	recloc=ftell(cf);
	fseek(cf,(long)sizeof(int),1);
	return(0);
}
예제 #8
0
파일: sue.c 프로젝트: Sciumo/f2c
integer s_wsue(cilist *a)
{
	int n;
	if(!f__init) f_init();
	if(n=c_sue(a)) return(n);
	f__reading=0;
	f__reclen=0;
	if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
		err(a->cierr, errno, "write start");
	f__recloc=FTELL(f__cf);
	FSEEK(f__cf,(OFF_T)sizeof(uiolen),SEEK_CUR);
	return(0);
}
예제 #9
0
파일: f_param.c 프로젝트: blynn/pbc
int pbc_param_init_f(pbc_param_ptr par, struct symtab_s *tab) {
  f_init(par);
  f_param_ptr p = par->data;

  int err = 0;
  err += lookup_mpz(p->q, tab, "q");
  err += lookup_mpz(p->r, tab, "r");
  err += lookup_mpz(p->b, tab, "b");
  err += lookup_mpz(p->beta, tab, "beta");
  err += lookup_mpz(p->alpha0, tab, "alpha0");
  err += lookup_mpz(p->alpha1, tab, "alpha1");
  return err;
}
예제 #10
0
파일: sue.c 프로젝트: timburrow/ovj3
integer s_wsue(cilist *a)
#endif
{
	int n;
	if(!f__init) f_init();
	if(n=c_sue(a)) return(n);
	f__reading=0;
	f__reclen=0;
	if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
		err(a->cierr, errno, "write start");
	f__recloc=ftell(f__cf);
	(void) fseek(f__cf,(long)sizeof(uiolen),SEEK_CUR);
	return(0);
}
예제 #11
0
int main(int argc, char ** argv)
{
#if G77
#pragma message "We assume that the default fortran compiler is g77" 
  f_setarg(argc, argv);
  f_setsig();
  f_init();
#endif
#if GFORT
#pragma message "We assume that the default fortran compiler is gfortran" 
  _gfortran_set_args (argc, argv);
#endif
  MAIN__();
  return 0; /* For compilers that complain of missing return values; */
}
예제 #12
0
파일: rsne.c 프로젝트: barak/f2c-1
static void nl_init(void)
{
	const char *s;
	int c;

	if(!f__init)
		f_init();
	for(s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; c = *s++; )
		Alpha[c]
		= Alphanum[c]
		= Alpha[c + 'a' - 'A']
		= Alphanum[c + 'a' - 'A']
		= c;
	for(s = "0123456789_"; c = *s++; )
		Alphanum[c] = c;
}
예제 #13
0
파일: rsfe.c 프로젝트: troore/scale
integer
s_rsfe(cilist *a) /* start */
{
  int n;

  if (!f__init)
    f_init();

  if (n = c_sfe(a))
    return n;

  f__reading    = 1;
  f__sequential = 1;
  f__formatted  = 1;
  f__external   = 1;
  f__elist      = a;
  f__cursor     = 0;
  f__recpos     = 0;
  f__scale      = 0;
  f__fmtbuf     = a->cifmt;
  f__curunit    = &f__units[a->ciunit];
  f__cf         = f__curunit->ufd;

  if (pars_f(f__fmtbuf)<0)
    return err(a->cierr, 100, "startio");

  f__getn  = x_getc;
  f__doed  = rd_ed;
  f__doned = rd_ned;

  fmt_bg();

  f__doend    = x_endp;
  f__donewrec = xrd_SL;
  f__dorevert = x_rev;
  f__cblank   = f__curunit->ublnk;
  f__cplus    = 0;

  if (f__curunit->uwrt && f__nowreading(f__curunit))
    return err(a->cierr, errno, "read start");

  if (f__curunit->uend)
    return err(f__elist->ciend, (EOF), "read start");

  return 0;
}
예제 #14
0
파일: main.c 프로젝트: VargMon/dd-wrt
int
main (int argc, char **argv)
{
  f_setarg (argc, argv);
  f_setsig ();
  f_init ();
#ifndef NO_ONEXIT
  ONEXIT (f_exit);
#endif
  MAIN__ ();
#ifdef NO_ONEXIT
  f_exit ();
#endif
  exit (0);			/* exit(0) rather than return(0) to bypass Cray bug */
  return 0;			/* For compilers that complain of missing return values; */
  /* others will complain that this is unreachable code. */
}
예제 #15
0
파일: wsle.c 프로젝트: radarsat1/siconos
integer s_wsle(cilist *a)
#endif
{
    int n;
    if (!f__init) f_init();
    if (n = c_le(a)) return(n);
    f__reading = 0;
    f__external = 1;
    f__formatted = 1;
    f__putn = t_putc;
    f__lioproc = l_write;
    L_len = LINE;
    f__donewrec = x_wSL;
    if (f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
        err(a->cierr, errno, "list output start");
    return(0);
}
예제 #16
0
파일: lread.c 프로젝트: cran/rioja
c_le(cilist *a)
#endif
{
	if(!f__init)
		f_init();
	f__fmtbuf="list io";
	f__curunit = &f__units[a->ciunit];
	if(a->ciunit>=MXUNIT || a->ciunit<0)
		err(a->cierr,101,"stler");
	f__scale=f__recpos=0;
	f__elist=a;
	if(f__curunit->ufd==NULL && fk_open(SEQ,FMT,a->ciunit))
		err(a->cierr,102,"lio");
	f__cf=f__curunit->ufd;
	if(!f__curunit->ufmt) err(a->cierr,103,"lio")
	return(0);
}
예제 #17
0
파일: pkgplot.c 프로젝트: kahrs/cda
void
main(int argc, char **argv)
{
	Board b;
	int n;
	char *fname;

	ARGBEGIN{
	case 'b':
		++bflag;	/* show bottom view */
		break;
	case 'g':
		++gflag;	/* show 100 mil grid */
		break;
	case 'p':
		if(npkg < NPKG)
			pkgnames[npkg++] = ARGF();
		break;
	default:
		fprint(2, "usage: %s [-b] [-p name] [files...]\n", argv0);
		exits("usage");
	}ARGEND
	f_init(&b);
#ifdef PLAN9
	if(*argv)
		fname = *argv++;
	else
		fname = "/fd/0";
#endif
#ifndef PLAN9
	if(*argv)
		fname = *argv++;
	else
		fname = "/dev/stdin";
#endif
	do{
		if(n = f_crack(fname, &b)){
			fprint(2, "%s: %d errors\n", fname, n);
			exits("errors");
		}
	}while(fname = *argv++);	/* assign = */
	symtraverse(S_PACKAGE, picpr);
	exits(0);
}
bool Audio::Init(const std::string& user_data_parent_path)
{
//#ifdef _DEBUG
//	instance_audio_ = ::LoadLibraryW(kSdkAudioDll_d.c_str());
//#else
	instance_audio_ = ::LoadLibraryW(kSdkAudioDll.c_str());
//#endif
	assert(instance_audio_);
	if (instance_audio_ == NULL)
		return false;

	if (instance_audio_)
	{
		nim_audio_init_module f_init = Function<nim_audio_init_module>("nim_audio_init_module");
		bool ret = f_init(user_data_parent_path.c_str());
		return ret;
	}
	return false;
}
예제 #19
0
c_due(cilist *a)
#endif
{
	if(!f__init) f_init();
	if(a->ciunit>=MXUNIT || a->ciunit<0)
		err(a->cierr,101,"startio");
	f__sequential=f__formatted=f__recpos=0;
	f__external=1;
	f__curunit = &f__units[a->ciunit];
	f__elist=a;
	if(f__curunit->ufd==NULL && fk_open(DIR,UNF,a->ciunit) ) err(a->cierr,104,"due");
	f__cf=f__curunit->ufd;
	if(f__curunit->ufmt) err(a->cierr,102,"cdue")
	if(!f__curunit->useek) err(a->cierr,104,"cdue")
	if(f__curunit->ufd==NULL) err(a->cierr,114,"cdue")
	(void) fseek(f__cf,(long)(a->cirec-1)*f__curunit->url,SEEK_SET);
	f__curunit->uend = 0;
	return(0);
}
예제 #20
0
파일: dfe.c 프로젝트: parkerclayton/python
integer s_rdfe(cilist *a)
#endif
{
    int n;
    if(!f__init) f_init();
    f__reading=1;
    if((n=c_dfe(a))) return(n);
    if(f__curunit->uwrt && f__nowreading(f__curunit))
        err(a->cierr,errno,"read start");
    f__getn = y_getc;
    f__doed = rd_ed;
    f__doned = rd_ned;
    f__dorevert = f__donewrec = y_err;
    f__doend = y_rsk;
    if(pars_f(f__fmtbuf)<0)
        err(a->cierr,100,"read start");
    fmt_bg();
    return(0);
}
예제 #21
0
파일: sue.c 프로젝트: sharugupta/OpenUH
int
wsue (cilist64 *a, unit **fu)
{
    int             n;
    unit *ftnunit;

    if (!f77init)
        f_init ();
    if (n = c_sue (a, fu))
        return n;
    ftnunit = *fu;
    (void) f77nowwriting( ftnunit );
    ftnunit->f77reclen = 0;
    /*
    if (ftnunit->f77fio_buf == NULL)
       ftnunit->f77fio_buf = malloc (ftnunit->f77fio_size = FIO_ALLOC);
    */
    return (0);
}
예제 #22
0
파일: due.c 프로젝트: Scarletts/LiteBSD
int
c_due(cilist *a, int flag)
{
	if(!init) f_init();
	if(a->ciunit>=MXUNIT || a->ciunit<0)
		err(a->cierr,101,"startio");
	recpos=sequential=formatted=0;
	external=1;
	curunit = &units[a->ciunit];
	elist=a;
	if(curunit->ufd==NULL && fk_open(flag,DIR,UNF,a->ciunit) ) err(a->cierr,104,"due");
	cf=curunit->ufd;
	if(curunit->ufmt) err(a->cierr,102,"cdue")
	if(!curunit->useek) err(a->cierr,104,"cdue")
	if(curunit->ufd==NULL) err(a->cierr,114,"cdue")
	fseek(cf,(long)(a->cirec-1)*curunit->url,0);
	curunit->uend = 0;
	return(0);
}
예제 #23
0
파일: dfe.c 프로젝트: parkerclayton/python
integer s_wdfe(cilist *a)
#endif
{
    int n;
    if(!f__init) f_init();
    f__reading=0;
    if((n=c_dfe(a))) return(n);
    if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
        err(a->cierr,errno,"startwrt");
    f__putn = x_putc;
    f__doed = w_ed;
    f__doned= w_ned;
    f__dorevert = y_err;
    f__donewrec = y_newrec;
    f__doend = y_rev;
    if(pars_f(f__fmtbuf)<0)
        err(a->cierr,100,"startwrt");
    fmt_bg();
    return(0);
}
예제 #24
0
파일: sue.c 프로젝트: Scarletts/LiteBSD
int
s_rsue(cilist *a)
{
	int n;
	if(!init) f_init();
	if((n=c_sue(a,READ))) return(n);
	reading=1;
	recpos=0;
	if(curunit->uwrt) nowreading(curunit);
	if(fread(&reclen,sizeof(int),1,cf)
		!= 1)
	{	if(feof(cf))
		{	curunit->uend = 1;
			err(a->ciend, EOF, "start");
		}
		clearerr(cf);
		err(a->cierr, errno, "start");
	}
	return(0);
}
예제 #25
0
파일: sue.c 프로젝트: Sciumo/f2c
integer s_rsue(cilist *a)
{
	int n;
	if(!f__init) f_init();
	f__reading=1;
	if(n=c_sue(a)) return(n);
	f__recpos=0;
	if(f__curunit->uwrt && f__nowreading(f__curunit))
		err(a->cierr, errno, "read start");
	if(fread((char *)&f__reclen,sizeof(uiolen),1,f__cf)
		!= 1)
	{	if(feof(f__cf))
		{	f__curunit->uend = 1;
			err(a->ciend, EOF, "start");
		}
		clearerr(f__cf);
		err(a->cierr, errno, "start");
	}
	return(0);
}
예제 #26
0
파일: lread.c 프로젝트: angelhunt/SNP
integer s_rsle(cilist *a)
#endif
{
	int n;

	if(!f__init) f_init();
	if(n=c_le(a)) return(n);
	f__reading=1;
	f__external=1;
	f__formatted=1;
	f__lioproc = l_read;
	f__lquit = 0;
	f__lcount = 0;
	l_eof = 0;
	if(f__curunit->uwrt && f__nowreading(f__curunit))
		err(a->cierr,errno,"read start");
	l_getc = t_getc;
	l_ungetc = un_getc;
	f__doend = xrd_SL;
	return(0);
}
예제 #27
0
파일: util.c 프로젝트: xyuan/Path64
unit *
find_luno(ftnint luno)
{
   register int    i;
   register unit  *a;
   static unit 	*f77curunit = 0;
   unit	*ftnunit;

   if (!f77init)
      f_init ();
   if (f77curunit) {
       ftnunit = f77curunit;
       if (ftnunit->luno == luno && ftnunit->uconn > 0)
          return (ftnunit);	/* has already been mapped */
   }
   for (i = 0, a = f77units; i < space_assigned; i++, a++)	
      /* Find unit or empty one */
      if (a->luno == luno)
	 return (a);
   return (NULL);
}
예제 #28
0
int main(int argc,char **argv)
{
  umask(022);

  fdstartdir = open_read(".");
  if (fdstartdir == -1)
    strerr_die2sys(111,FATAL,"unable to switch to current directory: ");
  coe(fdstartdir);

  sig_block(sig_term);
  sig_block(sig_alarm);
  sig_catch(sig_term,exitasap);
  sig_catch(sig_alarm,forcerotate);

  ++argv;
  f_init(argv);
  c_init(argv);
  doit(argv);
  c_quit();
  _exit(0);
}
예제 #29
0
void Screen::init()
{
	if (!isInit)
	{
		std::vector<std::shared_ptr<Entity>> entityCollector;

		// f_init does everything it needs to init the screen 
		// And pushes created entities into this fancy vector 
		f_init(entityCollector);

		// After all we must track those entities
		// Engine::addEntity() does this work for us (calls trackEntities on this screen)
		for (auto const sp_entity : entityCollector)
			Engine::getInstance()->addEntity(name, sp_entity);

		state = ScreenState::ACTIVE;
		isInit = true;

		LOG(DEBUG) << "Screen " << name << " has been initialized";
	}
}
예제 #30
0
파일: 1003_2.cpp 프로젝트: hphp/Algorithm
void LCA_deal(int curpart)
{
	f_init();
	LCA_dfs(root[curpart],0);
/*	for(int i=0;i<Ecnt;i++)
		printf("%d ",E[i]);
	printf("e above\n");
	for(int j=1;j<=n;j++)
		printf("%d ",R[j]);
		printf("r above\n");*/
	area=(int)sqrt(1.0*Ecnt);
	anum=Ecnt/area+(Ecnt%area!=0);
	for(int i=0;i<anum;i++)
	{
		Rmq_init();
		int last=i*area+area-1;
		while(last>=Ecnt)
			last--;
		//printf("%d\n",last);
		rmq[curpart][i]=Rmq(i,0,last%area);
	//	printf("rmq%d\n",rmq[curpart][i]);
	}
}