Пример #1
0
int scan(Scanner *s){
	unsigned char *cursor = s->cur;
	int ret=0;
std:
	s->tok = cursor;
/*!re2c
any	= [\000-\377];
O	= [0-7];
D	= [0-9];
L	= [a-zA-Z_];
H	= [a-fA-F0-9];
E	= [Ee] [+-]? D+;
FS	= [fFlL];
IS	= [uUlL]*;
ESC	= [\\] ([abfnrtv?'"\\] | "x" H+ | O+);
EXPR	= [0-9a-zA-Z_];
PATH	= [0-9a-zA-Z_] | "." | "/" |  "-";
CONNSTR	= [0-9a-zA-Z_] | (".") | ("/") | (":") | ("@");
IP	= [0-7] | (".") | (":")? ;
NL	= "\r"? "\n" ;
TAB	= "\t";
*/

/*!re2c
	
	"/*"			{ goto comment; }
	"#"			{ goto unixcomment; }

	"daemon"		{
						s->parm = 1;
						goto _bool;
					}
	
	"logfile"		{
						s->parm = 2;
						goto param;
					}

	"log_level"		{
						s->parm = 5;
						goto lparam;
					}
	"port"		{
						s->parm = 3;
						goto dparam;
					}

	"http"		{
						s->parm = 6;
						goto ip_param;
					}
	"amqp"		{
						s->parm = 4;
						goto param;
					}

	"pidfile"		{
						s->parm = 7;
						goto param;
					}


	
	[\r\v\f]+		{ RET(8912); goto std; }

	";" 			{  goto std; }      
	" " 			{  goto std; }
 	"\t"	 		{ goto std;  }   

	NL
	    {
		if(cursor == s->eof) RET(EOI);
		s->pos = cursor; s->line++;
		goto std;
	    }

	  any
	    {
		printf("unexpected character: %c line %d \n", *s->tok, s->line);
		goto std;
	    }
*/
//s->tok = cursor; s->parm =3; goto param; 
//(PATH)*";"		{ RET(2001); }
//
	


param:
 s->ptok=cursor;
/*!re2c 

	(PATH)*  ";"	{ RET(303); } 	
	(CONNSTR)* ";"	{ RET(301 ); }
	(EXPR)*  ";"	{ RET(302); } 	

	any		{  goto param; }

*/

_bool: 
 s->ptok=cursor;
/*!re2c 
	"on"   { RET( 101); } 
	"off"  { RET( 102); } 
	"1"	{ RET(101); } 
	"0"  { RET(102); } 

	 ";"	{ goto std; } 	

	any		{  goto _bool; }

*/

lparam: 
 s->ptok=cursor;
/*!re2c 
	"error"    { RET(1); } 
	"content"  { RET(2); } 
	"alert"    { RET(3); } 
	"warning"  { RET(4); } 
	"notice"   { RET(5); } 
	"debug"    { RET(6); } 

	 ";"	{ goto std; } 	

	any		{  goto lparam; }

*/

ip_param:
 s->ptok=cursor;
 ret =  100;
/*!re2c 
	(IP)* ";"	{ RET(ret); }
	any		{  goto ip_param; }
*/

dparam:
 s->ptok=cursor;
 ret =  200;
/*!re2c 
	(D)* ";"	{ RET(ret); }
	any		{  goto dparam; }
*/

unixcomment:	
/*!re2c
	NL			{  s->line++; goto std; }
	any			{ goto unixcomment; }
*/

comment:
/*!re2c
	"*/"			{ goto std; }

	"\n"
	    {
		if(cursor == s->eof) RET(EOI);
		s->tok = s->pos = cursor; s->line++;
		goto comment;
	    }
        any	{ goto comment; }
*/
}
Пример #2
0
/* \brief import MikuMikuDance PMD file */
int _glhckImportPMD(_glhckObject *object, const char *file, const glhckImportModelParameters *params,
      glhckGeometryIndexType itype, glhckGeometryVertexType vtype)
{
   FILE *f;
   char *texturePath;
   mmd_data *mmd = NULL;
   glhckAtlas *atlas = NULL;
   glhckMaterial *material = NULL;
   glhckTexture *texture = NULL, **textureList = NULL;
   glhckImportVertexData *vertexData = NULL;
   glhckImportIndexData *indices = NULL, *stripIndices = NULL;
   unsigned int geometryType = GLHCK_TRIANGLE_STRIP;
   unsigned int i, i2, ix, start, numFaces, numIndices = 0;
   CALL(0, "%p, %s, %p", object, file, params);

   if (!(f = fopen(file, "rb")))
      goto read_fail;

   if (!(mmd = mmd_new(f)))
      goto mmd_no_memory;

   if (mmd_read_header(mmd) != 0)
      goto mmd_import_fail;

   if (mmd_read_vertex_data(mmd) != 0)
      goto mmd_import_fail;

   if (mmd_read_index_data(mmd) != 0)
      goto mmd_import_fail;

   if (mmd_read_material_data(mmd) != 0)
      goto mmd_import_fail;

   /* close file */
   NULLDO(fclose, f);

   if (mmd->header.name) {
      DEBUG(GLHCK_DBG_CRAP, "%s\n", mmd->header.name);
   }
   if (mmd->header.comment) printf("%s\n\n", mmd->header.comment);

   if (!(vertexData = _glhckCalloc(mmd->num_vertices, sizeof(glhckImportVertexData))))
      goto mmd_no_memory;

   if (!(indices = _glhckMalloc(mmd->num_indices * sizeof(unsigned int))))
      goto mmd_no_memory;

   if (!(textureList = _glhckCalloc(mmd->num_materials, sizeof(_glhckTexture*))))
      goto mmd_no_memory;

   if (!(atlas = glhckAtlasNew()))
      goto mmd_no_memory;

   /* add all textures to atlas packer */
   for (i = 0; i < mmd->num_materials; ++i) {
      if (!mmd->materials[i].texture) continue;

      if (!(texturePath = _glhckImportTexturePath(mmd->materials[i].texture, file)))
         continue;

      if ((texture = glhckTextureNewFromFile(texturePath, NULL, NULL))) {
         glhckAtlasInsertTexture(atlas, texture);
         glhckTextureFree(texture);
         textureList[i] = texture;
      }

      _glhckFree(texturePath);
   }

   for (i = 0; i < mmd->num_materials && !textureList[i]; ++i);
   if (i >= mmd->num_materials) {
      /* no textures found */
      NULLDO(glhckAtlasFree, atlas);
      NULLDO(_glhckFree, textureList);
   } else {
      /* pack textures */
      if (glhckAtlasPack(atlas, GLHCK_RGBA, 1, 0, glhckTextureDefaultParameters()) != RETURN_OK)
         goto fail;
   }

   /* assign data */
   for (i = 0, start = 0; i < mmd->num_materials; ++i, start += numFaces) {
      numFaces = mmd->materials[i].face;
      for (i2 = start; i2 < start + numFaces; ++i2) {
         ix = mmd->indices[i2];

         /* vertices */
         vertexData[ix].vertex.x = mmd->vertices[ix*3+0];
         vertexData[ix].vertex.y = mmd->vertices[ix*3+1];
         vertexData[ix].vertex.z = mmd->vertices[ix*3+2];

         /* normals */
         vertexData[ix].normal.x = mmd->normals[ix*3+0];
         vertexData[ix].normal.y = mmd->normals[ix*3+1];
         vertexData[ix].normal.z = mmd->normals[ix*3+2];

         /* texture coords */
         vertexData[ix].coord.x = mmd->coords[ix*2+0];
         vertexData[ix].coord.y = mmd->coords[ix*2+1] * -1;

         /* fix coords */
         if (vertexData[ix].coord.x < 0.0f)
            vertexData[ix].coord.x += 1.0f;
         if (vertexData[ix].coord.y < 0.0f)
            vertexData[ix].coord.y += 1.0f;

         /* if there is packed texture */
         if (atlas && textureList[i]) {
            kmVec2 coord;
            coord.x = vertexData[ix].coord.x;
            coord.y = vertexData[ix].coord.y;
            glhckAtlasTransformCoordinates(atlas, textureList[i], &coord, &coord);
            vertexData[ix].coord.x = coord.x;
            vertexData[ix].coord.y = coord.y;
         }

         indices[i2] = ix;
      }
   }

   if (atlas) {
      if (!(material = glhckMaterialNew(glhckAtlasGetTexture(atlas))))
         goto mmd_no_memory;

      glhckObjectMaterial(object, material);
      NULLDO(glhckMaterialFree, material);
      NULLDO(glhckAtlasFree, atlas);
      NULLDO(_glhckFree, textureList);
   }

   /* triangle strip geometry */
   if (!(stripIndices = _glhckTriStrip(indices, mmd->num_indices, &numIndices))) {
      /* failed, use non stripped geometry */
      geometryType   = GLHCK_TRIANGLES;
      numIndices    = mmd->num_indices;
      stripIndices  = indices;
   } else NULLDO(_glhckFree, indices);

   /* set geometry */
   glhckObjectInsertIndices(object, itype, stripIndices, numIndices);
   glhckObjectInsertVertices(object, vtype, vertexData, mmd->num_vertices);
   object->geometry->type = geometryType;

   /* finish */
   NULLDO(_glhckFree, vertexData);
   NULLDO(_glhckFree, stripIndices);
   NULLDO(mmd_free, mmd);

   RET(0, "%d", RETURN_OK);
   return RETURN_OK;

read_fail:
   DEBUG(GLHCK_DBG_ERROR, "Failed to open: %s", file);
   goto fail;
mmd_import_fail:
   DEBUG(GLHCK_DBG_ERROR, "MMD importing failed.");
   goto fail;
mmd_no_memory:
   DEBUG(GLHCK_DBG_ERROR, "MMD not enough memory.");
fail:
   IFDO(fclose, f);
   IFDO(glhckAtlasFree, atlas);
   IFDO(mmd_free, mmd);
   IFDO(_glhckFree, textureList);
   IFDO(_glhckFree, vertexData);
   IFDO(_glhckFree, indices);
   IFDO(_glhckFree, stripIndices);
   RET(0, "%d", RETURN_FAIL);
   return RETURN_FAIL;
}
Пример #3
0
/*
 * lexescape - parse an ARE backslash escape (backslash already eaten)
 * Note slightly nonstandard use of the CCLASS type code.
 */
static int						/* not actually used, but convenient for RETV */
lexescape(struct vars * v)
{
	chr			c;
	static chr	alert[] = {
		CHR('a'), CHR('l'), CHR('e'), CHR('r'), CHR('t')
	};
	static chr	esc[] = {
		CHR('E'), CHR('S'), CHR('C')
	};
	const chr  *save;

	assert(v->cflags & REG_ADVF);

	assert(!ATEOS());
	c = *v->now++;
	if (!iscalnum(c))
		RETV(PLAIN, c);

	NOTE(REG_UNONPOSIX);
	switch (c)
	{
		case CHR('a'):
			RETV(PLAIN, chrnamed(v, alert, ENDOF(alert), CHR('\007')));
			break;
		case CHR('A'):
			RETV(SBEGIN, 0);
			break;
		case CHR('b'):
			RETV(PLAIN, CHR('\b'));
			break;
		case CHR('B'):
			RETV(PLAIN, CHR('\\'));
			break;
		case CHR('c'):
			NOTE(REG_UUNPORT);
			if (ATEOS())
				FAILW(REG_EESCAPE);
			RETV(PLAIN, (chr) (*v->now++ & 037));
			break;
		case CHR('d'):
			NOTE(REG_ULOCALE);
			RETV(CCLASS, 'd');
			break;
		case CHR('D'):
			NOTE(REG_ULOCALE);
			RETV(CCLASS, 'D');
			break;
		case CHR('e'):
			NOTE(REG_UUNPORT);
			RETV(PLAIN, chrnamed(v, esc, ENDOF(esc), CHR('\033')));
			break;
		case CHR('f'):
			RETV(PLAIN, CHR('\f'));
			break;
		case CHR('m'):
			RET('<');
			break;
		case CHR('M'):
			RET('>');
			break;
		case CHR('n'):
			RETV(PLAIN, CHR('\n'));
			break;
		case CHR('r'):
			RETV(PLAIN, CHR('\r'));
			break;
		case CHR('s'):
			NOTE(REG_ULOCALE);
			RETV(CCLASS, 's');
			break;
		case CHR('S'):
			NOTE(REG_ULOCALE);
			RETV(CCLASS, 'S');
			break;
		case CHR('t'):
			RETV(PLAIN, CHR('\t'));
			break;
		case CHR('u'):
			c = lexdigits(v, 16, 4, 4);
			if (ISERR())
				FAILW(REG_EESCAPE);
			RETV(PLAIN, c);
			break;
		case CHR('U'):
			c = lexdigits(v, 16, 8, 8);
			if (ISERR())
				FAILW(REG_EESCAPE);
			RETV(PLAIN, c);
			break;
		case CHR('v'):
			RETV(PLAIN, CHR('\v'));
			break;
		case CHR('w'):
			NOTE(REG_ULOCALE);
			RETV(CCLASS, 'w');
			break;
		case CHR('W'):
			NOTE(REG_ULOCALE);
			RETV(CCLASS, 'W');
			break;
		case CHR('x'):
			NOTE(REG_UUNPORT);
			c = lexdigits(v, 16, 1, 255);		/* REs >255 long outside spec */
			if (ISERR())
				FAILW(REG_EESCAPE);
			RETV(PLAIN, c);
			break;
		case CHR('y'):
			NOTE(REG_ULOCALE);
			RETV(WBDRY, 0);
			break;
		case CHR('Y'):
			NOTE(REG_ULOCALE);
			RETV(NWBDRY, 0);
			break;
		case CHR('Z'):
			RETV(SEND, 0);
			break;
		case CHR('1'):
		case CHR('2'):
		case CHR('3'):
		case CHR('4'):
		case CHR('5'):
		case CHR('6'):
		case CHR('7'):
		case CHR('8'):
		case CHR('9'):
			save = v->now;
			v->now--;			/* put first digit back */
			c = lexdigits(v, 10, 1, 255);		/* REs >255 long outside spec */
			if (ISERR())
				FAILW(REG_EESCAPE);
			/* ugly heuristic (first test is "exactly 1 digit?") */
			if (v->now == save || ((int) c > 0 && (int) c <= v->nsubexp))
			{
				NOTE(REG_UBACKREF);
				RETV(BACKREF, (chr) c);
			}
			/* oops, doesn't look like it's a backref after all... */
			v->now = save;
			/* and fall through into octal number */
		case CHR('0'):
			NOTE(REG_UUNPORT);
			v->now--;			/* put first digit back */
			c = lexdigits(v, 8, 1, 3);
			if (ISERR())
				FAILW(REG_EESCAPE);
			RETV(PLAIN, c);
			break;
		default:
			assert(iscalpha(c));
			FAILW(REG_EESCAPE); /* unknown alphabetic escape */
			break;
	}
	assert(NOTREACHED);
}
Пример #4
0
/* \brief creates virtual display and inits renderer */
GLHCKAPI int glhckDisplayCreate(int width, int height, glhckRenderType renderType)
{
   GLHCK_INITIALIZED();
   CALL(0, "%d, %d, %d", width, height, renderType);

   if (width <= 0 && height <= 0)
      goto fail;

   /* close display if created already */
   if (GLHCKR()->type == renderType && renderType != GLHCK_RENDER_AUTO) goto success;
   else glhckDisplayClose();

   /* init renderer */
   switch (renderType) {
      case GLHCK_RENDER_AUTO:
#ifdef GLHCK_HAS_OPENGL
         _glhckRenderOpenGL();
         if (_glhckRenderInitialized()) break;
#endif
#ifdef GLHCK_HAS_OPENGL_FIXED_PIPELINE
         _glhckRenderOpenGLFixedPipeline();
         if (_glhckRenderInitialized()) break;
#endif
         _glhckRenderStub();
         break;

      case GLHCK_RENDER_OPENGL:
      case GLHCK_RENDER_GLES2:
#ifdef GLHCK_HAS_OPENGL
         _glhckRenderOpenGL();
#else
         DEBUG(GLHCK_DBG_ERROR, "OpenGL support was not compiled in!");
#endif
         break;
      case GLHCK_RENDER_OPENGL_FIXED_PIPELINE:
      case GLHCK_RENDER_GLES1:
#ifdef GLHCK_HAS_OPENGL_FIXED_PIPELINE
         _glhckRenderOpenGLFixedPipeline();
#else
         DEBUG(GLHCK_DBG_ERROR, "OpenGL Fixed Pipeline support was not compiled in!");
#endif
         break;
      case GLHCK_RENDER_STUB:
      default:
         _glhckRenderStub();
         break;
   }

   /* check that initialization was success */
   if (!_glhckRenderInitialized()) goto fail;

   /* check render api and output warnings,
    * if any function is missing */
   _glhckRenderCheckApi();
   GLHCKR()->type = renderType;

   /* default render pass bits */
   glhckRenderPass(glhckRenderPassDefaults());

   /* default cull face */
   glhckRenderCullFace(GLHCK_BACK);

   /* counter-clockwise are front face by default */
   glhckRenderFrontFace(GLHCK_CCW);

   /* resize display */
   glhckDisplayResize(width, height);

success:
   RET(0, "%d", RETURN_OK);
   return RETURN_OK;

fail:
   RET(0, "%d", RETURN_FAIL);
   return RETURN_FAIL;
}
Пример #5
0
static void
panel_start_gui(panel *p)
{
    ENTER;

    // main toplevel window
    p->topgwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_container_set_border_width(GTK_CONTAINER(p->topgwin), 0);
    g_signal_connect(G_OBJECT(p->topgwin), "destroy-event",
                     (GCallback) panel_destroy_event, p);
    g_signal_connect(G_OBJECT(p->topgwin), "size-request",
                     (GCallback) panel_size_req, p);
    g_signal_connect(G_OBJECT(p->topgwin), "map-event",
                     (GCallback) panel_mapped, p);
    g_signal_connect(G_OBJECT(p->topgwin), "configure-event",
                     (GCallback) panel_configure_event, p);
    g_signal_connect(G_OBJECT(p->topgwin), "button-press-event",
                     (GCallback) panel_button_press_event, p);
    g_signal_connect(G_OBJECT(p->topgwin), "scroll-event",
                     (GCallback) panel_scroll_event, p);

    gtk_window_set_resizable(GTK_WINDOW(p->topgwin), FALSE);
    gtk_window_set_wmclass(GTK_WINDOW(p->topgwin), "panel", "fbpanel");
    gtk_window_set_title(GTK_WINDOW(p->topgwin), "panel");
    gtk_window_set_position(GTK_WINDOW(p->topgwin), GTK_WIN_POS_NONE);
    gtk_window_set_decorated(GTK_WINDOW(p->topgwin), FALSE);
    gtk_window_set_accept_focus(GTK_WINDOW(p->topgwin), FALSE);
    if (p->setdocktype)
        gtk_window_set_type_hint(GTK_WINDOW(p->topgwin),
                                 GDK_WINDOW_TYPE_HINT_DOCK);

    if (p->layer == LAYER_ABOVE)
        gtk_window_set_keep_above(GTK_WINDOW(p->topgwin), TRUE);
    else if (p->layer == LAYER_BELOW)
        gtk_window_set_keep_below(GTK_WINDOW(p->topgwin), TRUE);
    gtk_window_stick(GTK_WINDOW(p->topgwin));

    gtk_widget_realize(p->topgwin);
    p->topxwin = GDK_WINDOW_XWINDOW(p->topgwin->window);
    DBG("topxwin = %lx\n", p->topxwin);
    /* ensure configure event */
    XMoveWindow(GDK_DISPLAY(), p->topxwin, 20, 20);
    XSync(GDK_DISPLAY(), False);

    gtk_widget_set_app_paintable(p->topgwin, TRUE);
    calculate_position(p);
    gtk_window_move(GTK_WINDOW(p->topgwin), p->ax, p->ay);
    gtk_window_resize(GTK_WINDOW(p->topgwin), p->aw, p->ah);
    DBG("move-resize x %d y %d w %d h %d\n", p->ax, p->ay, p->aw, p->ah);
    //XSync(GDK_DISPLAY(), False);
    //gdk_flush();

    // background box all over toplevel
    p->bbox = gtk_bgbox_new();
    gtk_container_add(GTK_CONTAINER(p->topgwin), p->bbox);
    gtk_container_set_border_width(GTK_CONTAINER(p->bbox), 0);
    if (p->transparent) {
        p->bg = fb_bg_get_for_display();
        gtk_bgbox_set_background(p->bbox, BG_ROOT, p->tintcolor, p->alpha);
    }

    // main layout manager as a single child of background widget box
    p->lbox = p->my_box_new(FALSE, 0);
    gtk_container_set_border_width(GTK_CONTAINER(p->lbox), 0);
    gtk_container_add(GTK_CONTAINER(p->bbox), p->lbox);

    p->box = p->my_box_new(FALSE, p->spacing);
    gtk_container_set_border_width(GTK_CONTAINER(p->box), 0);
    gtk_box_pack_start(GTK_BOX(p->lbox), p->box, TRUE, TRUE,
                       (p->round_corners) ? p->round_corners_radius : 0);
    if (p->round_corners) {
        make_round_corners(p);
        DBG("make_round_corners\n");
    }
    /* start window creation process */
    gtk_widget_show_all(p->topgwin);
    /* .. and hide it from user until everything is done */
    gtk_widget_hide(p->topgwin);

    p->menu = panel_make_menu(p);

    if (p->setstrut)
        panel_set_wm_strut(p);

    XSelectInput(GDK_DISPLAY(), GDK_ROOT_WINDOW(), PropertyChangeMask);
    gdk_window_add_filter(gdk_get_default_root_window(),
                          (GdkFilterFunc)panel_event_filter, p);
    //XSync(GDK_DISPLAY(), False);
    gdk_flush();
    RET();
}
Пример #6
0
int scan(Scanner *s){
	unsigned char *cursor = s->cur;
	int ret=0;
std:
	s->tok = cursor;
#line 90 "conf.re.c"



#line 81 "conf.c"
{
	YYCTYPE yych;

	if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10);
	yych = *YYCURSOR;
	switch (yych) {
	case '\t':	goto yy21;
	case '\n':	goto yy23;
	case '\v':
	case '\f':	goto yy14;
	case '\r':	goto yy16;
	case ' ':	goto yy19;
	case '#':	goto yy4;
	case '/':	goto yy2;
	case ';':	goto yy17;
	case 'd':	goto yy6;
	case 'e':	goto yy12;
	case 'h':	goto yy9;
	case 'i':	goto yy10;
	case 'l':	goto yy7;
	case 'o':	goto yy11;
	case 'p':	goto yy8;
	case 'u':	goto yy13;
	default:	goto yy25;
	}
yy2:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':	goto yy119;
	default:	goto yy3;
	}
yy3:
#line 180 "conf.re.c"
	{
		printf("unexpected character: %c line %d \n", *s->tok, s->line);
		goto std;
	    }
#line 119 "conf.c"
yy4:
	++YYCURSOR;
#line 95 "conf.re.c"
	{ goto unixcomment; }
#line 124 "conf.c"
yy6:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'a':	goto yy113;
	default:	goto yy3;
	}
yy7:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'o':	goto yy99;
	default:	goto yy3;
	}
yy8:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'i':	goto yy88;
	case 'o':	goto yy89;
	default:	goto yy3;
	}
yy9:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 't':	goto yy84;
	default:	goto yy3;
	}
yy10:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'n':	goto yy69;
	default:	goto yy3;
	}
yy11:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'u':	goto yy53;
	default:	goto yy3;
	}
yy12:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'r':	goto yy44;
	default:	goto yy3;
	}
yy13:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'r':	goto yy29;
	default:	goto yy3;
	}
yy14:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy28;
yy15:
#line 166 "conf.re.c"
	{ RET(8912); goto std; }
#line 181 "conf.c"
yy16:
	yych = *++YYCURSOR;
	switch (yych) {
	case '\n':	goto yy26;
	default:	goto yy28;
	}
yy17:
	++YYCURSOR;
#line 168 "conf.re.c"
	{  goto std; }
#line 192 "conf.c"
yy19:
	++YYCURSOR;
#line 169 "conf.re.c"
	{  goto std; }
#line 197 "conf.c"
yy21:
	++YYCURSOR;
#line 170 "conf.re.c"
	{ goto std;  }
#line 202 "conf.c"
yy23:
	++YYCURSOR;
yy24:
#line 173 "conf.re.c"
	{
		if(cursor == s->eof) RET(EOI);
		s->pos = cursor; s->line++;
		goto std;
	    }
#line 212 "conf.c"
yy25:
	yych = *++YYCURSOR;
	goto yy3;
yy26:
	yych = *++YYCURSOR;
	goto yy24;
yy27:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy28:
	switch (yych) {
	case '\v':
	case '\f':
	case '\r':	goto yy27;
	default:	goto yy15;
	}
yy29:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'l':	goto yy31;
	default:	goto yy30;
	}
yy30:
	YYCURSOR = YYMARKER;
	goto yy3;
yy31:
	yych = *++YYCURSOR;
	switch (yych) {
	case '.':	goto yy32;
	default:	goto yy30;
	}
yy32:
	yych = *++YYCURSOR;
	switch (yych) {
	case '4':	goto yy34;
	case 'p':	goto yy33;
	default:	goto yy30;
	}
yy33:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'r':	goto yy38;
	default:	goto yy30;
	}
yy34:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':	goto yy35;
	default:	goto yy30;
	}
yy35:
	yych = *++YYCURSOR;
	switch (yych) {
	case '4':	goto yy36;
	default:	goto yy30;
	}
yy36:
	++YYCURSOR;
#line 160 "conf.re.c"
	{
						s->parm = 15;
						goto param;
					}
#line 277 "conf.c"
yy38:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'e':	goto yy39;
	default:	goto yy30;
	}
yy39:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'f':	goto yy40;
	default:	goto yy30;
	}
yy40:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'i':	goto yy41;
	default:	goto yy30;
	}
yy41:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'x':	goto yy42;
	default:	goto yy30;
	}
yy42:
	++YYCURSOR;
#line 156 "conf.re.c"
	{
						s->parm = 14;
						goto param;
					}
#line 309 "conf.c"
yy44:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'r':	goto yy45;
	default:	goto yy30;
	}
yy45:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'o':	goto yy46;
	default:	goto yy30;
	}
yy46:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'r':	goto yy47;
	default:	goto yy30;
	}
yy47:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'f':	goto yy48;
	default:	goto yy30;
	}
yy48:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'i':	goto yy49;
	default:	goto yy30;
	}
yy49:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'l':	goto yy50;
	default:	goto yy30;
	}
yy50:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'e':	goto yy51;
	default:	goto yy30;
	}
yy51:
	++YYCURSOR;
#line 151 "conf.re.c"
	{
						s->parm = 13;
						goto param;
					}
#line 359 "conf.c"
yy53:
	yych = *++YYCURSOR;
	switch (yych) {
	case 't':	goto yy54;
	default:	goto yy30;
	}
yy54:
	yych = *++YYCURSOR;
	switch (yych) {
	case '.':	goto yy55;
	default:	goto yy30;
	}
yy55:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'd':	goto yy58;
	case 'h':	goto yy57;
	case 'p':	goto yy56;
	default:	goto yy30;
	}
yy56:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'o':	goto yy65;
	default:	goto yy30;
	}
yy57:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'o':	goto yy61;
	default:	goto yy30;
	}
yy58:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'b':	goto yy59;
	default:	goto yy30;
	}
yy59:
	++YYCURSOR;
#line 147 "conf.re.c"
	{
						s->parm = 12;
						goto param;
					}
#line 405 "conf.c"
yy61:
	yych = *++YYCURSOR;
	switch (yych) {
	case 's':	goto yy62;
	default:	goto yy30;
	}
yy62:
	yych = *++YYCURSOR;
	switch (yych) {
	case 't':	goto yy63;
	default:	goto yy30;
	}
yy63:
	++YYCURSOR;
#line 143 "conf.re.c"
	{
						s->parm = 11;
						goto ip_param;
					}
#line 425 "conf.c"
yy65:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'r':	goto yy66;
	default:	goto yy30;
	}
yy66:
	yych = *++YYCURSOR;
	switch (yych) {
	case 't':	goto yy67;
	default:	goto yy30;
	}
yy67:
	++YYCURSOR;
#line 139 "conf.re.c"
	{
						s->parm = 10;
						goto dparam;
					}
#line 445 "conf.c"
yy69:
	yych = *++YYCURSOR;
	switch (yych) {
	case '.':	goto yy70;
	default:	goto yy30;
	}
yy70:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'd':	goto yy71;
	case 'h':	goto yy72;
	case 'p':	goto yy73;
	default:	goto yy30;
	}
yy71:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'b':	goto yy82;
	default:	goto yy30;
	}
yy72:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'o':	goto yy78;
	default:	goto yy30;
	}
yy73:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'o':	goto yy74;
	default:	goto yy30;
	}
yy74:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'r':	goto yy75;
	default:	goto yy30;
	}
yy75:
	yych = *++YYCURSOR;
	switch (yych) {
	case 't':	goto yy76;
	default:	goto yy30;
	}
yy76:
	++YYCURSOR;
#line 126 "conf.re.c"
	{
						s->parm = 4;
						goto dparam;
					}
#line 497 "conf.c"
yy78:
	yych = *++YYCURSOR;
	switch (yych) {
	case 's':	goto yy79;
	default:	goto yy30;
	}
yy79:
	yych = *++YYCURSOR;
	switch (yych) {
	case 't':	goto yy80;
	default:	goto yy30;
	}
yy80:
	++YYCURSOR;
#line 130 "conf.re.c"
	{
						s->parm = 8;
						goto ip_param;
					}
#line 517 "conf.c"
yy82:
	++YYCURSOR;
#line 134 "conf.re.c"
	{
						s->parm = 9;
						goto param;
					}
#line 525 "conf.c"
yy84:
	yych = *++YYCURSOR;
	switch (yych) {
	case 't':	goto yy85;
	default:	goto yy30;
	}
yy85:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'p':	goto yy86;
	default:	goto yy30;
	}
yy86:
	++YYCURSOR;
#line 116 "conf.re.c"
	{
						s->parm = 6;
						goto ip_param;
					}
#line 545 "conf.c"
yy88:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'd':	goto yy93;
	default:	goto yy30;
	}
yy89:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'r':	goto yy90;
	default:	goto yy30;
	}
yy90:
	yych = *++YYCURSOR;
	switch (yych) {
	case 't':	goto yy91;
	default:	goto yy30;
	}
yy91:
	++YYCURSOR;
#line 111 "conf.re.c"
	{
						s->parm = 3;
						goto dparam;
					}
#line 571 "conf.c"
yy93:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'f':	goto yy94;
	default:	goto yy30;
	}
yy94:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'i':	goto yy95;
	default:	goto yy30;
	}
yy95:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'l':	goto yy96;
	default:	goto yy30;
	}
yy96:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'e':	goto yy97;
	default:	goto yy30;
	}
yy97:
	++YYCURSOR;
#line 121 "conf.re.c"
	{
						s->parm = 7;
						goto param;
					}
#line 603 "conf.c"
yy99:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'g':	goto yy100;
	default:	goto yy30;
	}
yy100:
	yych = *++YYCURSOR;
	switch (yych) {
	case '_':	goto yy101;
	case 'f':	goto yy102;
	default:	goto yy30;
	}
yy101:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'l':	goto yy107;
	default:	goto yy30;
	}
yy102:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'i':	goto yy103;
	default:	goto yy30;
	}
yy103:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'l':	goto yy104;
	default:	goto yy30;
	}
yy104:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'e':	goto yy105;
	default:	goto yy30;
	}
yy105:
	++YYCURSOR;
#line 102 "conf.re.c"
	{
						s->parm = 2;
						goto param;
					}
#line 648 "conf.c"
yy107:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'e':	goto yy108;
	default:	goto yy30;
	}
yy108:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'v':	goto yy109;
	default:	goto yy30;
	}
yy109:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'e':	goto yy110;
	default:	goto yy30;
	}
yy110:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'l':	goto yy111;
	default:	goto yy30;
	}
yy111:
	++YYCURSOR;
#line 107 "conf.re.c"
	{
						s->parm = 5;
						goto lparam;
					}
#line 680 "conf.c"
yy113:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'e':	goto yy114;
	default:	goto yy30;
	}
yy114:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'm':	goto yy115;
	default:	goto yy30;
	}
yy115:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'o':	goto yy116;
	default:	goto yy30;
	}
yy116:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'n':	goto yy117;
	default:	goto yy30;
	}
yy117:
	++YYCURSOR;
#line 97 "conf.re.c"
	{
						s->parm = 1;
						goto _bool;
					}
#line 712 "conf.c"
yy119:
	++YYCURSOR;
#line 94 "conf.re.c"
	{ goto comment; }
#line 717 "conf.c"
}
#line 184 "conf.re.c"

//s->tok = cursor; s->parm =3; goto param; 
//(PATH)*";"		{ RET(2001); }
//
	


param:
 s->ptok=cursor;

#line 730 "conf.c"
{
	YYCTYPE yych;
	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	switch (yych) {
	case '-':	goto yy123;
	case '.':
	case '/':	goto yy125;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy126;
	case ':':
	case '@':	goto yy129;
	case ';':	goto yy127;
	default:	goto yy130;
	}
yy123:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '-':
	case '.':
	case '/':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy141;
	case ';':	goto yy143;
	default:	goto yy124;
	}
yy124:
#line 199 "conf.re.c"
	{  goto param; }
#line 882 "conf.c"
yy125:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '-':	goto yy141;
	case '.':
	case '/':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy139;
	case ':':
	case '@':	goto yy133;
	case ';':	goto yy144;
	default:	goto yy124;
	}
yy126:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '-':	goto yy141;
	case '.':
	case '/':	goto yy139;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy137;
	case ':':
	case '@':	goto yy133;
	case ';':	goto yy136;
	default:	goto yy124;
	}
yy127:
	++YYCURSOR;
yy128:
#line 195 "conf.re.c"
	{ RET(303); }
#line 1036 "conf.c"
yy129:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '.':
	case '/':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case ':':
	case ';':
	case '@':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy134;
	default:	goto yy124;
	}
yy130:
	yych = *++YYCURSOR;
	goto yy124;
yy131:
	++YYCURSOR;
#line 196 "conf.re.c"
	{ RET(301 ); }
#line 1117 "conf.c"
yy133:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy134:
	switch (yych) {
	case '.':
	case '/':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case ':':
	case '@':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy133;
	case ';':	goto yy131;
	default:	goto yy135;
	}
yy135:
	YYCURSOR = YYMARKER;
	goto yy124;
yy136:
	yych = *++YYCURSOR;
	goto yy128;
yy137:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '-':	goto yy141;
	case '.':
	case '/':	goto yy139;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy137;
	case ':':
	case '@':	goto yy133;
	case ';':	goto yy136;
	default:	goto yy135;
	}
yy139:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '-':	goto yy141;
	case '.':
	case '/':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy139;
	case ':':
	case '@':	goto yy133;
	case ';':	goto yy144;
	default:	goto yy135;
	}
yy141:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '-':
	case '.':
	case '/':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy141;
	case ';':	goto yy143;
	default:	goto yy135;
	}
yy143:
	yych = *++YYCURSOR;
	goto yy128;
yy144:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy128;
}
#line 201 "conf.re.c"


_bool: 
 s->ptok=cursor;

#line 1440 "conf.c"
{
	YYCTYPE yych;
	if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':	goto yy151;
	case '1':	goto yy149;
	case ';':	goto yy153;
	case 'o':	goto yy147;
	default:	goto yy155;
	}
yy147:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'f':	goto yy156;
	case 'n':	goto yy158;
	default:	goto yy148;
	}
yy148:
#line 213 "conf.re.c"
	{  goto _bool; }
#line 1462 "conf.c"
yy149:
	++YYCURSOR;
#line 208 "conf.re.c"
	{ RET(101); }
#line 1467 "conf.c"
yy151:
	++YYCURSOR;
#line 209 "conf.re.c"
	{ RET(102); }
#line 1472 "conf.c"
yy153:
	++YYCURSOR;
#line 211 "conf.re.c"
	{ goto std; }
#line 1477 "conf.c"
yy155:
	yych = *++YYCURSOR;
	goto yy148;
yy156:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'f':	goto yy160;
	default:	goto yy157;
	}
yy157:
	YYCURSOR = YYMARKER;
	goto yy148;
yy158:
	++YYCURSOR;
#line 206 "conf.re.c"
	{ RET( 101); }
#line 1494 "conf.c"
yy160:
	++YYCURSOR;
#line 207 "conf.re.c"
	{ RET( 102); }
#line 1499 "conf.c"
}
#line 215 "conf.re.c"


lparam: 
 s->ptok=cursor;

#line 1507 "conf.c"
{
	YYCTYPE yych;
	if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
	yych = *YYCURSOR;
	switch (yych) {
	case ';':	goto yy171;
	case 'a':	goto yy167;
	case 'c':	goto yy166;
	case 'd':	goto yy170;
	case 'e':	goto yy164;
	case 'n':	goto yy169;
	case 'w':	goto yy168;
	default:	goto yy173;
	}
yy164:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'r':	goto yy205;
	default:	goto yy165;
	}
yy165:
#line 229 "conf.re.c"
	{  goto lparam; }
#line 1531 "conf.c"
yy166:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'o':	goto yy198;
	default:	goto yy165;
	}
yy167:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'l':	goto yy193;
	default:	goto yy165;
	}
yy168:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'a':	goto yy186;
	default:	goto yy165;
	}
yy169:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'o':	goto yy180;
	default:	goto yy165;
	}
yy170:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'e':	goto yy174;
	default:	goto yy165;
	}
yy171:
	++YYCURSOR;
#line 227 "conf.re.c"
	{ goto std; }
#line 1566 "conf.c"
yy173:
	yych = *++YYCURSOR;
	goto yy165;
yy174:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'b':	goto yy176;
	default:	goto yy175;
	}
yy175:
	YYCURSOR = YYMARKER;
	goto yy165;
yy176:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'u':	goto yy177;
	default:	goto yy175;
	}
yy177:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'g':	goto yy178;
	default:	goto yy175;
	}
yy178:
	++YYCURSOR;
#line 225 "conf.re.c"
	{ RET(6); }
#line 1595 "conf.c"
yy180:
	yych = *++YYCURSOR;
	switch (yych) {
	case 't':	goto yy181;
	default:	goto yy175;
	}
yy181:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'i':	goto yy182;
	default:	goto yy175;
	}
yy182:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'c':	goto yy183;
	default:	goto yy175;
	}
yy183:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'e':	goto yy184;
	default:	goto yy175;
	}
yy184:
	++YYCURSOR;
#line 224 "conf.re.c"
	{ RET(5); }
#line 1624 "conf.c"
yy186:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'r':	goto yy187;
	default:	goto yy175;
	}
yy187:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'n':	goto yy188;
	default:	goto yy175;
	}
yy188:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'i':	goto yy189;
	default:	goto yy175;
	}
yy189:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'n':	goto yy190;
	default:	goto yy175;
	}
yy190:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'g':	goto yy191;
	default:	goto yy175;
	}
yy191:
	++YYCURSOR;
#line 223 "conf.re.c"
	{ RET(4); }
#line 1659 "conf.c"
yy193:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'e':	goto yy194;
	default:	goto yy175;
	}
yy194:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'r':	goto yy195;
	default:	goto yy175;
	}
yy195:
	yych = *++YYCURSOR;
	switch (yych) {
	case 't':	goto yy196;
	default:	goto yy175;
	}
yy196:
	++YYCURSOR;
#line 222 "conf.re.c"
	{ RET(3); }
#line 1682 "conf.c"
yy198:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'n':	goto yy199;
	default:	goto yy175;
	}
yy199:
	yych = *++YYCURSOR;
	switch (yych) {
	case 't':	goto yy200;
	default:	goto yy175;
	}
yy200:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'e':	goto yy201;
	default:	goto yy175;
	}
yy201:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'n':	goto yy202;
	default:	goto yy175;
	}
yy202:
	yych = *++YYCURSOR;
	switch (yych) {
	case 't':	goto yy203;
	default:	goto yy175;
	}
yy203:
	++YYCURSOR;
#line 221 "conf.re.c"
	{ RET(2); }
#line 1717 "conf.c"
yy205:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'r':	goto yy206;
	default:	goto yy175;
	}
yy206:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'o':	goto yy207;
	default:	goto yy175;
	}
yy207:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'r':	goto yy208;
	default:	goto yy175;
	}
yy208:
	++YYCURSOR;
#line 220 "conf.re.c"
	{ RET(1); }
#line 1740 "conf.c"
}
#line 231 "conf.re.c"


ip_param:
 s->ptok=cursor;
 ret =  100;

#line 1749 "conf.c"
{
	YYCTYPE yych;
	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	switch (yych) {
	case '.':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case ':':	goto yy212;
	case ';':	goto yy214;
	default:	goto yy216;
	}
yy212:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '.':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case ':':
	case ';':	goto yy219;
	default:	goto yy213;
	}
yy213:
#line 238 "conf.re.c"
	{  goto ip_param; }
#line 1787 "conf.c"
yy214:
	++YYCURSOR;
yy215:
#line 237 "conf.re.c"
	{ RET(ret); }
#line 1793 "conf.c"
yy216:
	yych = *++YYCURSOR;
	goto yy213;
yy217:
	yych = *++YYCURSOR;
	goto yy215;
yy218:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy219:
	switch (yych) {
	case '.':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case ':':	goto yy218;
	case ';':	goto yy217;
	default:	goto yy220;
	}
yy220:
	YYCURSOR = YYMARKER;
	goto yy213;
}
#line 239 "conf.re.c"


dparam:
 s->ptok=cursor;
 ret =  200;

#line 1830 "conf.c"
{
	YYCTYPE yych;
	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy223;
	case ';':	goto yy225;
	default:	goto yy227;
	}
yy223:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy229;
	case ';':	goto yy228;
	default:	goto yy224;
	}
yy224:
#line 246 "conf.re.c"
	{  goto dparam; }
#line 1868 "conf.c"
yy225:
	++YYCURSOR;
yy226:
#line 245 "conf.re.c"
	{ RET(ret); }
#line 1874 "conf.c"
yy227:
	yych = *++YYCURSOR;
	goto yy224;
yy228:
	yych = *++YYCURSOR;
	goto yy226;
yy229:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy229;
	case ';':	goto yy228;
	default:	goto yy231;
	}
yy231:
	YYCURSOR = YYMARKER;
	goto yy224;
}
#line 247 "conf.re.c"


unixcomment:	

#line 1908 "conf.c"
{
	YYCTYPE yych;
	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	switch (yych) {
	case '\n':	goto yy236;
	case '\r':	goto yy234;
	default:	goto yy238;
	}
yy234:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '\n':	goto yy239;
	default:	goto yy235;
	}
yy235:
#line 252 "conf.re.c"
	{ goto unixcomment; }
#line 1927 "conf.c"
yy236:
	++YYCURSOR;
yy237:
#line 251 "conf.re.c"
	{  s->line++; goto std; }
#line 1933 "conf.c"
yy238:
	yych = *++YYCURSOR;
	goto yy235;
yy239:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy237;
}
#line 253 "conf.re.c"


comment:

#line 1947 "conf.c"
{
	YYCTYPE yych;
	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	switch (yych) {
	case '\n':	goto yy244;
	case '*':	goto yy242;
	default:	goto yy246;
	}
yy242:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '/':	goto yy247;
	default:	goto yy243;
	}
yy243:
#line 265 "conf.re.c"
	{ goto comment; }
#line 1966 "conf.c"
yy244:
	++YYCURSOR;
#line 260 "conf.re.c"
	{
		if(cursor == s->eof) RET(EOI);
		s->tok = s->pos = cursor; s->line++;
		goto comment;
	    }
#line 1975 "conf.c"
yy246:
	yych = *++YYCURSOR;
	goto yy243;
yy247:
	++YYCURSOR;
#line 257 "conf.re.c"
	{ goto std; }
#line 1983 "conf.c"
}
#line 266 "conf.re.c"

}
Пример #7
0
int yylex()
{
	int c, n;
	static char *buf = 0;
	static int bufsize = 500;

	if (buf == 0 && (buf = (char *) malloc(bufsize)) == NULL)
		ERROR "out of space in yylex" FATAL;
	if (sc) {
		sc = 0;
		RET('}');
	}
	if (reg) {
		reg = 0;
		return regexpr();
	}
	for (;;) {
		c = gettok(&buf, &bufsize);
		if (c == 0)
			return 0;
		if (isalpha(c) || c == '_')
			return word(buf);
		if (isdigit(c) || c == '.') {
			yylval.cp = setsymtab(buf, tostring(buf), atof(buf), CON|NUM, symtab);
			/* should this also have STR set? */
			RET(NUMBER);
		}
	
		yylval.i = c;
		switch (c) {
		case '\n':	/* {EOL} */
			RET(NL);
		case '\r':	/* assume \n is coming */
		case ' ':	/* {WS}+ */
		case '\t':
			break;
		case '#':	/* #.* strip comments */
			while ((c = input()) != '\n' && c != 0)
				;
			unput(c);
			break;
		case ';':
			RET(';');
		case '\\':
			if (peek() == '\n') {
				input(); lineno++;
			} else if (peek() == '\r') {
				input(); input();	/* \n */
				lineno++;
			} else {
				RET(c);
			}
			break;
		case '&':
			if (peek() == '&') {
				input(); RET(AND);
			} else 
				RET('&');
		case '|':
			if (peek() == '|') {
				input(); RET(BOR);
			} else
				RET('|');
		case '!':
			if (peek() == '=') {
				input(); yylval.i = NE; RET(NE);
			} else if (peek() == '~') {
				input(); yylval.i = NOTMATCH; RET(MATCHOP);
			} else
				RET(NOT);
		case '~':
			yylval.i = MATCH;
			RET(MATCHOP);
		case '<':
			if (peek() == '=') {
				input(); yylval.i = LE; RET(LE);
			} else {
				yylval.i = LT; RET(LT);
			}
		case '=':
			if (peek() == '=') {
				input(); yylval.i = EQ; RET(EQ);
			} else {
				yylval.i = ASSIGN; RET(ASGNOP);
			}
		case '>':
			if (peek() == '=') {
				input(); yylval.i = GE; RET(GE);
			} else if (peek() == '>') {
				input(); yylval.i = APPEND; RET(APPEND);
			} else {
				yylval.i = GT; RET(GT);
			}
		case '+':
			if (peek() == '+') {
				input(); yylval.i = INCR; RET(INCR);
			} else if (peek() == '=') {
				input(); yylval.i = ADDEQ; RET(ASGNOP);
			} else
				RET('+');
		case '-':
			if (peek() == '-') {
				input(); yylval.i = DECR; RET(DECR);
			} else if (peek() == '=') {
				input(); yylval.i = SUBEQ; RET(ASGNOP);
			} else
				RET('-');
		case '*':
			if (peek() == '=') {	/* *= */
				input(); yylval.i = MULTEQ; RET(ASGNOP);
			} else if (peek() == '*') {	/* ** or **= */
				input();	/* eat 2nd * */
				if (peek() == '=') {
					input(); yylval.i = POWEQ; RET(ASGNOP);
				} else {
					RET(POWER);
				}
			} else
				RET('*');
		case '/':
			if (peek() == '=') {
				input(); yylval.i = DIVEQ; RET(ASGNOP);
			} else
				RET('/');
		case '%':
			if (peek() == '=') {
				input(); yylval.i = MODEQ; RET(ASGNOP);
			} else
				RET('%');
		case '^':
			if (peek() == '=') {
				input(); yylval.i = POWEQ; RET(ASGNOP);
			} else
				RET(POWER);
	
		case '$':
			/* BUG: awkward, if not wrong */
			c = gettok(&buf, &bufsize);
			if (c == '(' || c == '[' || (infunc && (n=isarg(buf)) >= 0)) {
				unputstr(buf);
				RET(INDIRECT);
			} else if (isalpha(c)) {
				if (strcmp(buf, "NF") == 0) {	/* very special */
					unputstr("(NF)");
					RET(INDIRECT);
				}
				yylval.cp = setsymtab(buf, "", 0.0, STR|NUM, symtab);
				RET(IVAR);
			} else {
				unputstr(buf);
				RET(INDIRECT);
			}
	
		case '}':
			if (--bracecnt < 0)
				ERROR "extra }" SYNTAX;
			sc = 1;
			RET(';');
		case ']':
			if (--brackcnt < 0)
				ERROR "extra ]" SYNTAX;
			RET(']');
		case ')':
			if (--parencnt < 0)
				ERROR "extra )" SYNTAX;
			RET(')');
		case '{':
			bracecnt++;
			RET('{');
		case '[':
			brackcnt++;
			RET('[');
		case '(':
			parencnt++;
			RET('(');
	
		case '"':
			return string();	/* BUG: should be like tran.c ? */
	
		default:
			RET(c);
		}
	}
}
Пример #8
0
static int
cpufreq_constructor(Plugin *p, char** fp)
{
    cpufreq *cf;
    GtkWidget *button;

    ENTER;
    cf = g_new0(cpufreq, 1);
    cf->governors = NULL;
    cf->cpus = NULL;
    g_return_val_if_fail(cf != NULL, 0);
    p->priv = cf;

    p->pwid = gtk_event_box_new();
    GTK_WIDGET_SET_FLAGS( p->pwid, GTK_NO_WINDOW );
    gtk_container_set_border_width( GTK_CONTAINER(p->pwid), 2 );

    cf->namew = gtk_image_new_from_file(PROC_ICON);
    gtk_container_add(GTK_CONTAINER(p->pwid), cf->namew);

    cf->main = p->pwid;
    cf->tip = gtk_tooltips_new();

#if GLIB_CHECK_VERSION( 2, 10, 0 )
    g_object_ref_sink( cf->tip );
#else
    g_object_ref( cf->tip );
    gtk_object_sink( cf->tip );
#endif

    g_signal_connect (G_OBJECT (p->pwid), "button_press_event", G_CALLBACK (clicked), (gpointer) p);

    cf->has_cpufreq = 0;

    get_cpus(cf);

/*    line s;
    s.len = 256;

    if (fp) {
        while (lxpanel_get_line(fp, &s) != LINE_BLOCK_END) {
            if (s.type == LINE_NONE) {
                ERR( "cpufreq: illegal token %s\n", s.str);
                goto error;
            }
            if (s.type == LINE_VAR) {
                if (!g_ascii_strcasecmp(s.t[0], "DefaultGovernor")){
                    //cf->str_cl_normal = g_strdup(s.t[1]);
                }else {
                    ERR( "cpufreq: unknown var %s\n", s.t[0]);
                    continue;
                }
            }
            else {
                ERR( "cpufreq: illegal in cfis context %s\n", s.str);
                goto error;
            }
        }

    }*/
    update_tooltip(cf);
    cf->timer = g_timeout_add(2000, (GSourceFunc)update_tooltip, (gpointer)cf);

    gtk_widget_show(cf->namew);

    RET(TRUE);

/*error:
    RET(FALSE);*/
}
Пример #9
0
/* \brief update enet state internally */
static int _nethckEnetUpdate(void)
{
   __NETHCKclient client;
   ENetEvent event;
   unsigned int packets = 0;
   TRACE(2);

   /* wait up to 1000 milliseconds for an event */
   while (enet_host_service(_NETHCKserver.enet, &event, 1000) > 0) {
      switch (event.type) {
         case ENET_EVENT_TYPE_CONNECT:
            printf("A new client connected from %x:%u.\n",
                  event.peer->address.host,
                  event.peer->address.port);

            /* fill new client struct */
            memset(&client, 0, sizeof(__NETHCKclient));
            enet_address_get_host_ip(&event.peer->address, client.host, sizeof(client.host));
            event.peer->data = _nethckServerNewClient(&client);
            break;

         case ENET_EVENT_TYPE_RECEIVE:
            /* manage packet by kind */
            printf("A packet of length %zu was received on channel %u.\n",
                  event.packet->dataLength, event.channelID);
            printf("ID: %d\n", ((nethckPacket*)event.packet->data)->type);
            switch (((nethckPacket*)event.packet->data)->type) {
               case NETHCK_PACKET_OBJECT:
                  _nethckServerManagePacketObject(event.packet->data);
                  break;
               case NETHCK_PACKET_OBJECT_TRANSLATION:
               case NETHCK_PACKET_OBJECT_MATERIAL:
               case NETHCK_PACKET_OBJECT_TEXTURE:
               default:
                  break;
            }

            /* echo the packet to clients */
            enet_host_broadcast(_NETHCKserver.enet, 0, event.packet);

            /* clean up the packet now that we're done using it. */
            //enet_packet_destroy(event.packet);
            break;

         case ENET_EVENT_TYPE_DISCONNECT:
            printf("%s disconected.\n", ((__NETHCKclient*)event.peer->data)->host);

            /* free the client */
            _nethckServerFreeClient(event.peer->data);
            event.peer->data = NULL;
            break;

         default:
            break;
      }
      ++packets;
   }

   RET(2, "%u", packets);
   return packets;
}
Пример #10
0
/* ( open -- flag ) */
static void
pcparts_open( pcparts_info_t *di )
{
	char *str = my_args_copy();
	char *argstr = strdup("");
	char *parstr = strdup("");
	int bs, parnum=-1;
	int found = 0;
	phandle_t ph;
	ducell offs, size;

	/* Layout of PC partition table */
	struct pc_partition {
		unsigned char boot;
		unsigned char head;
		unsigned char sector;
		unsigned char cyl;
		unsigned char type;
		unsigned char e_head;
		unsigned char e_sector;
		unsigned char e_cyl;
		u32 start_sect; /* unaligned little endian */
		u32 nr_sects; /* ditto */
	} *p, *partition;

	unsigned char buf[512];

	DPRINTF("pcparts_open '%s'\n", str );

	/* 
		Arguments that we accept:
		id: [0-7]
		[(id)][,][filespec]
	*/

	if ( strlen(str) ) {
		/* Detect the arguments */
		if ((*str >= '0' && *str <= '7') || (*str == ',')) {
		    push_str(str);
		    PUSH(',');
		    fword("left-parse-string");
		    parstr = pop_fstr_copy();
		    argstr = pop_fstr_copy();
		} else {
		    argstr = str;
		}
			
		/* Convert the id to a partition number */
		if (parstr && strlen(parstr))
		    parnum = atol(parstr);
	}

	/* Make sure argstr is not null */
	if (argstr == NULL)
	    argstr = strdup("");
	
	DPRINTF("parstr: %s  argstr: %s  parnum: %d\n", parstr, argstr, parnum);
        free(parstr);

	if( parnum < 0 )
		parnum = 0;

	di->filesystem_ph = 0;
	di->read_xt = find_parent_method("read");
	di->seek_xt = find_parent_method("seek");

	SEEK( 0 );
	if( READ(buf, 512) != 512 )
		RET(0);

	/* Check Magic */
	if (!has_pc_part_magic(buf)) {
		DPRINTF("pc partition magic not found.\n");
		RET(0);
	}

	/* Actual partition data */
	partition = (struct pc_partition *) (buf + 0x1be);

	/* Make sure we use a copy accessible from an aligned pointer (some archs
	   e.g. SPARC will crash otherwise) */
	p = malloc(sizeof(struct pc_partition));

	bs = 512;

	if (parnum < 4) {
		/* primary partition */
		partition += parnum;
		memcpy(p, partition, sizeof(struct pc_partition));

		if (p->type == 0 || is_pc_extended_part(p->type)) {
			DPRINTF("partition %d does not exist\n", parnum+1 );
			RET( 0 );
		}

		offs = (long long)(__le32_to_cpu(p->start_sect)) * bs;
		di->offs_hi = offs >> BITS;
		di->offs_lo = offs & (ucell) -1;

		size = (long long)(__le32_to_cpu(p->nr_sects)) * bs;
        	di->size_hi = size >> BITS;
        	di->size_lo = size & (ucell) -1;

		DPRINTF("Primary partition at sector %x\n", __le32_to_cpu(p->start_sect));

		/* If PReP boot partition, exit immediately with no filesystem probe */
		if (p->type == 0x41) {
			RET(-1);
		}

		found = 1;
	} else {
Пример #11
0
dlAnimTick* dlNewAnimTick( dlAnim *anim )
{
   dlNodeAnim           *node;
   dlAnimTickOldNode    **oldNode;

   dlVectorKey          *vkey;
   dlQuatKey            *qkey;
   DL_NODE_TYPE         count;

   CALL("%p", anim);

   if(!anim)
   { RET("%p", NULL); return( NULL ); }

	/* Allocate animation handler object */
   dlSetAlloc( ALLOC_EVALUATOR );
	dlAnimTick *animTick = (dlAnimTick*)dlCalloc( 1, sizeof(dlAnimTick) );
   if(!animTick)
   { RET("%p", NULL); return( NULL ); }

   /* assign animation */
   animTick->anim       = anim;
   animTick->oldTime    = 0.0f;

   /* null */
   animTick->oldNode    = NULL;

   node      = anim->node;
   oldNode   = &animTick->oldNode;
   for(; node; node = node->next)
   {
      *oldNode = dlCalloc( 1, sizeof(dlAnimTickOldNode) );
      if(!*oldNode)
      {
         dlFreeAnimTick( animTick );

         RET("%p", NULL);
         return( NULL );
      }

      /* store translations to pointer array */
      if(node->translation)
      {
         (*oldNode)->translation = dlCalloc( node->num_translation, sizeof(dlVectorKey*) );
         if(!(*oldNode)->translation)
         {
            dlFreeAnimTick( animTick );

            RET("%p", NULL);
            return( NULL );
         }

         vkey = node->translation; count = 0;
         for(; vkey; vkey = vkey->next)
            (*oldNode)->translation[count++] = vkey;
      }

      /* store rortations to pointer array */
      if(node->rotation)
      {
         (*oldNode)->rotation = dlCalloc( node->num_rotation, sizeof(dlQuatKey*) );
         if(!(*oldNode)->rotation)
         {
            dlFreeAnimTick( animTick );

            RET("%p", NULL);
            return( NULL );
         }

         qkey = node->rotation; count = 0;
         for(; qkey; qkey = qkey->next)
            (*oldNode)->rotation[count++] = qkey;
      }

      /* store scalings to pointer array */
      if(node->scaling)
      {
         (*oldNode)->scaling = dlCalloc( node->num_scaling, sizeof(dlVectorKey*) );
         if(!(*oldNode)->scaling)
         {
            dlFreeAnimTick( animTick );

            RET("%p", NULL);
            return( NULL );
         }

         vkey = node->scaling; count = 0;
         for(; vkey; vkey = vkey->next)
            (*oldNode)->scaling[count++] = vkey;
      }

      oldNode = &(*oldNode)->next;
   }

   /* no animations, pointless */
   if(!anim->node)
   {
      dlFreeAnimTick( animTick );

      RET("%p", NULL);
      return( NULL );
   }

   LOGOK("NEW");

   /* return */
   RET("%p", animTick);
   return( animTick );
}
Пример #12
0
static int scan(Scanner *s) 
{
	char *cursor = s->cur;

	s->tok = cursor;
	#line 55 "ext/pdo/pdo_sql_parser.re"


	
#line 55 "ext/pdo/pdo_sql_parser.c"
{
	YYCTYPE yych;

	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	switch (yych) {
	case 0x00:	goto yy11;
	case '"':	goto yy2;
	case '\'':	goto yy4;
	case ':':	goto yy5;
	case '?':	goto yy6;
	default:	goto yy8;
	}
yy2:
	yych = *(YYMARKER = ++YYCURSOR);
	if (yych >= 0x01) goto yy26;
yy3:
#line 63 "ext/pdo/pdo_sql_parser.re"
	{ SKIP_ONE(PDO_PARSER_TEXT); }
#line 75 "ext/pdo/pdo_sql_parser.c"
yy4:
	yych = *(YYMARKER = ++YYCURSOR);
	if (yych <= 0x00) goto yy3;
	goto yy20;
yy5:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy16;
	case ':':
	case '?':	goto yy13;
	default:	goto yy3;
	}
yy6:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case ':':
	case '?':	goto yy13;
	default:	goto yy7;
	}
yy7:
#line 62 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_BIND_POS); }
#line 160 "ext/pdo/pdo_sql_parser.c"
yy8:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case 0x00:
	case '"':
	case '\'':
	case ':':
	case '?':	goto yy10;
	default:	goto yy8;
	}
yy10:
#line 64 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_TEXT); }
#line 176 "ext/pdo/pdo_sql_parser.c"
yy11:
	++YYCURSOR;
#line 65 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_EOI); }
#line 181 "ext/pdo/pdo_sql_parser.c"
yy13:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case ':':
	case '?':	goto yy13;
	default:	goto yy15;
	}
yy15:
#line 60 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_TEXT); }
#line 194 "ext/pdo/pdo_sql_parser.c"
yy16:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy16;
	default:	goto yy18;
	}
yy18:
#line 61 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_BIND); }
#line 268 "ext/pdo/pdo_sql_parser.c"
yy19:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy20:
	switch (yych) {
	case 0x00:	goto yy21;
	case '\'':	goto yy23;
	case '\\':	goto yy22;
	default:	goto yy19;
	}
yy21:
	YYCURSOR = YYMARKER;
	goto yy3;
yy22:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if (yych <= 0x00) goto yy21;
	goto yy19;
yy23:
	++YYCURSOR;
#line 59 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_TEXT); }
#line 293 "ext/pdo/pdo_sql_parser.c"
yy25:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy26:
	switch (yych) {
	case 0x00:	goto yy21;
	case '"':	goto yy28;
	case '\\':	goto yy27;
	default:	goto yy25;
	}
yy27:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if (yych <= 0x00) goto yy21;
	goto yy25;
yy28:
	++YYCURSOR;
#line 58 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_TEXT); }
#line 315 "ext/pdo/pdo_sql_parser.c"
}
#line 66 "ext/pdo/pdo_sql_parser.re"
	
}
Пример #13
0
// 시리얼 통신을 종료한다.
void cController::CloseSerial()
{
	RET(!m_serialComm);
	m_serialComm->Close();
}
Пример #14
0
static int scan(Scanner *s) 
{
	char *cursor = s->cur;

	s->tok = cursor;
	#line 55 "ext/pdo/pdo_sql_parser.re"


	
#line 55 "ext/pdo/pdo_sql_parser.c"
{
	YYCTYPE yych;
	unsigned int yyaccept = 0;

	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	switch (yych) {
	case 0x00:	goto yy2;
	case '"':	goto yy3;
	case '\'':	goto yy5;
	case '-':	goto yy11;
	case '/':	goto yy9;
	case ':':	goto yy6;
	case '?':	goto yy7;
	default:	goto yy12;
	}
yy2:
	YYCURSOR = YYMARKER;
	switch (yyaccept) {
	case 0: 	goto yy4;
	case 1: 	goto yy10;
	}
yy3:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	if (yych >= 0x01) goto yy43;
yy4:
#line 63 "ext/pdo/pdo_sql_parser.re"
	{ SKIP_ONE(PDO_PARSER_TEXT); }
#line 85 "ext/pdo/pdo_sql_parser.c"
yy5:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	if (yych <= 0x00) goto yy4;
	goto yy38;
yy6:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy32;
	case ':':	goto yy35;
	default:	goto yy4;
	}
yy7:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '?':	goto yy29;
	default:	goto yy8;
	}
yy8:
#line 62 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_BIND_POS); }
#line 169 "ext/pdo/pdo_sql_parser.c"
yy9:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':	goto yy19;
	default:	goto yy13;
	}
yy10:
#line 65 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_TEXT); }
#line 179 "ext/pdo/pdo_sql_parser.c"
yy11:
	yych = *++YYCURSOR;
	switch (yych) {
	case '-':	goto yy14;
	default:	goto yy13;
	}
yy12:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy13:
	switch (yych) {
	case 0x00:
	case '"':
	case '\'':
	case ':':
	case '?':	goto yy10;
	default:	goto yy12;
	}
yy14:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case 0x00:
	case '"':
	case '\'':
	case ':':
	case '?':	goto yy17;
	case '\n':
	case '\r':	goto yy12;
	default:	goto yy14;
	}
yy16:
#line 64 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_TEXT); }
#line 216 "ext/pdo/pdo_sql_parser.c"
yy17:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '\n':
	case '\r':	goto yy16;
	default:	goto yy17;
	}
yy19:
	yyaccept = 1;
	YYMARKER = ++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case 0x00:
	case '"':
	case '\'':
	case ':':
	case '?':	goto yy21;
	case '*':	goto yy23;
	default:	goto yy19;
	}
yy21:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '*':	goto yy26;
	default:	goto yy21;
	}
yy23:
	yyaccept = 1;
	YYMARKER = ++YYCURSOR;
	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	switch (yych) {
	case 0x00:
	case '"':
	case '\'':
	case ':':
	case '?':	goto yy21;
	case '*':	goto yy23;
	case '/':	goto yy25;
	default:	goto yy19;
	}
yy25:
	yych = *++YYCURSOR;
	switch (yych) {
	case 0x00:
	case '"':
	case '\'':
	case ':':
	case '?':	goto yy16;
	default:	goto yy12;
	}
yy26:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '*':	goto yy26;
	case '/':	goto yy28;
	default:	goto yy21;
	}
yy28:
	yych = *++YYCURSOR;
	goto yy16;
yy29:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '?':	goto yy29;
	default:	goto yy31;
	}
yy31:
#line 60 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_TEXT); }
#line 296 "ext/pdo/pdo_sql_parser.c"
yy32:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy32;
	default:	goto yy34;
	}
yy34:
#line 61 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_BIND); }
#line 370 "ext/pdo/pdo_sql_parser.c"
yy35:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case ':':	goto yy35;
	default:	goto yy31;
	}
yy37:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy38:
	switch (yych) {
	case 0x00:	goto yy2;
	case '\'':	goto yy40;
	case '\\':	goto yy39;
	default:	goto yy37;
	}
yy39:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if (yych <= 0x00) goto yy2;
	goto yy37;
yy40:
	++YYCURSOR;
#line 59 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_TEXT); }
#line 400 "ext/pdo/pdo_sql_parser.c"
yy42:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy43:
	switch (yych) {
	case 0x00:	goto yy2;
	case '"':	goto yy45;
	case '\\':	goto yy44;
	default:	goto yy42;
	}
yy44:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if (yych <= 0x00) goto yy2;
	goto yy42;
yy45:
	++YYCURSOR;
#line 58 "ext/pdo/pdo_sql_parser.re"
	{ RET(PDO_PARSER_TEXT); }
#line 422 "ext/pdo/pdo_sql_parser.c"
}
#line 66 "ext/pdo/pdo_sql_parser.re"
	
}
Пример #15
0
Файл: icons.c Проект: g7/fbpanel
static inline task *
find_task (icons_priv * ics, Window win)
{
    ENTER;
    RET(g_hash_table_lookup(ics->task_list, &win));
}
Пример #16
0
int main(int argc, const char * argv[]) {
    check_same("Mov literal", 3,
        Asm<int>(
            MOV(eax, 3_d),
            RET())()
    );
        
    check_same("64 bit register MOV", 6,
        Asm<int>(
            MOV(rax, 6_q),
            RET())()
    );
    
    check_same("Negative literal", -103,
        Asm<int>(
            MOV(eax, -3_d),
            ADD(eax, - - -100_d),
            RET())()
    );
    
    check_same("Move reg to reg", 4,
        Asm<int>(
            MOV(ecx, 4_d),
            MOV(eax, ecx),
            RET())()
    );
    
    check_same("Simple jmp", 3,
        Asm<int>(
            MOV(eax, 3_d),
            JMP("a"_rel8),
            ADD(eax, 2_d),
        "a"_label,
            RET())()
    );
    
    check_same("Simple loop", 30,
        Asm<int>(
            MOV(ecx, 5_d),
            MOV(eax, 0_d),
        "start"_label,
            CMP(ecx, 0_d),
            JE("done"_rel8),
            ADD(eax, 6_d),
            DEC(ecx),
            JMP("start"_rel8),
        "done"_label,
            RET())()
    );
    
    check_same("Macro simple loop", 30,
        Asm<int>(
            MOV(eax, 0_d),
            do_x_times(5_d,
                ADD(eax, 6_d)),
            RET())()
    );

    check_same("Access arg using esp", 1,
        Asm<int>(
            MOV(eax, _[esp + 28_d]),
            RET())(1, 2, 3)
    );
    
    check_same("Access arg using ebp", 1,
        Asm<int>(
            MOV(eax, _[ebp - 0xc_b]),
            RET())(1, 2, 3)
    );
    
    check_same("Index ebp", 1,
        Asm<int>(
            MOV(ecx, 2_d),
            MOV(eax, _[ebp + ecx * 2_b - 0x10_d]),
            RET())(1, 2, 3)
    );
    
    check_same("Access args using ebp", 5,
        Asm<int>(
            MOV(edx, 0_d),
            MOV(eax, _[ebp - 0xc_b]),
            MOV(ecx, _[ebp - 0x10_b]),
            DIV(ecx),
            MOV(ecx, _[ebp - 0x14_b]),
            DIV(ecx),
            RET())(100, 5, 4)
    );
    
    check_same("Access arg with 64 bit reg", 2,
        Asm<int>(
            MOV(rax, _[rsp + 24_d]),
            RET())(1, 2, 3)
    );
    
    check_same("Access second register zero", 1,
        Asm<int>(
            MOV(ecx, 0_d),
            MOV(eax, _[esp + 28_d + ecx]),
            RET())(1, 2, 3)
    );
    
    check_same("Access second register with offset", 1,
        Asm<int>(
            MOV(ecx, 8_d),
            MOV(eax, _[esp + 20_d + ecx]),
            RET())(1, 2, 3)
    );
    
    check_same("Access second register with offset and 1 scale", 1,
        Asm<int>(
            MOV(ecx, 8_d),
            MOV(eax, _[esp + 20_d + ecx * 1_b]),
            RET())(1, 2, 3)
    );

    check_same("Access second register with offset and 4 scale", 1,
        Asm<int>(
            MOV(ecx, 2_d),
            MOV(eax, _[esp + 20_d + ecx * 4_b]),
            RET())(1, 2, 3)
    );
    
    check_same("Call c function from assembly", 66,
        Asm<int>(
            MOV(rbx, _[rsp + 8_d]),
            CALL(rbx),
            RET())(&ret66)
    );

    check_same("Call c function from esp directly", 66,
        Asm<int>(
            CALL(_[rsp + 8_d]),
            RET())(&ret66)
    );
    
     check_same("Call c function from ebp directly", 66,
        Asm<int>(
            CALL(_[rbp - 0x10_d]),
            RET())(&ret66)
    );

  //  auto p = Asm<int>(CALL(_[rbp - 0xc_d]));
  // Print<decltype(p)::program> x{};

    std::cout << "done" << std::endl;
    return 0;
}
Пример #17
0
/*
 * Function that does the real stuff.
 */
bpf_filter_func
bpf_jit_compile(struct bpf_insn *prog, u_int nins, size_t *size)
{
	bpf_bin_stream stream;
	struct bpf_insn *ins;
	int flags, fret, fpkt, fmem, fjmp, flen;
	u_int i, pass;

	/*
	 * NOTE: Do not modify the name of this variable, as it's used by
	 * the macros to emit code.
	 */
	emit_func emitm;

	flags = bpf_jit_optimize(prog, nins);
	fret = (flags & BPF_JIT_FRET) != 0;
	fpkt = (flags & BPF_JIT_FPKT) != 0;
	fmem = (flags & BPF_JIT_FMEM) != 0;
	fjmp = (flags & BPF_JIT_FJMP) != 0;
	flen = (flags & BPF_JIT_FLEN) != 0;

	if (fret)
		nins = 1;

	memset(&stream, 0, sizeof(stream));

	/* Allocate the reference table for the jumps. */
	if (fjmp) {
#ifdef _KERNEL
		stream.refs = malloc((nins + 1) * sizeof(u_int), M_BPFJIT,
		    M_NOWAIT | M_ZERO);
#else
		stream.refs = calloc(nins + 1, sizeof(u_int));
#endif
		if (stream.refs == NULL)
			return (NULL);
	}

	/*
	 * The first pass will emit the lengths of the instructions
	 * to create the reference table.
	 */
	emitm = emit_length;

	for (pass = 0; pass < 2; pass++) {
		ins = prog;

		/* Create the procedure header. */
		if (fmem) {
			PUSH(RBP);
			MOVrq(RSP, RBP);
			SUBib(BPF_MEMWORDS * sizeof(uint32_t), RSP);
		}
		if (flen)
			MOVrd2(ESI, R9D);
		if (fpkt) {
			MOVrq2(RDI, R8);
			MOVrd(EDX, EDI);
		}

		for (i = 0; i < nins; i++) {
			stream.bpf_pc++;

			switch (ins->code) {
			default:
#ifdef _KERNEL
				return (NULL);
#else
				abort();
#endif

			case BPF_RET|BPF_K:
				MOVid(ins->k, EAX);
				if (fmem)
					LEAVE();
				RET();
				break;

			case BPF_RET|BPF_A:
				if (fmem)
					LEAVE();
				RET();
				break;

			case BPF_LD|BPF_W|BPF_ABS:
				MOVid(ins->k, ESI);
				CMPrd(EDI, ESI);
				JAb(12);
				MOVrd(EDI, ECX);
				SUBrd(ESI, ECX);
				CMPid(sizeof(int32_t), ECX);
				if (fmem) {
					JAEb(4);
					ZEROrd(EAX);
					LEAVE();
				} else {
					JAEb(3);
					ZEROrd(EAX);
				}
				RET();
				MOVrq3(R8, RCX);
				MOVobd(RCX, RSI, EAX);
				BSWAP(EAX);
				break;

			case BPF_LD|BPF_H|BPF_ABS:
				ZEROrd(EAX);
				MOVid(ins->k, ESI);
				CMPrd(EDI, ESI);
				JAb(12);
				MOVrd(EDI, ECX);
				SUBrd(ESI, ECX);
				CMPid(sizeof(int16_t), ECX);
				if (fmem) {
					JAEb(2);
					LEAVE();
				} else
					JAEb(1);
				RET();
				MOVrq3(R8, RCX);
				MOVobw(RCX, RSI, AX);
				SWAP_AX();
				break;

			case BPF_LD|BPF_B|BPF_ABS:
				ZEROrd(EAX);
				MOVid(ins->k, ESI);
				CMPrd(EDI, ESI);
				if (fmem) {
					JBb(2);
					LEAVE();
				} else
					JBb(1);
				RET();
				MOVrq3(R8, RCX);
				MOVobb(RCX, RSI, AL);
				break;

			case BPF_LD|BPF_W|BPF_LEN:
				MOVrd3(R9D, EAX);
				break;

			case BPF_LDX|BPF_W|BPF_LEN:
				MOVrd3(R9D, EDX);
				break;

			case BPF_LD|BPF_W|BPF_IND:
				CMPrd(EDI, EDX);
				JAb(27);
				MOVid(ins->k, ESI);
				MOVrd(EDI, ECX);
				SUBrd(EDX, ECX);
				CMPrd(ESI, ECX);
				JBb(14);
				ADDrd(EDX, ESI);
				MOVrd(EDI, ECX);
				SUBrd(ESI, ECX);
				CMPid(sizeof(int32_t), ECX);
				if (fmem) {
					JAEb(4);
					ZEROrd(EAX);
					LEAVE();
				} else {
					JAEb(3);
					ZEROrd(EAX);
				}
				RET();
				MOVrq3(R8, RCX);
				MOVobd(RCX, RSI, EAX);
				BSWAP(EAX);
				break;

			case BPF_LD|BPF_H|BPF_IND:
				ZEROrd(EAX);
				CMPrd(EDI, EDX);
				JAb(27);
				MOVid(ins->k, ESI);
				MOVrd(EDI, ECX);
				SUBrd(EDX, ECX);
				CMPrd(ESI, ECX);
				JBb(14);
				ADDrd(EDX, ESI);
				MOVrd(EDI, ECX);
				SUBrd(ESI, ECX);
				CMPid(sizeof(int16_t), ECX);
				if (fmem) {
					JAEb(2);
					LEAVE();
				} else
					JAEb(1);
				RET();
				MOVrq3(R8, RCX);
				MOVobw(RCX, RSI, AX);
				SWAP_AX();
				break;

			case BPF_LD|BPF_B|BPF_IND:
				ZEROrd(EAX);
				CMPrd(EDI, EDX);
				JAEb(13);
				MOVid(ins->k, ESI);
				MOVrd(EDI, ECX);
				SUBrd(EDX, ECX);
				CMPrd(ESI, ECX);
				if (fmem) {
					JAb(2);
					LEAVE();
				} else
					JAb(1);
				RET();
				MOVrq3(R8, RCX);
				ADDrd(EDX, ESI);
				MOVobb(RCX, RSI, AL);
				break;

			case BPF_LDX|BPF_MSH|BPF_B:
				MOVid(ins->k, ESI);
				CMPrd(EDI, ESI);
				if (fmem) {
					JBb(4);
					ZEROrd(EAX);
					LEAVE();
				} else {
					JBb(3);
					ZEROrd(EAX);
				}
				RET();
				ZEROrd(EDX);
				MOVrq3(R8, RCX);
				MOVobb(RCX, RSI, DL);
				ANDib(0x0f, DL);
				SHLib(2, EDX);
				break;

			case BPF_LD|BPF_IMM:
				MOVid(ins->k, EAX);
				break;

			case BPF_LDX|BPF_IMM:
				MOVid(ins->k, EDX);
				break;

			case BPF_LD|BPF_MEM:
				MOVid(ins->k * sizeof(uint32_t), ESI);
				MOVobd(RSP, RSI, EAX);
				break;

			case BPF_LDX|BPF_MEM:
				MOVid(ins->k * sizeof(uint32_t), ESI);
				MOVobd(RSP, RSI, EDX);
				break;

			case BPF_ST:
				/*
				 * XXX this command and the following could
				 * be optimized if the previous instruction
				 * was already of this type
				 */
				MOVid(ins->k * sizeof(uint32_t), ESI);
				MOVomd(EAX, RSP, RSI);
				break;

			case BPF_STX:
				MOVid(ins->k * sizeof(uint32_t), ESI);
				MOVomd(EDX, RSP, RSI);
				break;

			case BPF_JMP|BPF_JA:
				JUMP(ins->k);
				break;

			case BPF_JMP|BPF_JGT|BPF_K:
				if (ins->jt == ins->jf) {
					JUMP(ins->jt);
					break;
				}
				CMPid(ins->k, EAX);
				JCC(JA, JBE);
				break;

			case BPF_JMP|BPF_JGE|BPF_K:
				if (ins->jt == ins->jf) {
					JUMP(ins->jt);
					break;
				}
				CMPid(ins->k, EAX);
				JCC(JAE, JB);
				break;

			case BPF_JMP|BPF_JEQ|BPF_K:
				if (ins->jt == ins->jf) {
					JUMP(ins->jt);
					break;
				}
				CMPid(ins->k, EAX);
				JCC(JE, JNE);
				break;

			case BPF_JMP|BPF_JSET|BPF_K:
				if (ins->jt == ins->jf) {
					JUMP(ins->jt);
					break;
				}
				TESTid(ins->k, EAX);
				JCC(JNE, JE);
				break;

			case BPF_JMP|BPF_JGT|BPF_X:
				if (ins->jt == ins->jf) {
					JUMP(ins->jt);
					break;
				}
				CMPrd(EDX, EAX);
				JCC(JA, JBE);
				break;

			case BPF_JMP|BPF_JGE|BPF_X:
				if (ins->jt == ins->jf) {
					JUMP(ins->jt);
					break;
				}
				CMPrd(EDX, EAX);
				JCC(JAE, JB);
				break;

			case BPF_JMP|BPF_JEQ|BPF_X:
				if (ins->jt == ins->jf) {
					JUMP(ins->jt);
					break;
				}
				CMPrd(EDX, EAX);
				JCC(JE, JNE);
				break;

			case BPF_JMP|BPF_JSET|BPF_X:
				if (ins->jt == ins->jf) {
					JUMP(ins->jt);
					break;
				}
				TESTrd(EDX, EAX);
				JCC(JNE, JE);
				break;

			case BPF_ALU|BPF_ADD|BPF_X:
				ADDrd(EDX, EAX);
				break;

			case BPF_ALU|BPF_SUB|BPF_X:
				SUBrd(EDX, EAX);
				break;

			case BPF_ALU|BPF_MUL|BPF_X:
				MOVrd(EDX, ECX);
				MULrd(EDX);
				MOVrd(ECX, EDX);
				break;

			case BPF_ALU|BPF_DIV|BPF_X:
				TESTrd(EDX, EDX);
				if (fmem) {
					JNEb(4);
					ZEROrd(EAX);
					LEAVE();
				} else {
					JNEb(3);
					ZEROrd(EAX);
				}
				RET();
				MOVrd(EDX, ECX);
				ZEROrd(EDX);
				DIVrd(ECX);
				MOVrd(ECX, EDX);
				break;

			case BPF_ALU|BPF_AND|BPF_X:
				ANDrd(EDX, EAX);
				break;

			case BPF_ALU|BPF_OR|BPF_X:
				ORrd(EDX, EAX);
				break;

			case BPF_ALU|BPF_LSH|BPF_X:
				MOVrd(EDX, ECX);
				SHL_CLrb(EAX);
				break;

			case BPF_ALU|BPF_RSH|BPF_X:
				MOVrd(EDX, ECX);
				SHR_CLrb(EAX);
				break;

			case BPF_ALU|BPF_ADD|BPF_K:
				ADD_EAXi(ins->k);
				break;

			case BPF_ALU|BPF_SUB|BPF_K:
				SUB_EAXi(ins->k);
				break;

			case BPF_ALU|BPF_MUL|BPF_K:
				MOVrd(EDX, ECX);
				MOVid(ins->k, EDX);
				MULrd(EDX);
				MOVrd(ECX, EDX);
				break;

			case BPF_ALU|BPF_DIV|BPF_K:
				MOVrd(EDX, ECX);
				ZEROrd(EDX);
				MOVid(ins->k, ESI);
				DIVrd(ESI);
				MOVrd(ECX, EDX);
				break;

			case BPF_ALU|BPF_AND|BPF_K:
				ANDid(ins->k, EAX);
				break;

			case BPF_ALU|BPF_OR|BPF_K:
				ORid(ins->k, EAX);
				break;

			case BPF_ALU|BPF_LSH|BPF_K:
				SHLib((ins->k) & 0xff, EAX);
				break;

			case BPF_ALU|BPF_RSH|BPF_K:
				SHRib((ins->k) & 0xff, EAX);
				break;

			case BPF_ALU|BPF_NEG:
				NEGd(EAX);
				break;

			case BPF_MISC|BPF_TAX:
				MOVrd(EAX, EDX);
				break;

			case BPF_MISC|BPF_TXA:
				MOVrd(EDX, EAX);
				break;
			}
			ins++;
		}

		if (pass > 0)
			continue;

		*size = stream.cur_ip;
#ifdef _KERNEL
		stream.ibuf = malloc(*size, M_BPFJIT, M_NOWAIT);
		if (stream.ibuf == NULL)
			break;
#else
		stream.ibuf = mmap(NULL, *size, PROT_READ | PROT_WRITE,
		    MAP_ANON, -1, 0);
		if (stream.ibuf == MAP_FAILED) {
			stream.ibuf = NULL;
			break;
		}
#endif

		/*
		 * Modify the reference table to contain the offsets and
		 * not the lengths of the instructions.
		 */
		if (fjmp)
			for (i = 1; i < nins + 1; i++)
				stream.refs[i] += stream.refs[i - 1];

		/* Reset the counters. */
		stream.cur_ip = 0;
		stream.bpf_pc = 0;

		/* The second pass creates the actual code. */
		emitm = emit_code;
	}

	/*
	 * The reference table is needed only during compilation,
	 * now we can free it.
	 */
	if (fjmp)
#ifdef _KERNEL
		free(stream.refs, M_BPFJIT);
#else
		free(stream.refs);
#endif

#ifndef _KERNEL
	if (stream.ibuf != NULL &&
	    mprotect(stream.ibuf, *size, PROT_READ | PROT_EXEC) != 0) {
		munmap(stream.ibuf, *size);
		stream.ibuf = NULL;
	}
#endif

	return ((bpf_filter_func)stream.ibuf);
}
Пример #18
0
int scan(Scanner *s){
	uchar *cursor = s->cur;
std:
	s->tok = cursor;
#line 133 "cnokw.re"



#line 130 "cnokw.c"
{
	YYCTYPE yych;
	unsigned int yyaccept = 0;
	if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
	yych = *YYCURSOR;
	switch (yych) {
	case '\t':
	case '\v':
	case '\f':
	case ' ':	goto yy4;
	case '\n':	goto yy7;
	case '!':	goto yy9;
	case '"':	goto yy11;
	case '%':	goto yy12;
	case '&':	goto yy14;
	case '\'':	goto yy16;
	case '(':	goto yy17;
	case ')':	goto yy19;
	case '*':	goto yy21;
	case '+':	goto yy23;
	case ',':	goto yy25;
	case '-':	goto yy27;
	case '.':	goto yy29;
	case '/':	goto yy31;
	case '0':	goto yy33;
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy35;
	case ':':	goto yy37;
	case ';':	goto yy39;
	case '<':	goto yy41;
	case '=':	goto yy43;
	case '>':	goto yy45;
	case '?':	goto yy47;
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy49;
	case '[':	goto yy52;
	case ']':	goto yy54;
	case '^':	goto yy56;
	case '{':	goto yy58;
	case '|':	goto yy60;
	case '}':	goto yy62;
	case '~':	goto yy64;
	default:	goto yy2;
	}
yy2:
	++YYCURSOR;
yy3:
#line 208 "cnokw.re"
	{
		printf("unexpected character: %c\n", *s->tok);
		goto std;
	    }
#line 241 "cnokw.c"
yy4:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '\t':
	case '\v':
	case '\f':
	case ' ':	goto yy4;
	default:	goto yy6;
	}
yy6:
#line 198 "cnokw.re"
	{ goto std; }
#line 256 "cnokw.c"
yy7:
	++YYCURSOR;
#line 201 "cnokw.re"
	{
		if(cursor == s->eof) RET(EOI);
		s->pos = cursor; s->line++;
		goto std;
	    }
#line 265 "cnokw.c"
yy9:
	yych = *++YYCURSOR;
	switch (yych) {
	case '=':	goto yy66;
	default:	goto yy10;
	}
yy10:
#line 184 "cnokw.re"
	{ RET('!'); }
#line 275 "cnokw.c"
yy11:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '\n':	goto yy3;
	default:	goto yy69;
	}
yy12:
	yych = *++YYCURSOR;
	switch (yych) {
	case '=':	goto yy74;
	default:	goto yy13;
	}
yy13:
#line 190 "cnokw.re"
	{ RET('%'); }
#line 292 "cnokw.c"
yy14:
	yych = *++YYCURSOR;
	switch (yych) {
	case '&':	goto yy76;
	case '=':	goto yy78;
	default:	goto yy15;
	}
yy15:
#line 183 "cnokw.re"
	{ RET('&'); }
#line 303 "cnokw.c"
yy16:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '\n':	goto yy3;
	default:	goto yy81;
	}
yy17:
	++YYCURSOR;
#line 178 "cnokw.re"
	{ RET('('); }
#line 315 "cnokw.c"
yy19:
	++YYCURSOR;
#line 179 "cnokw.re"
	{ RET(')'); }
#line 320 "cnokw.c"
yy21:
	yych = *++YYCURSOR;
	switch (yych) {
	case '=':	goto yy84;
	default:	goto yy22;
	}
yy22:
#line 188 "cnokw.re"
	{ RET('*'); }
#line 330 "cnokw.c"
yy23:
	yych = *++YYCURSOR;
	switch (yych) {
	case '+':	goto yy86;
	case '=':	goto yy88;
	default:	goto yy24;
	}
yy24:
#line 187 "cnokw.re"
	{ RET('+'); }
#line 341 "cnokw.c"
yy25:
	++YYCURSOR;
#line 175 "cnokw.re"
	{ RET(','); }
#line 346 "cnokw.c"
yy27:
	yych = *++YYCURSOR;
	switch (yych) {
	case '-':	goto yy90;
	case '=':	goto yy92;
	case '>':	goto yy94;
	default:	goto yy28;
	}
yy28:
#line 186 "cnokw.re"
	{ RET('-'); }
#line 358 "cnokw.c"
yy29:
	yyaccept = 1;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '.':	goto yy96;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy97;
	default:	goto yy30;
	}
yy30:
#line 182 "cnokw.re"
	{ RET('.'); }
#line 379 "cnokw.c"
yy31:
	yych = *++YYCURSOR;
	switch (yych) {
	case '*':	goto yy100;
	case '=':	goto yy102;
	default:	goto yy32;
	}
yy32:
#line 189 "cnokw.re"
	{ RET('/'); }
#line 390 "cnokw.c"
yy33:
	yyaccept = 2;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'X':
	case 'x':	goto yy107;
	default:	goto yy36;
	}
yy34:
#line 142 "cnokw.re"
	{ RET(ICON); }
#line 402 "cnokw.c"
yy35:
	yyaccept = 2;
	YYMARKER = ++YYCURSOR;
	if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
	yych = *YYCURSOR;
yy36:
	switch (yych) {
	case '.':	goto yy97;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy35;
	case 'E':
	case 'e':	goto yy104;
	case 'L':
	case 'U':
	case 'l':
	case 'u':	goto yy105;
	default:	goto yy34;
	}
yy37:
	++YYCURSOR;
#line 176 "cnokw.re"
	{ RET(':'); }
#line 433 "cnokw.c"
yy39:
	++YYCURSOR;
#line 172 "cnokw.re"
	{ RET(';'); }
#line 438 "cnokw.c"
yy41:
	yych = *++YYCURSOR;
	switch (yych) {
	case '<':	goto yy108;
	case '=':	goto yy110;
	default:	goto yy42;
	}
yy42:
#line 191 "cnokw.re"
	{ RET('<'); }
#line 449 "cnokw.c"
yy43:
	yych = *++YYCURSOR;
	switch (yych) {
	case '=':	goto yy112;
	default:	goto yy44;
	}
yy44:
#line 177 "cnokw.re"
	{ RET('='); }
#line 459 "cnokw.c"
yy45:
	yych = *++YYCURSOR;
	switch (yych) {
	case '=':	goto yy114;
	case '>':	goto yy116;
	default:	goto yy46;
	}
yy46:
#line 192 "cnokw.re"
	{ RET('>'); }
#line 470 "cnokw.c"
yy47:
	++YYCURSOR;
#line 195 "cnokw.re"
	{ RET('?'); }
#line 475 "cnokw.c"
yy49:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy49;
	default:	goto yy51;
	}
yy51:
#line 138 "cnokw.re"
	{ RET(ID); }
#line 549 "cnokw.c"
yy52:
	++YYCURSOR;
#line 180 "cnokw.re"
	{ RET('['); }
#line 554 "cnokw.c"
yy54:
	++YYCURSOR;
#line 181 "cnokw.re"
	{ RET(']'); }
#line 559 "cnokw.c"
yy56:
	yych = *++YYCURSOR;
	switch (yych) {
	case '=':	goto yy118;
	default:	goto yy57;
	}
yy57:
#line 193 "cnokw.re"
	{ RET('^'); }
#line 569 "cnokw.c"
yy58:
	++YYCURSOR;
#line 173 "cnokw.re"
	{ RET('{'); }
#line 574 "cnokw.c"
yy60:
	yych = *++YYCURSOR;
	switch (yych) {
	case '=':	goto yy120;
	case '|':	goto yy122;
	default:	goto yy61;
	}
yy61:
#line 194 "cnokw.re"
	{ RET('|'); }
#line 585 "cnokw.c"
yy62:
	++YYCURSOR;
#line 174 "cnokw.re"
	{ RET('}'); }
#line 590 "cnokw.c"
yy64:
	++YYCURSOR;
#line 185 "cnokw.re"
	{ RET('~'); }
#line 595 "cnokw.c"
yy66:
	++YYCURSOR;
#line 171 "cnokw.re"
	{ RET(NEQ); }
#line 600 "cnokw.c"
yy68:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy69:
	switch (yych) {
	case '\n':	goto yy70;
	case '"':	goto yy71;
	case '\\':	goto yy73;
	default:	goto yy68;
	}
yy70:
	YYCURSOR = YYMARKER;
	switch (yyaccept) {
	case 0: 	goto yy3;
	case 1: 	goto yy30;
	case 2: 	goto yy34;
	default:	goto yy99;
	}
yy71:
	++YYCURSOR;
#line 148 "cnokw.re"
	{ RET(SCON); }
#line 624 "cnokw.c"
yy73:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '"':
	case '\'':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '?':
	case '\\':
	case 'a':
	case 'b':
	case 'f':
	case 'n':
	case 'r':
	case 't':
	case 'v':	goto yy68;
	case 'x':	goto yy124;
	default:	goto yy70;
	}
yy74:
	++YYCURSOR;
#line 157 "cnokw.re"
	{ RET(MODEQ); }
#line 656 "cnokw.c"
yy76:
	++YYCURSOR;
#line 166 "cnokw.re"
	{ RET(ANDAND); }
#line 661 "cnokw.c"
yy78:
	++YYCURSOR;
#line 158 "cnokw.re"
	{ RET(ANDEQ); }
#line 666 "cnokw.c"
yy80:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy81:
	switch (yych) {
	case '\n':	goto yy70;
	case '\'':	goto yy82;
	case '\\':	goto yy83;
	default:	goto yy80;
	}
yy82:
	++YYCURSOR;
	goto yy34;
yy83:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '"':
	case '\'':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '?':
	case '\\':
	case 'a':
	case 'b':
	case 'f':
	case 'n':
	case 'r':
	case 't':
	case 'v':	goto yy80;
	case 'x':	goto yy125;
	default:	goto yy70;
	}
yy84:
	++YYCURSOR;
#line 155 "cnokw.re"
	{ RET(MULEQ); }
#line 712 "cnokw.c"
yy86:
	++YYCURSOR;
#line 163 "cnokw.re"
	{ RET(INCR); }
#line 717 "cnokw.c"
yy88:
	++YYCURSOR;
#line 153 "cnokw.re"
	{ RET(ADDEQ); }
#line 722 "cnokw.c"
yy90:
	++YYCURSOR;
#line 164 "cnokw.re"
	{ RET(DECR); }
#line 727 "cnokw.c"
yy92:
	++YYCURSOR;
#line 154 "cnokw.re"
	{ RET(SUBEQ); }
#line 732 "cnokw.c"
yy94:
	++YYCURSOR;
#line 165 "cnokw.re"
	{ RET(DEREF); }
#line 737 "cnokw.c"
yy96:
	yych = *++YYCURSOR;
	switch (yych) {
	case '.':	goto yy126;
	default:	goto yy70;
	}
yy97:
	yyaccept = 3;
	YYMARKER = ++YYCURSOR;
	if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy97;
	case 'E':
	case 'e':	goto yy104;
	case 'F':
	case 'L':
	case 'f':
	case 'l':	goto yy128;
	default:	goto yy99;
	}
yy99:
#line 145 "cnokw.re"
	{ RET(FCON); }
#line 771 "cnokw.c"
yy100:
	++YYCURSOR;
#line 136 "cnokw.re"
	{ goto comment; }
#line 776 "cnokw.c"
yy102:
	++YYCURSOR;
#line 156 "cnokw.re"
	{ RET(DIVEQ); }
#line 781 "cnokw.c"
yy104:
	yych = *++YYCURSOR;
	switch (yych) {
	case '+':
	case '-':	goto yy129;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy130;
	default:	goto yy70;
	}
yy105:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case 'L':
	case 'U':
	case 'l':
	case 'u':	goto yy105;
	default:	goto yy34;
	}
yy107:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':	goto yy132;
	default:	goto yy70;
	}
yy108:
	yych = *++YYCURSOR;
	switch (yych) {
	case '=':	goto yy134;
	default:	goto yy109;
	}
yy109:
#line 162 "cnokw.re"
	{ RET(LSHIFT); }
#line 846 "cnokw.c"
yy110:
	++YYCURSOR;
#line 168 "cnokw.re"
	{ RET(LEQ); }
#line 851 "cnokw.c"
yy112:
	++YYCURSOR;
#line 170 "cnokw.re"
	{ RET(EQL); }
#line 856 "cnokw.c"
yy114:
	++YYCURSOR;
#line 169 "cnokw.re"
	{ RET(GEQ); }
#line 861 "cnokw.c"
yy116:
	yych = *++YYCURSOR;
	switch (yych) {
	case '=':	goto yy136;
	default:	goto yy117;
	}
yy117:
#line 161 "cnokw.re"
	{ RET(RSHIFT); }
#line 871 "cnokw.c"
yy118:
	++YYCURSOR;
#line 159 "cnokw.re"
	{ RET(XOREQ); }
#line 876 "cnokw.c"
yy120:
	++YYCURSOR;
#line 160 "cnokw.re"
	{ RET(OREQ); }
#line 881 "cnokw.c"
yy122:
	++YYCURSOR;
#line 167 "cnokw.re"
	{ RET(OROR); }
#line 886 "cnokw.c"
yy124:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':	goto yy68;
	default:	goto yy70;
	}
yy125:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':	goto yy80;
	default:	goto yy70;
	}
yy126:
	++YYCURSOR;
#line 150 "cnokw.re"
	{ RET(ELLIPSIS); }
#line 949 "cnokw.c"
yy128:
	++YYCURSOR;
	goto yy99;
yy129:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy130;
	default:	goto yy70;
	}
yy130:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy130;
	case 'F':
	case 'L':
	case 'f':
	case 'l':	goto yy128;
	default:	goto yy99;
	}
yy132:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':	goto yy132;
	case 'L':
	case 'U':
	case 'l':
	case 'u':	goto yy105;
	default:	goto yy34;
	}
yy134:
	++YYCURSOR;
#line 152 "cnokw.re"
	{ RET(LSHIFTEQ); }
#line 1026 "cnokw.c"
yy136:
	++YYCURSOR;
#line 151 "cnokw.re"
	{ RET(RSHIFTEQ); }
#line 1031 "cnokw.c"
}
#line 212 "cnokw.re"


comment:

#line 1038 "cnokw.c"
{
	YYCTYPE yych;
	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	switch (yych) {
	case '\n':	goto yy142;
	case '*':	goto yy144;
	default:	goto yy140;
	}
yy140:
	++YYCURSOR;
yy141:
#line 223 "cnokw.re"
	{ goto comment; }
#line 1053 "cnokw.c"
yy142:
	++YYCURSOR;
#line 218 "cnokw.re"
	{
		if(cursor == s->eof) RET(EOI);
		s->tok = s->pos = cursor; s->line++;
		goto comment;
	    }
#line 1062 "cnokw.c"
yy144:
	yych = *++YYCURSOR;
	switch (yych) {
	case '/':	goto yy145;
	default:	goto yy141;
	}
yy145:
	++YYCURSOR;
#line 216 "cnokw.re"
	{ goto std; }
#line 1073 "cnokw.c"
}
#line 224 "cnokw.re"

}
Пример #19
0
static void
mmu_open(void)
{
    RET(-1);
}
Пример #20
0
int scan(Scanner *s){
	uchar *cursor = s->cur;
std:
	s->tok = cursor;
#line 135 "cunroll.re"



#line 130 "<stdout>"
{
	YYCTYPE yych;
	unsigned int yyaccept = 0;

	if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
	yych = *YYCURSOR;
	switch (yych) {
	case '\t':
	case '\v':
	case '\f':
	case ' ':	goto yy58;
	case '\n':	goto yy60;
	case '!':	goto yy34;
	case '"':	goto yy13;
	case '%':	goto yy24;
	case '&':	goto yy26;
	case '\'':	goto yy9;
	case '(':	goto yy46;
	case ')':	goto yy48;
	case '*':	goto yy22;
	case '+':	goto yy18;
	case ',':	goto yy42;
	case '-':	goto yy20;
	case '.':	goto yy11;
	case '/':	goto yy2;
	case '0':	goto yy6;
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy8;
	case ':':	goto yy44;
	case ';':	goto yy36;
	case '<':	goto yy16;
	case '=':	goto yy32;
	case '>':	goto yy14;
	case '?':	goto yy56;
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy4;
	case '[':	goto yy50;
	case ']':	goto yy52;
	case '^':	goto yy28;
	case '{':	goto yy38;
	case '|':	goto yy30;
	case '}':	goto yy40;
	case '~':	goto yy54;
	default:	goto yy62;
	}
yy2:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':	goto yy183;
	case '=':	goto yy181;
	default:	goto yy3;
	}
yy3:
#line 200 "cunroll.re"
	{ RET('/'); }
#line 244 "<stdout>"
yy4:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy164;
	default:	goto yy5;
	}
yy5:
#line 141 "cunroll.re"
	{ RET(ID); }
#line 316 "<stdout>"
yy6:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'L':
	case 'U':
	case 'l':
	case 'u':	goto yy140;
	case 'X':
	case 'x':	goto yy157;
	default:	goto yy156;
	}
yy7:
#line 153 "cunroll.re"
	{ RET(ICON); }
#line 332 "<stdout>"
yy8:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	goto yy138;
yy9:
	yyaccept = 1;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '\n':	goto yy10;
	default:	goto yy128;
	}
yy10:
#line 219 "cunroll.re"
	{
		printf("unexpected character: %c\n", *s->tok);
		goto std;
	    }
#line 350 "<stdout>"
yy11:
	yyaccept = 2;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '.':	goto yy116;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy117;
	default:	goto yy12;
	}
yy12:
#line 193 "cunroll.re"
	{ RET('.'); }
#line 371 "<stdout>"
yy13:
	yyaccept = 1;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '\n':	goto yy10;
	default:	goto yy106;
	}
yy14:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '=':	goto yy99;
	case '>':	goto yy101;
	default:	goto yy15;
	}
yy15:
#line 203 "cunroll.re"
	{ RET('>'); }
#line 389 "<stdout>"
yy16:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '<':	goto yy95;
	case '=':	goto yy93;
	default:	goto yy17;
	}
yy17:
#line 202 "cunroll.re"
	{ RET('<'); }
#line 400 "<stdout>"
yy18:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '+':	goto yy89;
	case '=':	goto yy91;
	default:	goto yy19;
	}
yy19:
#line 198 "cunroll.re"
	{ RET('+'); }
#line 411 "<stdout>"
yy20:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '-':	goto yy85;
	case '=':	goto yy87;
	case '>':	goto yy83;
	default:	goto yy21;
	}
yy21:
#line 197 "cunroll.re"
	{ RET('-'); }
#line 423 "<stdout>"
yy22:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '=':	goto yy81;
	default:	goto yy23;
	}
yy23:
#line 199 "cunroll.re"
	{ RET('*'); }
#line 433 "<stdout>"
yy24:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '=':	goto yy79;
	default:	goto yy25;
	}
yy25:
#line 201 "cunroll.re"
	{ RET('%'); }
#line 443 "<stdout>"
yy26:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '&':	goto yy75;
	case '=':	goto yy77;
	default:	goto yy27;
	}
yy27:
#line 194 "cunroll.re"
	{ RET('&'); }
#line 454 "<stdout>"
yy28:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '=':	goto yy73;
	default:	goto yy29;
	}
yy29:
#line 204 "cunroll.re"
	{ RET('^'); }
#line 464 "<stdout>"
yy30:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '=':	goto yy71;
	case '|':	goto yy69;
	default:	goto yy31;
	}
yy31:
#line 205 "cunroll.re"
	{ RET('|'); }
#line 475 "<stdout>"
yy32:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '=':	goto yy67;
	default:	goto yy33;
	}
yy33:
#line 188 "cunroll.re"
	{ RET('='); }
#line 485 "<stdout>"
yy34:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '=':	goto yy65;
	default:	goto yy35;
	}
yy35:
#line 195 "cunroll.re"
	{ RET('!'); }
#line 495 "<stdout>"
yy36:
	++YYCURSOR;
#line 183 "cunroll.re"
	{ RET(';'); }
#line 500 "<stdout>"
yy38:
	++YYCURSOR;
#line 184 "cunroll.re"
	{ RET('{'); }
#line 505 "<stdout>"
yy40:
	++YYCURSOR;
#line 185 "cunroll.re"
	{ RET('}'); }
#line 510 "<stdout>"
yy42:
	++YYCURSOR;
#line 186 "cunroll.re"
	{ RET(','); }
#line 515 "<stdout>"
yy44:
	++YYCURSOR;
#line 187 "cunroll.re"
	{ RET(':'); }
#line 520 "<stdout>"
yy46:
	++YYCURSOR;
#line 189 "cunroll.re"
	{ RET('('); }
#line 525 "<stdout>"
yy48:
	++YYCURSOR;
#line 190 "cunroll.re"
	{ RET(')'); }
#line 530 "<stdout>"
yy50:
	++YYCURSOR;
#line 191 "cunroll.re"
	{ RET('['); }
#line 535 "<stdout>"
yy52:
	++YYCURSOR;
#line 192 "cunroll.re"
	{ RET(']'); }
#line 540 "<stdout>"
yy54:
	++YYCURSOR;
#line 196 "cunroll.re"
	{ RET('~'); }
#line 545 "<stdout>"
yy56:
	++YYCURSOR;
#line 206 "cunroll.re"
	{ RET('?'); }
#line 550 "<stdout>"
yy58:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy64;
yy59:
#line 209 "cunroll.re"
	{ goto std; }
#line 558 "<stdout>"
yy60:
	++YYCURSOR;
#line 212 "cunroll.re"
	{
		if(cursor == s->eof) RET(EOI);
		s->pos = cursor; s->line++;
		goto std;
	    }
#line 567 "<stdout>"
yy62:
	yych = *++YYCURSOR;
	goto yy10;
yy63:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy64:
	switch (yych) {
	case '\t':
	case '\v':
	case '\f':
	case ' ':	goto yy63;
	default:	goto yy59;
	}
yy65:
	++YYCURSOR;
#line 182 "cunroll.re"
	{ RET(NEQ); }
#line 587 "<stdout>"
yy67:
	++YYCURSOR;
#line 181 "cunroll.re"
	{ RET(EQL); }
#line 592 "<stdout>"
yy69:
	++YYCURSOR;
#line 178 "cunroll.re"
	{ RET(OROR); }
#line 597 "<stdout>"
yy71:
	++YYCURSOR;
#line 171 "cunroll.re"
	{ RET(OREQ); }
#line 602 "<stdout>"
yy73:
	++YYCURSOR;
#line 170 "cunroll.re"
	{ RET(XOREQ); }
#line 607 "<stdout>"
yy75:
	++YYCURSOR;
#line 177 "cunroll.re"
	{ RET(ANDAND); }
#line 612 "<stdout>"
yy77:
	++YYCURSOR;
#line 169 "cunroll.re"
	{ RET(ANDEQ); }
#line 617 "<stdout>"
yy79:
	++YYCURSOR;
#line 168 "cunroll.re"
	{ RET(MODEQ); }
#line 622 "<stdout>"
yy81:
	++YYCURSOR;
#line 166 "cunroll.re"
	{ RET(MULEQ); }
#line 627 "<stdout>"
yy83:
	++YYCURSOR;
#line 176 "cunroll.re"
	{ RET(DEREF); }
#line 632 "<stdout>"
yy85:
	++YYCURSOR;
#line 175 "cunroll.re"
	{ RET(DECR); }
#line 637 "<stdout>"
yy87:
	++YYCURSOR;
#line 165 "cunroll.re"
	{ RET(SUBEQ); }
#line 642 "<stdout>"
yy89:
	++YYCURSOR;
#line 174 "cunroll.re"
	{ RET(INCR); }
#line 647 "<stdout>"
yy91:
	++YYCURSOR;
#line 164 "cunroll.re"
	{ RET(ADDEQ); }
#line 652 "<stdout>"
yy93:
	++YYCURSOR;
#line 179 "cunroll.re"
	{ RET(LEQ); }
#line 657 "<stdout>"
yy95:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '=':	goto yy97;
	default:	goto yy96;
	}
yy96:
#line 173 "cunroll.re"
	{ RET(LSHIFT); }
#line 667 "<stdout>"
yy97:
	++YYCURSOR;
#line 163 "cunroll.re"
	{ RET(LSHIFTEQ); }
#line 672 "<stdout>"
yy99:
	++YYCURSOR;
#line 180 "cunroll.re"
	{ RET(GEQ); }
#line 677 "<stdout>"
yy101:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '=':	goto yy103;
	default:	goto yy102;
	}
yy102:
#line 172 "cunroll.re"
	{ RET(RSHIFT); }
#line 687 "<stdout>"
yy103:
	++YYCURSOR;
#line 162 "cunroll.re"
	{ RET(RSHIFTEQ); }
#line 692 "<stdout>"
yy105:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy106:
	switch (yych) {
	case '\n':	goto yy107;
	case '"':	goto yy109;
	case '\\':	goto yy108;
	default:	goto yy105;
	}
yy107:
	YYCURSOR = YYMARKER;
	switch (yyaccept) {
	case 0: 	goto yy7;
	case 1: 	goto yy10;
	case 2: 	goto yy12;
	default:	goto yy119;
	}
yy108:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '"':
	case '\'':
	case '?':
	case '\\':
	case 'a':
	case 'b':
	case 'f':
	case 'n':
	case 'r':
	case 't':
	case 'v':	goto yy105;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':	goto yy112;
	case 'x':	goto yy111;
	default:	goto yy107;
	}
yy109:
	++YYCURSOR;
#line 159 "cunroll.re"
	{ RET(SCON); }
#line 743 "<stdout>"
yy111:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':	goto yy114;
	default:	goto yy107;
	}
yy112:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '\n':	goto yy107;
	case '"':	goto yy109;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':	goto yy112;
	case '\\':	goto yy108;
	default:	goto yy105;
	}
yy114:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '\n':	goto yy107;
	case '"':	goto yy109;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':	goto yy114;
	case '\\':	goto yy108;
	default:	goto yy105;
	}
yy116:
	yych = *++YYCURSOR;
	switch (yych) {
	case '.':	goto yy125;
	default:	goto yy107;
	}
yy117:
	yyaccept = 3;
	YYMARKER = ++YYCURSOR;
	if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy117;
	case 'E':
	case 'e':	goto yy120;
	case 'F':
	case 'L':
	case 'f':
	case 'l':	goto yy121;
	default:	goto yy119;
	}
yy119:
#line 156 "cunroll.re"
	{ RET(FCON); }
#line 856 "<stdout>"
yy120:
	yych = *++YYCURSOR;
	switch (yych) {
	case '+':
	case '-':	goto yy122;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy123;
	default:	goto yy107;
	}
yy121:
	yych = *++YYCURSOR;
	goto yy119;
yy122:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy123;
	default:	goto yy107;
	}
yy123:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy123;
	case 'F':
	case 'L':
	case 'f':
	case 'l':	goto yy121;
	default:	goto yy119;
	}
yy125:
	++YYCURSOR;
#line 161 "cunroll.re"
	{ RET(ELLIPSIS); }
#line 917 "<stdout>"
yy127:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy128:
	switch (yych) {
	case '\n':	goto yy107;
	case '\'':	goto yy130;
	case '\\':	goto yy129;
	default:	goto yy127;
	}
yy129:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '"':
	case '\'':
	case '?':
	case '\\':
	case 'a':
	case 'b':
	case 'f':
	case 'n':
	case 'r':
	case 't':
	case 'v':	goto yy127;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':	goto yy132;
	case 'x':	goto yy131;
	default:	goto yy107;
	}
yy130:
	yych = *++YYCURSOR;
	goto yy7;
yy131:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':	goto yy134;
	default:	goto yy107;
	}
yy132:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '\n':	goto yy107;
	case '\'':	goto yy130;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':	goto yy132;
	case '\\':	goto yy129;
	default:	goto yy127;
	}
yy134:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '\n':	goto yy107;
	case '\'':	goto yy130;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':	goto yy134;
	case '\\':	goto yy129;
	default:	goto yy127;
	}
yy136:
	yyaccept = 3;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'E':
	case 'e':	goto yy147;
	default:	goto yy146;
	}
yy137:
	yyaccept = 0;
	YYMARKER = ++YYCURSOR;
	if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
	yych = *YYCURSOR;
yy138:
	switch (yych) {
	case '.':	goto yy136;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy137;
	case 'E':
	case 'e':	goto yy139;
	case 'L':
	case 'U':
	case 'l':
	case 'u':	goto yy140;
	default:	goto yy7;
	}
yy139:
	yych = *++YYCURSOR;
	switch (yych) {
	case '+':
	case '-':	goto yy142;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy143;
	default:	goto yy107;
	}
yy140:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case 'L':
	case 'U':
	case 'l':
	case 'u':	goto yy140;
	default:	goto yy7;
	}
yy142:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy143;
	default:	goto yy107;
	}
yy143:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy143;
	case 'F':
	case 'L':
	case 'f':
	case 'l':	goto yy121;
	default:	goto yy119;
	}
yy145:
	yyaccept = 3;
	YYMARKER = ++YYCURSOR;
	if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
	yych = *YYCURSOR;
yy146:
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy145;
	case 'E':
	case 'e':	goto yy151;
	case 'F':
	case 'L':
	case 'f':
	case 'l':	goto yy121;
	default:	goto yy119;
	}
yy147:
	yych = *++YYCURSOR;
	switch (yych) {
	case '+':
	case '-':	goto yy148;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy149;
	default:	goto yy107;
	}
yy148:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy149;
	default:	goto yy107;
	}
yy149:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy149;
	case 'F':
	case 'L':
	case 'f':
	case 'l':	goto yy121;
	default:	goto yy119;
	}
yy151:
	yych = *++YYCURSOR;
	switch (yych) {
	case '+':
	case '-':	goto yy152;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy153;
	default:	goto yy107;
	}
yy152:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy153;
	default:	goto yy107;
	}
yy153:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy153;
	case 'F':
	case 'L':
	case 'f':
	case 'l':	goto yy121;
	default:	goto yy119;
	}
yy155:
	yyaccept = 0;
	YYMARKER = ++YYCURSOR;
	if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
	yych = *YYCURSOR;
yy156:
	switch (yych) {
	case '.':	goto yy136;
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy155;
	case 'E':
	case 'e':	goto yy139;
	case 'L':
	case 'U':
	case 'l':
	case 'u':	goto yy162;
	default:	goto yy7;
	}
yy157:
	yych = *++YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':	goto yy158;
	default:	goto yy107;
	}
yy158:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':	goto yy158;
	case 'L':
	case 'U':
	case 'l':
	case 'u':	goto yy160;
	default:	goto yy7;
	}
yy160:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case 'L':
	case 'U':
	case 'l':
	case 'u':	goto yy160;
	default:	goto yy7;
	}
yy162:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case 'L':
	case 'U':
	case 'l':
	case 'u':	goto yy162;
	default:	goto yy7;
	}
yy164:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy166;
	default:	goto yy165;
	}
yy165:
#line 142 "cunroll.re"
	{ RET(ID); }
#line 1446 "<stdout>"
yy166:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy168;
	default:	goto yy167;
	}
yy167:
#line 143 "cunroll.re"
	{ RET(ID); }
#line 1518 "<stdout>"
yy168:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy170;
	default:	goto yy169;
	}
yy169:
#line 144 "cunroll.re"
	{ RET(ID); }
#line 1590 "<stdout>"
yy170:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy172;
	default:	goto yy171;
	}
yy171:
#line 145 "cunroll.re"
	{ RET(ID); }
#line 1662 "<stdout>"
yy172:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy174;
	default:	goto yy173;
	}
yy173:
#line 146 "cunroll.re"
	{ RET(ID); }
#line 1734 "<stdout>"
yy174:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy176;
	default:	goto yy175;
	}
yy175:
#line 147 "cunroll.re"
	{ RET(ID); }
#line 1806 "<stdout>"
yy176:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy178;
	default:	goto yy177;
	}
yy177:
#line 148 "cunroll.re"
	{ RET(ID); }
#line 1878 "<stdout>"
yy178:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '_':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':	goto yy178;
	default:	goto yy180;
	}
yy180:
#line 149 "cunroll.re"
	{ RET(ID); }
#line 1952 "<stdout>"
yy181:
	++YYCURSOR;
#line 167 "cunroll.re"
	{ RET(DIVEQ); }
#line 1957 "<stdout>"
yy183:
	++YYCURSOR;
#line 138 "cunroll.re"
	{ goto comment; }
#line 1962 "<stdout>"
}
#line 223 "cunroll.re"


comment:

#line 1969 "<stdout>"
{
	YYCTYPE yych;
	if ((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
	yych = *YYCURSOR;
	switch (yych) {
	case '\n':	goto yy189;
	case '*':	goto yy187;
	case '/':	goto yy193;
	default:	goto yy191;
	}
yy187:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '/':	goto yy208;
	default:	goto yy188;
	}
yy188:
#line 242 "cunroll.re"
	{ goto comment; }
#line 1989 "<stdout>"
yy189:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':
	case '/':	goto yy190;
	default:	goto yy194;
	}
yy190:
#line 229 "cunroll.re"
	{
		if(cursor == s->eof) RET(EOI);
		s->tok = s->pos = cursor; s->line++;
		goto comment;
	    }
#line 2004 "<stdout>"
yy191:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':
	case '/':	goto yy192;
	default:	goto yy194;
	}
yy192:
#line 234 "cunroll.re"
	{ goto comment; }
#line 2015 "<stdout>"
yy193:
	yych = *++YYCURSOR;
	goto yy188;
yy194:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':
	case '/':	goto yy195;
	default:	goto yy196;
	}
yy195:
#line 235 "cunroll.re"
	{ goto comment; }
#line 2029 "<stdout>"
yy196:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':
	case '/':	goto yy197;
	default:	goto yy198;
	}
yy197:
#line 236 "cunroll.re"
	{ goto comment; }
#line 2040 "<stdout>"
yy198:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':
	case '/':	goto yy199;
	default:	goto yy200;
	}
yy199:
#line 237 "cunroll.re"
	{ goto comment; }
#line 2051 "<stdout>"
yy200:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':
	case '/':	goto yy201;
	default:	goto yy202;
	}
yy201:
#line 238 "cunroll.re"
	{ goto comment; }
#line 2062 "<stdout>"
yy202:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':
	case '/':	goto yy203;
	default:	goto yy204;
	}
yy203:
#line 239 "cunroll.re"
	{ goto comment; }
#line 2073 "<stdout>"
yy204:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':
	case '/':	goto yy205;
	default:	goto yy206;
	}
yy205:
#line 240 "cunroll.re"
	{ goto comment; }
#line 2084 "<stdout>"
yy206:
	++YYCURSOR;
#line 241 "cunroll.re"
	{ goto comment; }
#line 2089 "<stdout>"
yy208:
	++YYCURSOR;
#line 227 "cunroll.re"
	{ goto std; }
#line 2094 "<stdout>"
}
#line 243 "cunroll.re"

}
Пример #21
0
int string()
{
	int c, n;
	char *s, *bp;
	static char *buf = 0;
	static int bufsz = 500;

	if (buf == 0 && (buf = (char *) malloc(bufsz)) == NULL)
		ERROR "out of space for strings" FATAL;
	for (bp = buf; (c = input()) != '"'; ) {
		if (!adjbuf(&buf, &bufsz, bp-buf+2, 500, &bp, 0))
			ERROR "out of space for string %.10s...", buf FATAL;
		switch (c) {
		case '\n':
		case '\r':
		case 0:
			ERROR "non-terminated string %.10s...", buf SYNTAX;
			lineno++;
			break;
		case '\\':
			c = input();
			switch (c) {
			case '"': *bp++ = '"'; break;
			case 'n': *bp++ = '\n'; break;	
			case 't': *bp++ = '\t'; break;
			case 'f': *bp++ = '\f'; break;
			case 'r': *bp++ = '\r'; break;
			case 'b': *bp++ = '\b'; break;
			case 'v': *bp++ = '\v'; break;
			case 'a': *bp++ = '\a'; break;
			case '\\': *bp++ = '\\'; break;

			case '0': case '1': case '2': /* octal: \d \dd \ddd */
			case '3': case '4': case '5': case '6': case '7':
				n = c - '0';
				if ((c = peek()) >= '0' && c < '8') {
					n = 8 * n + input() - '0';
					if ((c = peek()) >= '0' && c < '8')
						n = 8 * n + input() - '0';
				}
				*bp++ = n;
				break;

			case 'x':	/* hex  \x0-9a-fA-F + */
			    {	char xbuf[100], *px;
				for (px = xbuf; (c = input()) != 0 && px-xbuf < 100-2; ) {
					if (isdigit(c)
					 || (c >= 'a' && c <= 'f')
					 || (c >= 'A' && c <= 'F'))
						*px++ = c;
					else
						break;
				}
				*px = 0;
				unput(c);
	  			sscanf(xbuf, "%x", &n);
				*bp++ = n;
				break;
			    }

			default: 
				*bp++ = c;
				break;
			}
			break;
		default:
			*bp++ = c;
			break;
		}
	}
	*bp = 0; 
	s = tostring(buf);
	*bp++ = ' '; *bp++ = 0;
	yylval.cp = setsymtab(buf, s, 0.0, CON|STR|DONTFREE, symtab);
	RET(STRING);
}
Пример #22
0
void _zombify( pcb_t *pcb ) {
	estatus_t *esptr;
	pid_t *pidptr;
	pid_t ppid;
	pcb_t *parent, *p2;
	int i;
	key_t key;
	status_t stat;
	
	// mark the process as no longer runnable

	pcb->state = ZOMBIE;

	// find the parent

	ppid = pcb->ppid;
	for( i = 0; i < N_PCBS; ++i ) {
		if( _pcbs[i].pid == ppid && _pcbs[i].state != FREE ) {
			parent = &_pcbs[i];
			break;
		}
	}
	
	/*
	** If we didn't find a parent, or if the parent was
	** already unrunnable (zombied, killed), reparent this
	** process to the init process
	*/

	if( i >= N_PCBS || _pcbs[i].state >= FIRST_DEAD_STATE ) {
		ppid = pcb->ppid = PID_INIT;
		parent = _init_pcb;
	}

	/*
	** At this point, parent points to the parent's PCB, and ppid
	** contains the parent's PID.
	**
	** If the parent is on the wait() queue, we'll awaken it and give
	** it this child's information.
	**
	** Otherwise, we need to put this child on the zombie queue.
	*/

	if( parent->state == WAITING ) {

		// look for the parent on the wait queue

		key.u = ppid;
		stat = _q_remove_specific( &_waiting, (void **) &p2, key );
		if( stat != SUCCESS ) {
			_kpanic( "_zombify", "parent wait remove status %s",
				 stat );
		}

		// verify that we found the same process

		if( p2 != parent ) {
			_pcb_dump( "*** p2:     ", p2 );
			_pcb_dump( "*** parent: ", parent );
			_kpanic( "_zombify", "parent wait deque wrong",
				 FAILURE );
		}

		// OK, we have the right one.

		// Start by decrementing its "remaining children"
		// counter if it isn't the init process

		if( ppid != PID_INIT ) {
			parent->children -= 1;
		}
		
		// return the child's information to it.

		RET(parent) = U_SUCCESS;

		pidptr = (pid_t *) ARG(parent)[1];
		*pidptr = pcb->pid;

		esptr = (estatus_t *) ARG(parent)[2];
		*esptr = ARG(pcb)[1];
		
		// schedule the parent (who returns from wait())

		_schedule( parent );
		
		// clean up the child process
		_pcb_cleanup( pcb );

	} else {

		// place this child on the zombie queue, ordered by PID

		key.u = pcb->pid;
		pcb->status = ARG(pcb)[1];

		stat = _q_insert( &_zombie, (void *)pcb, key );
		if( stat != SUCCESS ) {
			_kpanic( "_zombify", "zombie insert status %s",
				 stat );
		}

	}
	
}
Пример #23
0
int scan(char *s, int l)
{
	char *p = s;
	char *q;
#define YYCTYPE         char
#define YYCURSOR        p
#define YYLIMIT         (s+l)
#define YYMARKER        q
#define YYFILL(n)
cont:

#line 24 "<stdout>"
{
	YYCTYPE yych;

	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	switch (yych) {
	case '"':	goto yy2;
	default:	goto yy4;
	}
yy2:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 0x00:
	case 0x01:
	case 0x02:
	case 0x03:
	case 0x04:
	case 0x05:
	case 0x06:
	case 0x07:
	case 0x08:
	case '\t':
	case '\n':
	case '\v':
	case '\f':
	case '\r':
	case 0x0E:
	case 0x0F:
	case 0x10:
	case 0x11:
	case 0x12:
	case 0x13:
	case 0x14:
	case 0x15:
	case 0x16:
	case 0x17:
	case 0x18:
	case 0x19:
	case 0x1A:
	case 0x1B:
	case 0x1C:
	case 0x1D:
	case 0x1E:
	case 0x1F:
	case ' ':
	case '!':
	case '#':
	case '$':
	case '%':
	case '&':
	case '\'':
	case '(':
	case ')':
	case '*':
	case '+':
	case ',':
	case '-':
	case '.':
	case '/':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case ':':
	case ';':
	case '<':
	case '=':
	case '>':
	case '?':
	case '@':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '[':
	case '\\':
	case ']':
	case '^':
	case '_':
	case '`':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':
	case '{':
	case '|':
	case '}':
	case '~':
	case 0x7F:
	case 0x80:
	case 0x81:
	case 0x82:
	case 0x83:
	case 0x84:
	case 0x85:
	case 0x86:
	case 0x87:
	case 0x88:
	case 0x89:
	case 0x8A:
	case 0x8B:
	case 0x8C:
	case 0x8D:
	case 0x8E:
	case 0x8F:
	case 0x90:
	case 0x91:
	case 0x92:
	case 0x93:
	case 0x94:
	case 0x95:
	case 0x96:
	case 0x97:
	case 0x98:
	case 0x99:
	case 0x9A:
	case 0x9B:
	case 0x9C:
	case 0x9D:
	case 0x9E:
	case 0x9F:
	case 0xA0:
	case 0xA1:
	case 0xA2:
	case 0xA3:
	case 0xA4:
	case 0xA5:
	case 0xA6:
	case 0xA7:
	case 0xA8:
	case 0xA9:
	case 0xAA:
	case 0xAB:
	case 0xAC:
	case 0xAD:
	case 0xAE:
	case 0xAF:
	case 0xB0:
	case 0xB1:
	case 0xB2:
	case 0xB3:
	case 0xB4:
	case 0xB5:
	case 0xB6:
	case 0xB7:
	case 0xB8:
	case 0xB9:
	case 0xBA:
	case 0xBB:
	case 0xBC:
	case 0xBD:
	case 0xBE:
	case 0xBF:
	case 0xC0:
	case 0xC1:
	case 0xC2:
	case 0xC3:
	case 0xC4:
	case 0xC5:
	case 0xC6:
	case 0xC7:
	case 0xC8:
	case 0xC9:
	case 0xCA:
	case 0xCB:
	case 0xCC:
	case 0xCD:
	case 0xCE:
	case 0xCF:
	case 0xD0:
	case 0xD1:
	case 0xD2:
	case 0xD3:
	case 0xD4:
	case 0xD5:
	case 0xD6:
	case 0xD7:
	case 0xD8:
	case 0xD9:
	case 0xDA:
	case 0xDB:
	case 0xDC:
	case 0xDD:
	case 0xDE:
	case 0xDF:
	case 0xE0:
	case 0xE1:
	case 0xE2:
	case 0xE3:
	case 0xE4:
	case 0xE5:
	case 0xE6:
	case 0xE7:
	case 0xE8:
	case 0xE9:
	case 0xEA:
	case 0xEB:
	case 0xEC:
	case 0xED:
	case 0xEE:
	case 0xEF:
	case 0xF0:
	case 0xF1:
	case 0xF2:
	case 0xF3:
	case 0xF4:
	case 0xF5:
	case 0xF6:
	case 0xF7:
	case 0xF8:
	case 0xF9:
	case 0xFA:
	case 0xFB:
	case 0xFC:
	case 0xFD:
	case 0xFE:	goto yy5;
	default:	goto yy3;
	}
yy3:
#line 23 "bug1187785.re"
	{ goto cont; }
#line 296 "<stdout>"
yy4:
	yych = *++YYCURSOR;
	goto yy3;
yy5:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case 0x00:
	case 0x01:
	case 0x02:
	case 0x03:
	case 0x04:
	case 0x05:
	case 0x06:
	case 0x07:
	case 0x08:
	case '\t':
	case '\n':
	case '\v':
	case '\f':
	case '\r':
	case 0x0E:
	case 0x0F:
	case 0x10:
	case 0x11:
	case 0x12:
	case 0x13:
	case 0x14:
	case 0x15:
	case 0x16:
	case 0x17:
	case 0x18:
	case 0x19:
	case 0x1A:
	case 0x1B:
	case 0x1C:
	case 0x1D:
	case 0x1E:
	case 0x1F:
	case ' ':
	case '!':
	case '#':
	case '$':
	case '%':
	case '&':
	case '\'':
	case '(':
	case ')':
	case '*':
	case '+':
	case ',':
	case '-':
	case '.':
	case '/':
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':
	case ':':
	case ';':
	case '<':
	case '=':
	case '>':
	case '?':
	case '@':
	case 'A':
	case 'B':
	case 'C':
	case 'D':
	case 'E':
	case 'F':
	case 'G':
	case 'H':
	case 'I':
	case 'J':
	case 'K':
	case 'L':
	case 'M':
	case 'N':
	case 'O':
	case 'P':
	case 'Q':
	case 'R':
	case 'S':
	case 'T':
	case 'U':
	case 'V':
	case 'W':
	case 'X':
	case 'Y':
	case 'Z':
	case '[':
	case '\\':
	case ']':
	case '^':
	case '_':
	case '`':
	case 'a':
	case 'b':
	case 'c':
	case 'd':
	case 'e':
	case 'f':
	case 'g':
	case 'h':
	case 'i':
	case 'j':
	case 'k':
	case 'l':
	case 'm':
	case 'n':
	case 'o':
	case 'p':
	case 'q':
	case 'r':
	case 's':
	case 't':
	case 'u':
	case 'v':
	case 'w':
	case 'x':
	case 'y':
	case 'z':
	case '{':
	case '|':
	case '}':
	case '~':
	case 0x7F:
	case 0x80:
	case 0x81:
	case 0x82:
	case 0x83:
	case 0x84:
	case 0x85:
	case 0x86:
	case 0x87:
	case 0x88:
	case 0x89:
	case 0x8A:
	case 0x8B:
	case 0x8C:
	case 0x8D:
	case 0x8E:
	case 0x8F:
	case 0x90:
	case 0x91:
	case 0x92:
	case 0x93:
	case 0x94:
	case 0x95:
	case 0x96:
	case 0x97:
	case 0x98:
	case 0x99:
	case 0x9A:
	case 0x9B:
	case 0x9C:
	case 0x9D:
	case 0x9E:
	case 0x9F:
	case 0xA0:
	case 0xA1:
	case 0xA2:
	case 0xA3:
	case 0xA4:
	case 0xA5:
	case 0xA6:
	case 0xA7:
	case 0xA8:
	case 0xA9:
	case 0xAA:
	case 0xAB:
	case 0xAC:
	case 0xAD:
	case 0xAE:
	case 0xAF:
	case 0xB0:
	case 0xB1:
	case 0xB2:
	case 0xB3:
	case 0xB4:
	case 0xB5:
	case 0xB6:
	case 0xB7:
	case 0xB8:
	case 0xB9:
	case 0xBA:
	case 0xBB:
	case 0xBC:
	case 0xBD:
	case 0xBE:
	case 0xBF:
	case 0xC0:
	case 0xC1:
	case 0xC2:
	case 0xC3:
	case 0xC4:
	case 0xC5:
	case 0xC6:
	case 0xC7:
	case 0xC8:
	case 0xC9:
	case 0xCA:
	case 0xCB:
	case 0xCC:
	case 0xCD:
	case 0xCE:
	case 0xCF:
	case 0xD0:
	case 0xD1:
	case 0xD2:
	case 0xD3:
	case 0xD4:
	case 0xD5:
	case 0xD6:
	case 0xD7:
	case 0xD8:
	case 0xD9:
	case 0xDA:
	case 0xDB:
	case 0xDC:
	case 0xDD:
	case 0xDE:
	case 0xDF:
	case 0xE0:
	case 0xE1:
	case 0xE2:
	case 0xE3:
	case 0xE4:
	case 0xE5:
	case 0xE6:
	case 0xE7:
	case 0xE8:
	case 0xE9:
	case 0xEA:
	case 0xEB:
	case 0xEC:
	case 0xED:
	case 0xEE:
	case 0xEF:
	case 0xF0:
	case 0xF1:
	case 0xF2:
	case 0xF3:
	case 0xF4:
	case 0xF5:
	case 0xF6:
	case 0xF7:
	case 0xF8:
	case 0xF9:
	case 0xFA:
	case 0xFB:
	case 0xFC:
	case 0xFD:
	case 0xFE:	goto yy5;
	case '"':	goto yy8;
	default:	goto yy7;
	}
yy7:
	YYCURSOR = YYMARKER;
	goto yy3;
yy8:
	++YYCURSOR;
#line 22 "bug1187785.re"
	{ RET(1); }
#line 569 "<stdout>"
}
#line 24 "bug1187785.re"

}
Пример #24
0
int validate_ocpimsg( WorkerTestMsg * sample )
{

  uint8_t * off = (uint8_t*)(&sample[1]);
  unsigned int n;
  int in;
  int i;
  int vi=0;
  
  if ( sample->userId != 1 ) RET( MIDO, userId );
  if ( sample->u1 != 445 ) RET( MIDO, u1 );
  if ( sample->v_longlong1 != 98765432 ) RET( MIDO, v_longlong1 );
  if ( sample->v_short  != 99 ) RET( MIDO, v_short );
  for (in=0; in<3; in++ ) {
    if ( sample->v_l_array[in] != 20*in ) RET( MIDO, v_l_array );
  }
  for (n=0; n<3; n++ ) {
    for (i=0; i<4; i++ ) {
      if ( sample->v_l_array1[n][i] != vi++ ) RET( MIDO, v_l_array1 );
    }
  }
  if ( sample->v_bool != 1 ) RET( MIDO, v_bool );
  if ( sample->v_double != 9876.543 ) RET( MIDO, v_double );
  for (n=0; n<5; n++ ) {
    if ( sample->v_oct_array[n] != 20*n ) RET( MIDO, v_oct_array );
  }
  if ( sample->v_long2 != 2 ) RET( MIDO, v_long2 );


  // EmbMsg structure
  {
    off = align( 8, off );
    uint32_t * value = (uint32_t*)off; off+=4;
    if ( *value != 125689 ) RET( MIDO, embMsg_value );
    off = align( 8, off );
    uint32_t * length = (uint32_t*)off; off+=4;
    off = align( 8, off );
    double * d = (double *)off;
    if ( *length != 4 ) RET( MIDO, embMsg_length );
    for (n=0; n<*length; n++ ) {
      if ( d[n] != 44*n ) RET( MIDO, embMsg_data );
    }
    off +=*length * sizeof(double);
  }

    
  // string
  const char * ts = "Test Message from the producer worker";
  {
    off = align( 4, off );
    char * data = (char*)off;
    if ( strcmp( ts, data ) != 0 ) RET( MIDO, string );
    off += strlen(data) + 1;
  }


  // sequence of longs
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 5 ) RET( MIDO, long_seq_length );
    uint32_t * l = (uint32_t*)off;
    for (n=0; n<*length; n++ ) {
      if ( l[n] != 20+n ) RET( MIDO, long_seq );
    }
    off += 4*(*length);
  }


  // sequence of doubles
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    off = align( 8,  off );
    if ( *length != 6 ) RET( MIDO, double_seq_length );
    double * l = (double*)off;
    for (n=0; n<*length; n++ ) {
      if (  l[n] != 30+n ) RET( MIDO, double_seq );
    }
    off += 8*(*length);
  }



  // sequence of shorts
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    off = align( 2,  off ); // not needed
    if ( *length != 7 ) RET( MIDO, short_seq_length );
    uint16_t * l = (uint16_t*)off;
    for (n=0; n<*length; n++ ) {
      if ( l[n] != 40+n ) RET( MIDO, short_seq );
    }
    off += 2*(*length);
  }


  // sequence of chars
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 8 ) RET( MIDO, char_seq_length );
    int8_t * l = (int8_t*)off;
    for (n=0; n<*length; n++ ) {
      if (  l[n] != (int8_t)n ) RET( MIDO, short_seq );
    }
    off += 1*(*length);
  }



  // sequence of uchars
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 9 ) RET( MIDO, uchar_seq_length );
    uint8_t * l = (uint8_t*)off;
    for (n=0; n<*length; n++ ) {
      if ( l[n] != n+1 ) RET( MIDO, uchar_seq );
    }
    off += 1*(*length);
  }



  // sequence of strings
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 10 ) RET( MIDO, string_seq_length );
    for (n=0; n<*length; n++ ) {
      char * string = (char*)off;
      char tstring[1024];
      sprintf(tstring, "string(%d) from producer", n );
      if ( strcmp( string, tstring) != 0 )  RET( MIDO, string_seq );
      off += strlen(string) + 1;
      off = align( 4,  off );    
    }
  }



  // Array of emb structs size = 3
  {
    vi = 0;
    off = align( 8,  off );    
    int y;
    for (y=0; y<3; y++ ) {
      {
	off = align( 4,  off );
	uint32_t * value = (uint32_t*)off; off+=4;
	if ( *value != (uint32_t)(2*y) ) RET( MIDO, array_embmsg_value );
	off = align( 8,  off );
	uint32_t * length = (uint32_t*)off; off+=4;	
	if ( *length != 3 ) RET( MIDO, array_embmsg_seq_length );
	off = align( 8,  off );
	double * d = (double *)off;
	for (n=0; n<*length; n++ ) {
	  if ( d[n] != vi++ ) RET( MIDO, array_embmsg_seq_value );
	}
	off += (*length * sizeof(double));
      }
    }
  }

  // Sequence of arrays
  {
    vi=0;
    unsigned int y;
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 4 ) RET( MIDO, seq_long_arrays_length );
    for (y=0; y<*length; y++ ) {
      {
	off = align( 4,  off );
	uint32_t * l = (uint32_t *)off;
	for (n=0; n<4; n++ ) {
	  if ( l[n] != (uint32_t)vi++ ) RET( MIDO, seq_long_arrays );
	}
	off += (4 * 4);
      }
    }
  }

  // 2,3 array of sequences of embMsgs
  {
    vi=0;
    off = align( 8,  off );    
    int y,k;
    unsigned int uu;
    for ( k=0; k<2; k++ ) {
      for (y=0; y<3; y++ ) {

	uint32_t * slength = (uint32_t*)off; off+=4; 
	if ( *slength != (uint32_t)(2+y) ) RET( MIDO, array_seq_embmsg_length );
	
	// fill in the sequence
	for ( uu=0; uu<*slength; uu++ ) {
	  {
	    off = align( 8,  off );
	    uint32_t * value = (uint32_t*)off; off+=4;
	    if ( *value != 5+uu ) RET( MIDO, array_seq_embmsg_value );
	    off = align( 8,  off );
	    uint32_t * length = (uint32_t*)off; off+=4;
	    if ( *length != 3+uu ) RET( MIDO, array_seq_embmsg_seq_length );
	    off = align( 8,  off );
	    double * d = (double *)off;
	    for (n=0; n<*length; n++ ) {
	      if ( d[n] != vi++ ) RET( MIDO, array_seq_embmsg_seq_value );
	    }
	    off += ((*length) * sizeof(double));
	  }
	}
      }
    }
  }

  off = align(4,off);
  uint32_t * enum1 = (uint32_t *)off;
  if ( *enum1 != 2 ) RET( MIDO, emum );  
  off += 4;

  // sequence of strings
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 3 ) RET( MIDO, seq_strings2 );      
    for (n=0; n<*length; n++ ) {
      char * string = (char*)off;
      char tstring[1024];
      sprintf(tstring, "string(%d) from producer, again", n );
      if ( strcmp( tstring,string) != 0 )  RET( MIDO, seq_strings2 );
      off += strlen(string) + 1;
      off = align( 4,  off );    
    }
  }

  return 1;

}
Пример #25
0
static int
panel_parse_global(xconf *xc)
{
    ENTER;
    /* Set default values */
    p->allign = ALLIGN_CENTER;
    p->edge = EDGE_BOTTOM;
    p->widthtype = WIDTH_PERCENT;
    p->width = 100;
    p->heighttype = HEIGHT_PIXEL;
    p->height = PANEL_HEIGHT_DEFAULT;
    p->max_elem_height = PANEL_HEIGHT_MAX;
    p->setdocktype = 1;
    p->setstrut = 1;
    p->round_corners = 1;
    p->round_corners_radius = 7;
    p->autohide = 0;
    p->height_when_hidden = 2;
    p->transparent = 0;
    p->alpha = 127;
    p->tintcolor_name = "white";
    p->spacing = 0;
    p->setlayer = FALSE;
    p->layer = LAYER_ABOVE;

    /* Read config */
    /* geometry */
    XCG(xc, "edge", &p->edge, enum, edge_enum);
    XCG(xc, "allign", &p->allign, enum, allign_enum);
    XCG(xc, "widthtype", &p->widthtype, enum, widthtype_enum);
    XCG(xc, "heighttype", &p->heighttype, enum, heighttype_enum);
    XCG(xc, "width", &p->width, int);
    XCG(xc, "height", &p->height, int);
    XCG(xc, "margin", &p->margin, int);

    /* properties */
    XCG(xc, "setdocktype", &p->setdocktype, enum, bool_enum);
    XCG(xc, "setpartialstrut", &p->setstrut, enum, bool_enum);
    XCG(xc, "autohide", &p->autohide, enum, bool_enum);
    XCG(xc, "heightwhenhidden", &p->height_when_hidden, int);
    XCG(xc, "setlayer", &p->setlayer, enum, bool_enum);
    XCG(xc, "layer", &p->layer, enum, layer_enum);

    /* effects */
    XCG(xc, "roundcorners", &p->round_corners, enum, bool_enum);
    XCG(xc, "roundcornersradius", &p->round_corners_radius, int);
    XCG(xc, "transparent", &p->transparent, enum, bool_enum);
    XCG(xc, "alpha", &p->alpha, int);
    XCG(xc, "tintcolor", &p->tintcolor_name, str);
    XCG(xc, "maxelemheight", &p->max_elem_height, int);

    /* Sanity checks */
    if (!gdk_color_parse(p->tintcolor_name, &p->gtintcolor))
        gdk_color_parse("white", &p->gtintcolor);
    p->tintcolor = gcolor2rgb24(&p->gtintcolor);
    DBG("tintcolor=%x\n", p->tintcolor);
    if (p->alpha > 255)
        p->alpha = 255;
    p->orientation = (p->edge == EDGE_TOP || p->edge == EDGE_BOTTOM)
                     ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
    if (p->orientation == GTK_ORIENTATION_HORIZONTAL) {
        p->my_box_new = gtk_hbox_new;
        p->my_separator_new = gtk_vseparator_new;
    } else {
        p->my_box_new = gtk_vbox_new;
        p->my_separator_new = gtk_hseparator_new;
    }
    if (p->width < 0)
        p->width = 100;
    if (p->widthtype == WIDTH_PERCENT && p->width > 100)
        p->width = 100;
    p->heighttype = HEIGHT_PIXEL;
    if (p->heighttype == HEIGHT_PIXEL) {
        if (p->height < PANEL_HEIGHT_MIN)
            p->height = PANEL_HEIGHT_MIN;
        else if (p->height > PANEL_HEIGHT_MAX)
            p->height = PANEL_HEIGHT_MAX;
    }
    if (p->max_elem_height > p->height ||
            p->max_elem_height < PANEL_HEIGHT_MIN)
        p->max_elem_height = p->height;
    p->curdesk = get_net_current_desktop();
    p->desknum = get_net_number_of_desktops();
    //p->workarea = get_xaproperty (GDK_ROOT_WINDOW(), a_NET_WORKAREA,
    //    XA_CARDINAL, &p->wa_len);
    //print_wmdata(p);
    panel_start_gui(p);
    RET(1);
}
Пример #26
0
int validate_ddsmsg( WorkerTestMsg * sample  )
{

  uint8_t * off = (uint8_t*)(&sample[1]);
  unsigned int n;
  int in;
  int i;
  int vi=0;
  
  if ( sample->userId != 2 ) RET( MIDDDS, userId );
  if ( sample->u1 != 333 ) RET( MIDDDS, u1 );
  if ( sample->v_longlong1 != 97531246 ) RET( MIDDDS, v_longlong1 );
  if ( sample->v_short  != 67 ) RET( MIDDDS, v_short );
  for (in=0; in<3; in++ ) {
    if ( sample->v_l_array[in] != in+11 ) RET( MIDDDS, v_l_array );
  }
  for (n=0; n<3; n++ ) {
    for (i=0; i<4; i++ ) {
      if ( sample->v_l_array1[n][i] != (long)10+n+i ) RET( MIDDDS, v_l_array1 );
    }
  }
  if ( sample->v_bool != 0 ) RET( MIDDDS, v_bool );
  if ( sample->v_double != 1234.9876 ) RET( MIDDDS, v_double );
  for (n=0; n<5; n++ ) {
    if ( sample->v_oct_array[n] != 32+n ) RET( MIDDDS, v_oct_array );
  }
  if ( sample->v_long2 != 56 ) RET( MIDDDS, v_long2 );


  // EmbMsg structure
  {
    off = align( 8, off );
    uint32_t * value = (uint32_t*)off; off+=4;
    if ( *value != 7 ) RET( MIDDDS, embMsg_value );
    off = align( 8, off );
    uint32_t * length = (uint32_t*)off; off+=4;
    off = align( 8, off );
    double * d = (double *)off;
    if ( *length != 4 ) RET( MIDDDS, embMsg_length );
    for (n=0; n<*length; n++ ) {
      if ( d[n] != 10*n ) RET( MIDDDS, embMsg_data );
    }
    off +=*length * sizeof(double);
  }

    
  // string
  const char * ts = "Hello OCPI  World, from DDS   ";
  {
    off = align( 4, off );
    char * data = (char*)off;
    if ( strcmp( ts, data ) != 0 ) RET( MIDDDS, string );
    off += strlen(data) + 1;
  }


  // sequence of longs
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 5 ) RET( MIDDDS, long_seq_length );
    uint32_t * l = (uint32_t*)off;
    for (n=0; n<*length; n++ ) {
      if ( l[n] != 10*n ) RET( MIDDDS, long_seq );
    }
    off += 4*(*length);
  }


  // sequence of doubles
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    off = align( 8,  off );
    if ( *length != 12 ) RET( MIDDDS, double_seq_length );
    double * l = (double*)off;
    for (n=0; n<*length; n++ ) {
      if (  l[n] != n*11 ) RET( MIDDDS, double_seq );
    }
    off += 8*(*length);
  }



  // sequence of shorts
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    off = align( 2,  off ); // not needed
    if ( *length != 4 ) RET( MIDDDS, short_seq_length );
    uint16_t * l = (uint16_t*)off;
    for (n=0; n<*length; n++ ) {
      if ( l[n] != n*10 ) RET( MIDDDS, short_seq );
    }
    off += 2*(*length);
  }


  // sequence of chars
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 8 ) RET( MIDDDS, char_seq_length );
    int8_t * l = (int8_t*)off;
    for (n=0; n<*length; n++ ) {
      if (  l[n] != (int8_t)(n*10) ) RET( MIDDDS, short_seq );
    }
    off += 1*(*length);
  }



  // sequence of uchars
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 12 ) RET( MIDDDS, uchar_seq_length );
    uint8_t * l = (uint8_t*)off;
    for (n=0; n<*length; n++ ) {
      if ( l[n] != n*10 ) RET( MIDDDS, uchar_seq );
    }
    off += 1*(*length);
  }



  // sequence of strings
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 13 ) RET( MIDDDS, string_seq_length );
    for (n=0; n<*length; n++ ) {
      char * string = (char*)off;
      char tstring[1024];
      sprintf(tstring, "DDS Message %d", n );
      if ( strcmp( string, tstring) != 0 )  RET( MIDDDS, string_seq );
      off += strlen(string) + 1;
      off = align( 4,  off );    
    }
  }



  // Array of emb structs size = 3
  {
    vi = 0;
    off = align( 8,  off );    
    int y;
    for (y=0; y<3; y++ ) {
      {
	off = align( 4,  off );
	uint32_t * value = (uint32_t*)off; off+=4;
	if ( *value != (uint32_t)y ) RET( MIDDDS, array_embmsg_value );
	off = align( 8,  off );
	uint32_t * length = (uint32_t*)off; off+=4;	
	if ( *length != (uint32_t)(y+2) ) RET( MIDDDS, array_embmsg_seq_length );
	off = align( 8,  off );
	double * d = (double *)off;
	for (n=0; n<*length; n++ ) {
	  if ( d[n] != n*10+y ) RET( MIDDDS, array_embmsg_seq_value );
	}
	off += (*length * sizeof(double));
      }
    }
  }

  // Sequence of arrays
  {
    vi=25;
    unsigned int y;
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 4 ) RET( MIDDDS, seq_long_arrays_length );
    for (y=0; y<*length; y++ ) {
      {
	off = align( 4,  off );
	uint32_t * l = (uint32_t *)off;
	for (n=0; n<4; n++ ) {
	  if ( l[n] != (uint32_t)vi++ ) RET( MIDDDS, seq_long_arrays );
	}
	off += (4 * 4);
      }
    }
  }

  // 2,3 array of sequences of embMsgs
  {
    vi=37;
    off = align( 8,  off );    
    int y,k;
    unsigned int uu;
    for ( k=0; k<2; k++ ) {
      for (y=0; y<3; y++ ) {

	uint32_t * slength = (uint32_t*)off; off+=4; 
	if ( *slength != (uint32_t)(2+k+y) ) RET( MIDDDS, array_seq_embmsg_length );
	
	// fill in the sequence
	for ( uu=0; uu<*slength; uu++ ) {
	  {
	    off = align( 8,  off );
	    uint32_t * value = (uint32_t*)off; off+=4;
	    if ( *value != (uint32_t)vi++ ) RET( MIDDDS, array_seq_embmsg_value );
	    off = align( 8,  off );
	    uint32_t * length = (uint32_t*)off; off+=4;
	    if ( *length != (uint32_t)(4+y) ) RET( MIDDDS, array_seq_embmsg_seq_length );
	    off = align( 8,  off );
	    double * d = (double *)off;
	    for (n=0; n<*length; n++ ) {
	      if ( d[n] != vi+10 ) RET( MIDDDS, array_seq_embmsg_seq_value );
	    }
	    off += ((*length) * sizeof(double));
	  }
	}
      }
    }
  }

  off = align(4,off);
  uint32_t * enum1 = (uint32_t *)off;
  if ( *enum1 != 1 ) RET( MIDDDS, emum );  
  off += 4;

  // sequence of strings
  {
    off = align( 4,  off );
    uint32_t * length = (uint32_t*)off; off+=4;
    if ( *length != 3 ) RET( MIDDDS, seq_strings2 );      
    for (n=0; n<*length; n++ ) {
      char * string = (char*)off;
      char tstring[1024];
      sprintf(tstring, "Hello OCPI  World, from DDS %d", n );
      if ( strcmp( tstring,string) != 0 )  RET( MIDDDS, seq_strings2 );
      off += strlen(string) + 1;
      off = align( 4,  off );    
    }
  }

  return 1;
}
Пример #27
0
/*
 * next - get next token
 */
static int						/* 1 normal, 0 failure */
next(struct vars * v)
{
	chr			c;

	/* errors yield an infinite sequence of failures */
	if (ISERR())
		return 0;				/* the error has set nexttype to EOS */

	/* remember flavor of last token */
	v->lasttype = v->nexttype;

	/* REG_BOSONLY */
	if (v->nexttype == EMPTY && (v->cflags & REG_BOSONLY))
	{
		/* at start of a REG_BOSONLY RE */
		RETV(SBEGIN, 0);		/* same as \A */
	}

	/* if we're nested and we've hit end, return to outer level */
	if (v->savenow != NULL && ATEOS())
	{
		v->now = v->savenow;
		v->stop = v->savestop;
		v->savenow = v->savestop = NULL;
	}

	/* skip white space etc. if appropriate (not in literal or []) */
	if (v->cflags & REG_EXPANDED)
		switch (v->lexcon)
		{
			case L_ERE:
			case L_BRE:
			case L_EBND:
			case L_BBND:
				skip(v);
				break;
		}

	/* handle EOS, depending on context */
	if (ATEOS())
	{
		switch (v->lexcon)
		{
			case L_ERE:
			case L_BRE:
			case L_Q:
				RET(EOS);
				break;
			case L_EBND:
			case L_BBND:
				FAILW(REG_EBRACE);
				break;
			case L_BRACK:
			case L_CEL:
			case L_ECL:
			case L_CCL:
				FAILW(REG_EBRACK);
				break;
		}
		assert(NOTREACHED);
	}

	/* okay, time to actually get a character */
	c = *v->now++;

	/* deal with the easy contexts, punt EREs to code below */
	switch (v->lexcon)
	{
		case L_BRE:				/* punt BREs to separate function */
			return brenext(v, c);
			break;
		case L_ERE:				/* see below */
			break;
		case L_Q:				/* literal strings are easy */
			RETV(PLAIN, c);
			break;
		case L_BBND:			/* bounds are fairly simple */
		case L_EBND:
			switch (c)
			{
				case CHR('0'):
				case CHR('1'):
				case CHR('2'):
				case CHR('3'):
				case CHR('4'):
				case CHR('5'):
				case CHR('6'):
				case CHR('7'):
				case CHR('8'):
				case CHR('9'):
					RETV(DIGIT, (chr) DIGITVAL(c));
					break;
				case CHR(','):
					RET(',');
					break;
				case CHR('}'):	/* ERE bound ends with } */
					if (INCON(L_EBND))
					{
						INTOCON(L_ERE);
						if ((v->cflags & REG_ADVF) && NEXT1('?'))
						{
							v->now++;
							NOTE(REG_UNONPOSIX);
							RETV('}', 0);
						}
						RETV('}', 1);
					}
					else
						FAILW(REG_BADBR);
					break;
				case CHR('\\'):	/* BRE bound ends with \} */
					if (INCON(L_BBND) && NEXT1('}'))
					{
						v->now++;
						INTOCON(L_BRE);
						RET('}');
					}
					else
						FAILW(REG_BADBR);
					break;
				default:
					FAILW(REG_BADBR);
					break;
			}
			assert(NOTREACHED);
			break;
		case L_BRACK:			/* brackets are not too hard */
			switch (c)
			{
				case CHR(']'):
					if (LASTTYPE('['))
						RETV(PLAIN, c);
					else
					{
						INTOCON((v->cflags & REG_EXTENDED) ?
								L_ERE : L_BRE);
						RET(']');
					}
					break;
				case CHR('\\'):
					NOTE(REG_UBBS);
					if (!(v->cflags & REG_ADVF))
						RETV(PLAIN, c);
					NOTE(REG_UNONPOSIX);
					if (ATEOS())
						FAILW(REG_EESCAPE);
					(DISCARD) lexescape(v);
					switch (v->nexttype)
					{			/* not all escapes okay here */
						case PLAIN:
							return 1;
							break;
						case CCLASS:
							switch (v->nextvalue)
							{
								case 'd':
									lexnest(v, brbackd, ENDOF(brbackd));
									break;
								case 's':
									lexnest(v, brbacks, ENDOF(brbacks));
									break;
								case 'w':
									lexnest(v, brbackw, ENDOF(brbackw));
									break;
								default:
									FAILW(REG_EESCAPE);
									break;
							}
							/* lexnest done, back up and try again */
							v->nexttype = v->lasttype;
							return next(v);
							break;
					}
					/* not one of the acceptable escapes */
					FAILW(REG_EESCAPE);
					break;
				case CHR('-'):
					if (LASTTYPE('[') || NEXT1(']'))
						RETV(PLAIN, c);
					else
						RETV(RANGE, c);
					break;
				case CHR('['):
					if (ATEOS())
						FAILW(REG_EBRACK);
					switch (*v->now++)
					{
						case CHR('.'):
							INTOCON(L_CEL);
							/* might or might not be locale-specific */
							RET(COLLEL);
							break;
						case CHR('='):
							INTOCON(L_ECL);
							NOTE(REG_ULOCALE);
							RET(ECLASS);
							break;
						case CHR(':'):
							INTOCON(L_CCL);
							NOTE(REG_ULOCALE);
							RET(CCLASS);
							break;
						default:		/* oops */
							v->now--;
							RETV(PLAIN, c);
							break;
					}
					assert(NOTREACHED);
					break;
				default:
					RETV(PLAIN, c);
					break;
			}
			assert(NOTREACHED);
			break;
		case L_CEL:				/* collating elements are easy */
			if (c == CHR('.') && NEXT1(']'))
			{
				v->now++;
				INTOCON(L_BRACK);
				RETV(END, '.');
			}
			else
				RETV(PLAIN, c);
			break;
		case L_ECL:				/* ditto equivalence classes */
			if (c == CHR('=') && NEXT1(']'))
			{
				v->now++;
				INTOCON(L_BRACK);
				RETV(END, '=');
			}
			else
				RETV(PLAIN, c);
			break;
		case L_CCL:				/* ditto character classes */
			if (c == CHR(':') && NEXT1(']'))
			{
				v->now++;
				INTOCON(L_BRACK);
				RETV(END, ':');
			}
			else
				RETV(PLAIN, c);
			break;
		default:
			assert(NOTREACHED);
			break;
	}

	/* that got rid of everything except EREs and AREs */
	assert(INCON(L_ERE));

	/* deal with EREs and AREs, except for backslashes */
	switch (c)
	{
		case CHR('|'):
			RET('|');
			break;
		case CHR('*'):
			if ((v->cflags & REG_ADVF) && NEXT1('?'))
			{
				v->now++;
				NOTE(REG_UNONPOSIX);
				RETV('*', 0);
			}
			RETV('*', 1);
			break;
		case CHR('+'):
			if ((v->cflags & REG_ADVF) && NEXT1('?'))
			{
				v->now++;
				NOTE(REG_UNONPOSIX);
				RETV('+', 0);
			}
			RETV('+', 1);
			break;
		case CHR('?'):
			if ((v->cflags & REG_ADVF) && NEXT1('?'))
			{
				v->now++;
				NOTE(REG_UNONPOSIX);
				RETV('?', 0);
			}
			RETV('?', 1);
			break;
		case CHR('{'):			/* bounds start or plain character */
			if (v->cflags & REG_EXPANDED)
				skip(v);
			if (ATEOS() || !iscdigit(*v->now))
			{
				NOTE(REG_UBRACES);
				NOTE(REG_UUNSPEC);
				RETV(PLAIN, c);
			}
			else
			{
				NOTE(REG_UBOUNDS);
				INTOCON(L_EBND);
				RET('{');
			}
			assert(NOTREACHED);
			break;
		case CHR('('):			/* parenthesis, or advanced extension */
			if ((v->cflags & REG_ADVF) && NEXT1('?'))
			{
				NOTE(REG_UNONPOSIX);
				v->now++;
				switch (*v->now++)
				{
					case CHR(':'):		/* non-capturing paren */
						RETV('(', 0);
						break;
					case CHR('#'):		/* comment */
						while (!ATEOS() && *v->now != CHR(')'))
							v->now++;
						if (!ATEOS())
							v->now++;
						assert(v->nexttype == v->lasttype);
						return next(v);
						break;
					case CHR('='):		/* positive lookahead */
						NOTE(REG_ULOOKAHEAD);
						RETV(LACON, 1);
						break;
					case CHR('!'):		/* negative lookahead */
						NOTE(REG_ULOOKAHEAD);
						RETV(LACON, 0);
						break;
					default:
						FAILW(REG_BADRPT);
						break;
				}
				assert(NOTREACHED);
			}
			if (v->cflags & REG_NOSUB)
				RETV('(', 0);	/* all parens non-capturing */
			else
				RETV('(', 1);
			break;
		case CHR(')'):
			if (LASTTYPE('('))
				NOTE(REG_UUNSPEC);
			RETV(')', c);
			break;
		case CHR('['):			/* easy except for [[:<:]] and [[:>:]] */
			if (HAVE(6) && *(v->now + 0) == CHR('[') &&
				*(v->now + 1) == CHR(':') &&
				(*(v->now + 2) == CHR('<') ||
				 *(v->now + 2) == CHR('>')) &&
				*(v->now + 3) == CHR(':') &&
				*(v->now + 4) == CHR(']') &&
				*(v->now + 5) == CHR(']'))
			{
				c = *(v->now + 2);
				v->now += 6;
				NOTE(REG_UNONPOSIX);
				RET((c == CHR('<')) ? '<' : '>');
			}
			INTOCON(L_BRACK);
			if (NEXT1('^'))
			{
				v->now++;
				RETV('[', 0);
			}
			RETV('[', 1);
			break;
		case CHR('.'):
			RET('.');
			break;
		case CHR('^'):
			RET('^');
			break;
		case CHR('$'):
			RET('$');
			break;
		case CHR('\\'): /* mostly punt backslashes to code below */
			if (ATEOS())
				FAILW(REG_EESCAPE);
			break;
		default:				/* ordinary character */
			RETV(PLAIN, c);
			break;
	}

	/* ERE/ARE backslash handling; backslash already eaten */
	assert(!ATEOS());
	if (!(v->cflags & REG_ADVF))
	{							/* only AREs have non-trivial escapes */
		if (iscalnum(*v->now))
		{
			NOTE(REG_UBSALNUM);
			NOTE(REG_UUNSPEC);
		}
		RETV(PLAIN, *v->now++);
	}
	(DISCARD) lexescape(v);
	if (ISERR())
		FAILW(REG_EESCAPE);
	if (v->nexttype == CCLASS)
	{							/* fudge at lexical level */
		switch (v->nextvalue)
		{
			case 'd':
				lexnest(v, backd, ENDOF(backd));
				break;
			case 'D':
				lexnest(v, backD, ENDOF(backD));
				break;
			case 's':
				lexnest(v, backs, ENDOF(backs));
				break;
			case 'S':
				lexnest(v, backS, ENDOF(backS));
				break;
			case 'w':
				lexnest(v, backw, ENDOF(backw));
				break;
			case 'W':
				lexnest(v, backW, ENDOF(backW));
				break;
			default:
				assert(NOTREACHED);
				FAILW(REG_ASSERT);
				break;
		}
		/* lexnest done, back up and try again */
		v->nexttype = v->lasttype;
		return next(v);
	}
	/* otherwise, lexescape has already done the work */
	return !ISERR();
}
Пример #28
0
/* ( -- success? ) */
static void
dlabel_open( dlabel_info_t *di )
{
	char *path;
	char block0[512];
	phandle_t ph;
	int success=0;
	cell status;

	path = my_args_copy();

	DPRINTF("dlabel-open '%s'\n", path );

	di->part_ih = 0;

	/* Find parent methods */
	di->filesystem_ph = 0;
	di->parent_seek_xt = find_parent_method("seek");
	di->parent_tell_xt = find_parent_method("tell");
	di->parent_read_xt = find_parent_method("read");

	/* If arguments have been passed, determine the partition/filesystem type */
	if (path && strlen(path)) {

		/* Read first block from parent device */
		DPUSH(0);
		call_package(di->parent_seek_xt, my_parent());
		POP();

		PUSH(pointer2cell(block0));
		PUSH(sizeof(block0));
		call_package(di->parent_read_xt, my_parent());
		status = POP();
		if (status != sizeof(block0))
			goto out;

		/* Find partition handler */
		PUSH( pointer2cell(block0) );
		selfword("find-part-handler");
		ph = POP_ph();
		if( ph ) {
			/* We found a suitable partition handler, so interpose it */
			DPRINTF("Partition found on disk - scheduling interpose with ph " FMT_ucellx "\n", ph);

			push_str(path);
			PUSH_ph(ph);
			fword("interpose");	

			success = 1;
		} else {
			/* unknown (or missing) partition map,
			* try the whole disk
			*/

			DPRINTF("Unknown or missing partition map; trying whole disk\n");

			/* Probe for filesystem from start of device */
			DPUSH ( 0 );	
			PUSH_ih( my_self() );
			selfword("find-filesystem");
			ph = POP_ph();
			if( ph ) {
				/* If we have been asked to open a particular file, interpose the filesystem package with the passed filename as an argument */
				di->filesystem_ph = ph;

				DPRINTF("Located filesystem with ph " FMT_ucellx "\n", ph);
				DPRINTF("path: %s length: %d\n", path, strlen(path));

				if (path && strlen(path)) {
					DPRINTF("INTERPOSE!\n");

					push_str( path );
					PUSH_ph( ph );
					fword("interpose");
				}
			} else if (path && strcmp(path, "%BOOT") != 0) {
				goto out;
			}

			success = 1;
		}
	} else {
		/* No arguments were passed, so we just use the parent raw device directly */
		success = 1;
	}

out:
	if( path )
		free( path );
	if( !success ) {
		dlabel_close( di );
		RET(0);
	}
	PUSH(-1);
}
Пример #29
0
/*
 * brenext - get next BRE token
 *
 * This is much like EREs except for all the stupid backslashes and the
 * context-dependency of some things.
 */
static int						/* 1 normal, 0 failure */
brenext(struct vars * v,
		chr pc)
{
	chr			c = (chr) pc;

	switch (c)
	{
		case CHR('*'):
			if (LASTTYPE(EMPTY) || LASTTYPE('(') || LASTTYPE('^'))
				RETV(PLAIN, c);
			RET('*');
			break;
		case CHR('['):
			if (HAVE(6) && *(v->now + 0) == CHR('[') &&
				*(v->now + 1) == CHR(':') &&
				(*(v->now + 2) == CHR('<') ||
				 *(v->now + 2) == CHR('>')) &&
				*(v->now + 3) == CHR(':') &&
				*(v->now + 4) == CHR(']') &&
				*(v->now + 5) == CHR(']'))
			{
				c = *(v->now + 2);
				v->now += 6;
				NOTE(REG_UNONPOSIX);
				RET((c == CHR('<')) ? '<' : '>');
			}
			INTOCON(L_BRACK);
			if (NEXT1('^'))
			{
				v->now++;
				RETV('[', 0);
			}
			RETV('[', 1);
			break;
		case CHR('.'):
			RET('.');
			break;
		case CHR('^'):
			if (LASTTYPE(EMPTY))
				RET('^');
			if (LASTTYPE('('))
			{
				NOTE(REG_UUNSPEC);
				RET('^');
			}
			RETV(PLAIN, c);
			break;
		case CHR('$'):
			if (v->cflags & REG_EXPANDED)
				skip(v);
			if (ATEOS())
				RET('$');
			if (NEXT2('\\', ')'))
			{
				NOTE(REG_UUNSPEC);
				RET('$');
			}
			RETV(PLAIN, c);
			break;
		case CHR('\\'):
			break;				/* see below */
		default:
			RETV(PLAIN, c);
			break;
	}

	assert(c == CHR('\\'));

	if (ATEOS())
		FAILW(REG_EESCAPE);

	c = *v->now++;
	switch (c)
	{
		case CHR('{'):
			INTOCON(L_BBND);
			NOTE(REG_UBOUNDS);
			RET('{');
			break;
		case CHR('('):
			RETV('(', 1);
			break;
		case CHR(')'):
			RETV(')', c);
			break;
		case CHR('<'):
			NOTE(REG_UNONPOSIX);
			RET('<');
			break;
		case CHR('>'):
			NOTE(REG_UNONPOSIX);
			RET('>');
			break;
		case CHR('1'):
		case CHR('2'):
		case CHR('3'):
		case CHR('4'):
		case CHR('5'):
		case CHR('6'):
		case CHR('7'):
		case CHR('8'):
		case CHR('9'):
			NOTE(REG_UBACKREF);
			RETV(BACKREF, (chr) DIGITVAL(c));
			break;
		default:
			if (iscalnum(c))
			{
				NOTE(REG_UBSALNUM);
				NOTE(REG_UUNSPEC);
			}
			RETV(PLAIN, c);
			break;
	}

	assert(NOTREACHED);
	return 0;
}
Пример #30
0
static gboolean
monitors_apply_config (gpointer user_data)
{
    ENTER;
    GtkWidget *p = user_data;
    MonitorsPlugin *mp;
    mp = lxpanel_plugin_get_data(p);

    int i;
    int current_n_monitors = 0;

start:
    for (i = 0; i < N_MONITORS; i++)
    {
        if (mp->displayed_monitors[i])
            current_n_monitors++;

        if (mp->displayed_monitors[i] && !mp->monitors[i])
        {
            /* We've just activated monitor<i> */
            mp->monitors[i] = monitors_add_monitor(p, mp,
                                                   update_functions[i],
                                                   tooltip_update[i],
                                                   colors[i]);
            /*
             * It is probably best for users if their monitors are always
             * displayed in the same order : the CPU monitor always on the left,
             * the RAM monitor always on the right of the CPU monitor (if the
             * CPU monitor is displayed), etc. That's why we do not just use
             * gtk_box_pack_start/gtk_box_pack_end, and use
             * gtk_box_reorder_child.
             */
            gtk_box_reorder_child(GTK_BOX(p),
                                  mp->monitors[i]->da,current_n_monitors-1);
        }
        else if (!mp->displayed_monitors[i] && mp->monitors[i])
        {
            /* We've just removed monitor<i> */
            gtk_widget_destroy(mp->monitors[i]->da);
            monitor_free(mp->monitors[i]);
            mp->monitors[i] = NULL;
        }
        if (mp->monitors[i] &&
            strncmp(mp->monitors[i]->color, colors[i], COLOR_SIZE) != 0)
        {
            /* We've changed the color */
            monitor_set_foreground_color(mp, mp->monitors[i], colors[i]);
        }
    }

    /* Workaround meant to prevent users to display no monitor at all.
     * FIXME : write something clean. When there is only one monitor displayed,
     * its toggle button should not be clickable in the prefs. */
    if (current_n_monitors == 0)
    {
        mp->displayed_monitors[0] = 1;
        goto start;
    }
    config_group_set_int(mp->settings, "DisplayCPU", mp->displayed_monitors[CPU_POSITION]);
    config_group_set_int(mp->settings, "DisplayRAM", mp->displayed_monitors[MEM_POSITION]);
    config_group_set_string(mp->settings, "Action", mp->action);
    config_group_set_string(mp->settings, "CPUColor",
                            mp->monitors[CPU_POSITION] ? colors[CPU_POSITION] : NULL);
    config_group_set_string(mp->settings, "RAMColor",
                            mp->monitors[MEM_POSITION] ? colors[MEM_POSITION] : NULL);

    RET(FALSE);
}