void VT_InitOutput(void);
void VT_InitInput(void);
char *VT_ReadDir(tVFS_Node *Node, int Pos);
-tVFS_Node *VT_FindDir(tVFS_Node *Node, char *Name);
+tVFS_Node *VT_FindDir(tVFS_Node *Node, const char *Name);
int VT_Root_IOCtl(tVFS_Node *Node, int Id, void *Data);
Uint64 VT_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer);
Uint64 VT_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer);
val = arg + strpos(arg, '='); *val++ = '\0';
if( strcmp(opt, "Video") == 0 ) {
- if(gsVT_OutputDevice) free(gsVT_OutputDevice);
- gsVT_OutputDevice = strdup(val);
+ gsVT_OutputDevice = val;
}
else if( strcmp(opt, "Input") == 0 ) {
- if(gsVT_InputDevice) free(gsVT_InputDevice);
- gsVT_InputDevice = strdup(val);
+ gsVT_InputDevice = val;
}
else if( strcmp(opt, "Width") == 0 ) {
giVT_RealWidth = atoi( val );
}
}
+ if(gsVT_OutputDevice) Modules_InitialiseBuiltin( gsVT_OutputDevice );
+ if(gsVT_InputDevice) Modules_InitialiseBuiltin( gsVT_InputDevice );
+
// Apply Defaults
- if(!gsVT_OutputDevice) gsVT_OutputDevice = "/Devices/"DEFAULT_OUTPUT;
- if(!gsVT_InputDevice) gsVT_InputDevice = "/Devices/"DEFAULT_INPUT;
+ if(!gsVT_OutputDevice) gsVT_OutputDevice = DEFAULT_OUTPUT;
+ if(!gsVT_InputDevice) gsVT_InputDevice = DEFAULT_INPUT;
+
+ // Create paths
+ {
+ char *tmp;
+ tmp = malloc( 9 + strlen(gsVT_OutputDevice) + 1 );
+ strcpy(tmp, "/Devices/");
+ strcpy(&tmp[9], gsVT_OutputDevice);
+ gsVT_OutputDevice = tmp;
+ tmp = malloc( 9 + strlen(gsVT_InputDevice) + 1 );
+ strcpy(tmp, "/Devices/");
+ strcpy(&tmp[9], gsVT_InputDevice);
+ gsVT_InputDevice = tmp;
+ }
Log_Log("VTerm", "Using '%s' as output", gsVT_OutputDevice);
Log_Log("VTerm", "Using '%s' as input", gsVT_InputDevice);
}
/**
- * \fn tVFS_Node *VT_FindDir(tVFS_Node *Node, char *Name)
+ * \fn tVFS_Node *VT_FindDir(tVFS_Node *Node, const char *Name)
* \brief Find an item in the VTerm directory
* \param Node Root node
* \param Name Name (number) of the terminal
*/
-tVFS_Node *VT_FindDir(tVFS_Node *Node, char *Name)
+tVFS_Node *VT_FindDir(tVFS_Node *Node, const char *Name)
{
int num;