/*
 * This is a mudlib file. Copy it to /obj/simul_efun.c, or
 * wherever the get_simul_efun() in master.c says.
 * The functions defined in this file should only be replacements of efuns
 * no longer supported. Don't use these functions any longer, use the
 * replacement instead.
 */

#pragma strict_types
#pragma save_types

/*
 * The ls() function is no longer needed, as get_dir() can do the same
 * work.
 */
void ls(string path) {
    int i, len, tmp;
    mixed *dir;
    dir = get_dir(path);
    for (i=0; i < sizeof(dir); i++) {
	string name;
	if (file_size(path + "/" + dir[i]) == -2)
	    name = dir[i] + "/ ";
	else
	    name = dir[i] + " ";
	tmp = strlen(name);
	while(tmp % 8) {
	    tmp++;
	    name += " ";
	}
	if (len + tmp > 79) {
	    len = 0;
	    write("\n");
	}
	len += tmp;
	write(name);
    }
    write("\n");
}

mixed slice_array(mixed *arr,int from,int to)
{
  mixed *new_arr;
  int i;
  
  new_arr=({});
  if (from<0 || to <0) return 0;
  if (from>=sizeof(arr) || to>=sizeof(arr)) return 0;
  if (to<from) return 0;
  for (i=from;i<=to;i++)
    new_arr+=({arr[i]});
  return new_arr;

}
