Esempio n. 1
0
expression *new_function_node(function *fn) {
  expression *function = xmalloc(sizeof(*function));
  function->operation.type = O_FUNCTION;
  function->type = xmalloc(sizeof(type));
  function->type->type = T_BLOCKREF;
  function->type->blocktype = xmalloc(sizeof(argument));
  function->type->blocktype->argument_type = copy_type(fn->return_type);
  function->type->blocktype->symbol_name = NULL;
  function->type->blocktype->next = copy_arguments(fn->argument, false);
  function->function = fn;
  function->next = NULL;
  function->line = fn->line;
  function->offset = fn->offset;
  return function;
}
Esempio n. 2
0
int
execlp(const char* file, const char* arg, ...)
{
	const char** args;
	va_list list;
	int count;

	// count arguments

	va_start(list, arg);
	count = count_arguments(list, arg, NULL);
	va_end(list);

	// copy arguments

	args = (const char**)alloca((count + 1) * sizeof(char*));
	va_start(list, arg);
	copy_arguments(list, args, arg);
	va_end(list);

	return execvp(file, (char* const*)args);
}
Esempio n. 3
0
int
execl(const char* path, const char* arg, ...)
{
	const char** args;
	va_list list;
	int count;

	// count arguments

	va_start(list, arg);
	count = count_arguments(list, arg, NULL);
	va_end(list);

	// copy arguments

	args = (const char**)alloca((count + 1) * sizeof(char*));
	va_start(list, arg);
	copy_arguments(list, args, arg);
	va_end(list);

	return do_exec(path, (char* const*)args, environ, false);
}
Esempio n. 4
0
int
execle(const char* path, const char* arg, ... /*, char** env */)
{
	const char** args;
	char** env;
	va_list list;
	int count;

	// count arguments

	va_start(list, arg);
	count = count_arguments(list, arg, &env);
	va_end(list);

	// copy arguments

	args = (const char**)alloca((count + 1) * sizeof(char*));
	va_start(list, arg);
	copy_arguments(list, args, arg);
	va_end(list);

	return do_exec(path, (char* const*)args, env, false);
}