Ejemplo n.º 1
0
PRIVATE void list_input(char **buf, struct comal_line *line)
{
	struct input_rec *i = &line->lc.inputrec;

	list_symsp(buf, line->cmd);

	if (i->modifier)
		switch (i->modifier->type) {
		case fileSYM:
			list_file(buf, &i->modifier->data.twoexp);
			break;

		case stringSYM:
			list_string(buf, i->modifier->data.str->s);
			list_text(buf, ": ");
			break;

		default:
			fatal("Input modifier incorrect");
		}

	list_explist(buf, i->lvalroot, 0);
}
Ejemplo n.º 2
0
PUBLIC void list_exp(char **buf, struct expression *exp)
{
	char cvtbuf[64];

	if (!exp)
		return;

	switch (exp->optype) {
	case T_CONST:
		list_sym(buf, exp->op);
		break;

	case T_UNARY:
		if (exp->op != lparenSYM)
			list_sym(buf, exp->op);

		if (exp->op != minusSYM)
			list_char(buf, '(');

		list_exp(buf, exp->e.exp);

		if (exp->op != minusSYM)
			list_char(buf, ')');

		break;

	case T_SYS:
		list_sym(buf, sysSYM);
		list_explist(buf, exp->e.exproot, 1);
		break;

	case T_SYSS:
		list_sym(buf, syssSYM);
		list_explist(buf, exp->e.exproot, 1);
		break;

	case T_BINARY:
		if (exp->op==_RND)
			list_rnd(buf,exp);
		else
			list_twoexp(buf, &exp->e.twoexp, lex_opsym(exp->op), 1);
		break;

	case T_INTNUM:
		list_text(buf, ltoa(exp->e.num, cvtbuf, 10));
		break;

	case T_FLOAT:
		list_text(buf, exp->e.fnum.text);
		break;

	case T_STRING:
		list_string(buf, exp->e.str->s);
		break;

	case T_SUBSTR:
		list_exp(buf, exp->e.expsubstr.exp);
		list_char(buf, '(');
		list_twoexp(buf, &exp->e.expsubstr.twoexp, ":", 1);
		list_char(buf, ')');
		break;

	case T_ID:
		list_text(buf, exp->e.expid.id->name);
		list_explist(buf, exp->e.expid.exproot, 1);
		break;

	case T_ARRAY:
	case T_SARRAY:
		list_text(buf, exp->e.expid.id->name);
		list_text(buf,"()");
		break;

	case T_SID:
		list_text(buf, exp->e.expsid.id->name);
		list_explist(buf, exp->e.expsid.exproot, 1);

		if (exp->e.expsid.twoexp) {
			list_char(buf, '(');
			list_twoexp(buf, exp->e.expsid.twoexp, ":", 1);
			list_char(buf, ')');
		}

		break;

	case T_EXP_IS_NUM:
	case T_EXP_IS_STRING:
		list_exp(buf, exp->e.exp);
		break;

	default:
		list_text(buf, "<error: list exp default action>");
	}
}
Ejemplo n.º 3
0
char *pa_list_string_input_device(audio_devices_t devices) {
    return list_string(string_conversion_table_input_device, devices);
}
Ejemplo n.º 4
0
char *pa_list_string_flags(audio_output_flags_t flags) {
    return list_string(string_conversion_table_output_flag, flags);
}
Ejemplo n.º 5
0
/*
 * process message
 */
void process_message( void )
{
  unsigned long type, length, body[sizeof(struct ConfigWinPacket)];

  read_f( Fdr, (char*)&type, SOL);
  read_f( Fdr, (char*)&length, SOL);
  read_f( Fdr, (char*)body, length );

  if( type==M_ERROR )
  {
    fprintf( stderr,"%s", (char *)&body[3] );
  }
  else if( Opt_info >= 1 )
  {
    switch( type )
    {

    case M_WINDOW_NAME:
      list( body, "window");
      break;
    case M_ICON_NAME:
      list(body, "icon");
      break;
    case M_RES_CLASS:
      list(body, "class" );
      break;
    case M_RES_NAME:
      list(body, "resource");
      break;

    case M_END_WINDOWLIST:
      list_string("end windowlist");
      break;

    case M_ICON_FILE:
      list(body, "icon file");
      break;
    case M_ICON_LOCATION:
      list_icon_loc(body);
      break;

    case M_END_CONFIG_INFO:
      list_string("end configinfo");
      break;

    case M_DEFAULTICON:
      list(body, "default icon");
      break;

    case M_MINI_ICON:
      list_mini_icon( body );
      break;

    case M_CONFIG_INFO:
      printf( "%s\n", (char *)&body[3] );
      break;

    case MX_REPLY:
      list(body, "reply");
      break;

    default:
      if( Opt_info >=2 )
      {
	switch(type)
	{

	case M_CONFIGURE_WINDOW:
	  list_configure( body);
	  break;
	case M_STRING:
	  list(body, "string");
	  break;

	default:
	  if( Opt_info >= 3 )
	  {
	    switch( type )
	    {
	    case M_NEW_PAGE:
	      list_new_page(body);
	      break;
	    case M_NEW_DESK:
	      list_new_desk(body);
	      break;
	    case M_ADD_WINDOW:
	      list_header(body, "add");
	      list_configure( body);
	      break;
	    case M_RAISE_WINDOW:
	      list_header(body, "raise");
	      break;
	    case M_LOWER_WINDOW:
	      list_header(body, "lower");
	      break;
	    case M_FOCUS_CHANGE:
	      list_focus_change( body );
	      break;
	    case M_DESTROY_WINDOW:
	      list_header(body, "destroy");
	      break;
	    case M_ICONIFY:
	      list_iconify( body );
	      break;
	    case M_DEICONIFY:
	      list_header(body, "deiconify");
	      break;
	    case M_MAP:
	      list_header(body, "map");
	      break;
	    case M_WINDOWSHADE:
	      list_header(body, "windowshade");
	      break;
	    case M_DEWINDOWSHADE:
	      list_header(body, "dewindowshade");
	      break;
	    default:
	      printf("0x%lx type 0x%lx\n", body[0], type );
	    }
	  }
	}
      }
    }
  }
}