Ejemplo n.º 1
0
void Node::addLink(unsigned int withDirection, Object* theTarget) {
  Action action;
  action.type = kActionSwitch;
  action.cursor = kCursorForward;
  action.target = theTarget;
  _link(withDirection, &action);
}
Ejemplo n.º 2
0
void Node::addCustomLink(unsigned withDirection, int luaHandler) {
  Action action;
  action.type = kActionFunction;
  action.cursor = kCursorForward;
  action.luaHandler = luaHandler;
  _link(withDirection, &action);
}
Ejemplo n.º 3
0
extern int
link(const char* fp, const char* tp)
{
	int	r;
	int	oerrno;
	char	fb[PATH_MAX];
	char	tb[PATH_MAX];

	oerrno = errno;
	if ((r = _link(fp, tp)) && errno == ENOENT && execrate(fp, fb, sizeof(fb), 1))
	{
		if (execrate(tp, tb, sizeof(tb), 1))
			tp = tb;
		errno = oerrno;
		r = _link(fb, tp);
	}
	return r;
}
Ejemplo n.º 4
0
    int
    link(const char *from,
         const char *to)
    {
      const fuse_context        *fc     = fuse_get_context();
      const Config              &config = Config::get(fc);
      const ugid::SetResetGuard  ugid(fc->uid,fc->gid);
      const rwlock::ReadGuard    readlock(&config.srcmountslock);

      return _link(config.getattr,
                   config.link,
                   config.srcmounts,
                   config.minfreespace,
                   from,
                   to);
    }
Ejemplo n.º 5
0
	int como__link (const char *oldpath, const char *newpath){

		HINSTANCE hinst;
		hinst = LoadLibrary("KERNEL32");
		FARPROC _link;
		_link = GetProcAddress (hinst, "CreateHardLinkA");

		if (_link == NULL){
			errno = ENOSYS;
			return -1;
		}

		if (_link (newpath, oldpath, NULL) == FALSE) {
			errno = GetLastError();
			return -1;
		}

		return 0;
	}
Ejemplo n.º 6
0
int main(int argc, char * argv[], char * env[])
{
	char line[128], command[128], pathname[128];
	int ID;
	
	// DEVICE SELECT
	get_device();

	// INITIALIZE 
	init();
	
	// MOUNT ROOT
	mount_root();

	// PROCESS LOOP
	while(1)
	{
		strcpy(line, "");
		strcpy(command, "");
		strcpy(pathname, "");
		strcpy(completePath, "");

		printf("\n\ninput a command (type help for more info): ");
		//read a line containting  command [pathname]; // [ ] means optional
		fgets(line, 256, stdin);
		line[strlen(line)-1] = '\0';

		//Find the command string and call the corresponding function;
		parseString(line, arg1, command, pathname);

		compPath(pathname);
		
		
		printf("PATHNAME: %s\n", pathname);
		ID = findCommand(command);
		switch(ID)
		{
			case -1 : printDir(running->cwd->ino);	break;
			case  0 : _menu  (arg1, pathname);	break;
			case  1 : _ls    (arg1, pathname);	break;
			case  2 : _cd    (arg1, pathname);	break;
			case  3 : _mkdir (arg1, pathname);	break;
			case  4 : _rmdir (arg1, pathname);	break;
			case  5 : _pwd   (arg1, pathname);	break;
			case  6 : _creat0(arg1, pathname);	break;
			case  7 : _rm    (arg1, pathname);	break;
			case  8 : _stat  (arg1, pathname);	break;
			case  9 : compPath(arg1); _link(arg1, pathname); break;
			case  10: _unlink(arg1, pathname); break;
			case  11: compPath(arg1); _symlink(arg1, pathname); break;
			case  12: _touch (arg1, pathname);	break;
			case  13: _chmod (arg1, pathname);	break;
			case  14: _chown (arg1, pathname);	break;
			case  15: _chgrp (arg1, pathname);	break;
			case  16: _open  (arg1, pathname);	break;
			case  17: _close (arg1, pathname);	break;
			case  18: _read  (arg1, pathname);	break;
			case  19: _write (arg1, pathname);	break;
			case  20: _pfd   (arg1, pathname);	break;
			case  21: _lseek (arg1, pathname);	break;
			case  22: _cat   (arg1, pathname);	break;
			case  23: _cp    (arg1, pathname);	break;
			case  24: _mv    (arg1, pathname);	break;
			case  25: __exit (arg1, pathname);	break;
		}
	}
	
	quit();
	return 0;
}