精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>已关闭版区>>● 天神议事厅>>迷宫算法一例>>迷宫(二)

主题:迷宫(二)
发信人: jytjytjyt()
整理人: zhangsf(2000-01-03 18:35:38), 站内信件
// /adm/daemons/virtuald.c
// Modified by Find.

void create()
{
seteuid(getuid());
}

// This function is called by master object to return the "virtual" ob
ject
// of <file> when dirver failed to find such a file.

object compile_object(string file)
{
string pname = file;
object ob;

while (1)
{
int idx = strsrch(pname, "/", -1);

if(idx == -1)
return 0;

if( idx != 0 )
pname = pname[0..idx-1];

if(file_size(pname + ".c") >= 0)
if(ob = pname->query_maze_room(file[idx+1..]))
{
ob->set_virtual_flag();
return ob;
}
if(!idx)
return 0;
}

return 0;
}

--
※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 210.74.177.246]

[关闭][返回]