Esempio n. 1
0
int cmd_exec(struct command_t* command){
	if(error1(command))
		return -1;
	if(error2(command))
		return -2;
	if(error3(command))
		return -3;
	if(error4(command))
		return -4;
	if(error5(command))
		return -5;

	if(isNum(command->token[0])){
		command->arg1 = atoi(command->token[0]);
		strcpy(command->operation, command->token[1]);
		command->arg2 = atoi(command->token[2]);
	}
	else{
		strcpy(command->operation, command->token[0]);
		command->arg1 = atoi(command->token[1]);
	}

	DoOperation(command);
	return 0;
}
Esempio n. 2
0
inline void subMonomial::length(int newlength) {
#ifdef CAREFUL
   if(newlength<0) {
     error3(newlength);
   } else if (_start+newlength-1 > _mono.numberOfFactors()) {
     error4(newlength);
   } else 
#endif
   {
     _length = newlength;
   }
};
Esempio n. 3
0
/* connect to jack ports named in the NULL-terminated wishlist */
static int real_connect_jack_ports(out123_handle *ao
,	jack_handle_t* handle, const char** wishlist)
{
	const char **wish = wishlist;
	int ch, err;
	int ch_wrap = 0, wish_wrap = 0;

	if(!wish)
		return 0;
	if(wish != NULL && *wish == NULL)
		return 1; /* success, nothing connected as wanted */
	ch=0;
	/* Connect things as long as there are sources or sinks left. */
	while(!wish_wrap || !ch_wrap)
	{
		const char* in = jack_port_name(handle->ports[ch]);

		if((err = jack_connect(handle->client, in, *wish)) != 0 && err != EEXIST)
		{
			if(!AOQUIET)
				error4( "connect_jack_ports(): failed to jack_connect() ch%i (%s) to %s: %d"
				,	ch, in ? in : "<nil>", *wish, err );
			return 0;
		}
		/*
			Increment channel and wishlist, both possibly wrapping around, to
			ensure we connected all channels to some output port and provided
			some input to all ports in the wishlist. Both cases of less channels
			than output ports (splitting) and more channels	than output ports
			(downmix) are sensible.
		*/
		if(++ch == handle->channels)
		{
			ch = 0;
			++ch_wrap;
		}
		if(!*(++wish))
		{
			wish = wishlist;
			++wish_wrap;
		}
	}

	return 1;
}
Esempio n. 4
0
void Scanner::ErrorMessage(const char* msg, fint l, fint c) {
  if (suppress)
    return;
  error4("%s on line %ld, character %ld of \"%s\"", msg, l, c, fileName());
}
Esempio n. 5
0
void ch15ex2(void)
{
	error4();
}