- * \fn int FIFO_Relink(tVFS_Node *Node, const char *OldName, const char *NewName)
- * \brief Relink a file (Deletes named pipes)
- */
-int FIFO_Relink(tVFS_Node *Node, const char *OldName, const char *NewName)
-{
- tPipe *pipe, *tmp;
-
- if(Node != &gFIFO_DriverInfo.RootNode) return 0;
-
- // Can't relink anon
- if(strcmp(OldName, "anon")) return 0;
-
- // Find node
- for(pipe = gFIFO_NamedPipes;
- pipe;
- pipe = pipe->Next)
- {
- if(strcmp(pipe->Name, OldName) == 0)
- break;
- }
- if(!pipe) return 0;
-
- // Relink a named pipe
- if(NewName) {
- // Check new name
- for(tmp = gFIFO_NamedPipes;
- tmp;
- tmp = tmp->Next)
- {
- if(strcmp(tmp->Name, NewName) == 0) return 0;
- }
- // Create new name
- free(pipe->Name);
- pipe->Name = malloc(strlen(NewName)+1);
- strcpy(pipe->Name, NewName);
- return 1;
- }
-
- // Unlink the pipe
- if(Node->ImplPtr) {
- free(Node->ImplPtr);
- return 1;
- }
-
- return 0;
-}
-
-/**
- * \fn Uint64 FIFO_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)