Commit e3559214 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Internationalised

Unused LMFiler put in the attic.
As LanMan has historically put its resources into ThirdPart/OmniClient this component has no ROM resources phase - it still registers the resources at run time.

Version 2.40. Tagged as 'LanManFS-2_40'
parent 95372462
......@@ -18,21 +18,28 @@
COMPONENT = LanManFS
OBJS = Xlate Transact Stats SMB RPC Printers Omni NetBIOS NBIP \
NameCache Logon LLC LanMan CoreFn buflib Attr \
Errors Interface
Interface MyResObj
CINCLUDES = -ITCPIPLibs:,C:
HDRS =
CMHGFILE = Lanman_MH
CMHGDEPENDS = LanMan LLC Logon NBIP Omni
LIBS = ${NET4LIBS} ${ASMUTILS}
RES_PATH = ThirdParty.OmniClient.LanManFS
RES_OBJ =
CUSTOMRES = custom
CDEFINES = -DCOMPAT_INET4 -DLONGNAMES ${OPTIONS}
CFLAGS = -Wp
CDFLAGS = -DDEBUG -DDEBUGLIB -DTRACE -Dprintf=module_printf
ASFLAGS = -pd "ROMSPRITES SETL {${ROMSPRITES}}"
ROMCDEFINES = -DROM
CMHGDEFINES = ${OPTIONS}
ifeq ("${CMDHELP}","None")
CMHGDEFINES += -DNO_INTERNATIONAL_HELP
endif
include CModule
# Static dependencies
MyResObj.o: LocalRes:ROM.Sprites ${MERGEDMSGS} ${DIRS}
${RESGEN} ${RES_AREA} $@ ${MERGEDMSGS} ${RES_PATH}.Messages LocalRes:ROM.Sprites ${RES_PATH}.Sprites
# Dynamic dependencies:
DispName:LAN Manager
WhoTCPIP:Lan Manager/TCPIP client
WhoBEUI:Lan Manager/NetBEUI client
WhoLogon:Lan Manager/Logon client
XtrLogon:Logon Network
Free:Bytes free
Used:Bytes used
UsedUK:Bytes used unavailable
Type0:Disc
Type1:Printer
Type2:Comms
Type3:IPC
HdrShares:Sharename Type Comment
HdrServrs:Server Comment
ConfFS:<domain name> | <file-server>
Start:started
BootBad:Unable to boot from
NotStart:not started
NotLogon:not logged on
NoUser:(none)
NoDC:<not found>
NoHome:(unset)
LocProb:error(s) locating network resources
LocDesc:Last error
Serv:Server
Drvs:Drives
Prns:Printers
Mnt:Mount
On:on server
User:as user
NameL:----Longest-----
NameO:OmniClient
NameH:Machine name
NameD:Driver name
NameM:Name mode
NameW:Workgroup/domain
NameU:Username
NameP:Primary DC
NamHD:Home directory
NamHS:Home server
NamHP:Home path
E00:LanManFS internal error
E01:Bad parameters
E02:No connection to server
E03:Out of buffers
E04:Connection to server failed
E05:Out of handles
E06:Receive not ready
E07:Connection already exists
E08:Timeout error
E09:This workstation name already exists
E20:Cannot find given server
E21:Data length error
E22:Error from server
E23:Unable to perform operation
E24:Hardware error on server
E25:Network protocol error
E26:No more files
E27:File not found
E28:Directory not found
E29:Server out of file handles
E30:Access denied
E31:File already exists
E32:Incorrect password
E33:Illegal name
E34:No such connection
E35:RISCOS 2 directory functions not supported
E36:OS_GBPB not supported
E37:Unbuffered file functions not supported
E38:LanManFS has not been loaded
E39:Function not implemented
E40:Wildcards not allowed
E41:File attributes could not be read
E42:File attributes could not be written
E43:File sharing violation
E44:Connection limit has been reached
E45:Share name does not exist
E46:Bad LanManFS command line
E47:LanManFS requires RISC OS 3.00 or later
E48:Initialisation failed
E49:Network driver not found
E50:Network interface is of incorrect type
E51:Network driver is not DCI-4 compatible
E52:Already connected to this drive on this server
E53:IEEE802.3 frames are already being used by another protocol
E54:Buffer manager module is not installed
E55:RPC call returned error
E56:Disc full
E57:Directory not empty
E58:Can't rename across shares
E59:Bad file handle
E60:Cannot create TCP/IP socket
E61:Cannot make TCP/IP connection
E62:Connection rejected by server
E63:Too many re-target requests
E64:Unable to determine this machine's IP address
E65:Internet module is not present or not working
E66:!ArmBoot files are nested too deep
E67:Error while running !ArmBoot file
E68:Home directory name not valid
E69:Could not connect to home directory
E10:User name not recognised
E11:User account has been disabled
E12:LanManFS in use
/* (2.39)
/* (2.40)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 2.39
#define Module_MajorVersion_CMHG 2.40
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 30 Sep 2013
#define Module_Date_CMHG 03 Oct 2013
#define Module_MajorVersion "2.39"
#define Module_Version 239
#define Module_MajorVersion "2.40"
#define Module_Version 240
#define Module_MinorVersion ""
#define Module_Date "30 Sep 2013"
#define Module_Date "03 Oct 2013"
#define Module_ApplicationDate "30-Sep-13"
#define Module_ApplicationDate "03-Oct-13"
#define Module_ComponentName "LanManFS"
#define Module_ComponentPath "castle/RiscOS/Sources/Networking/Omni/Protocols/LanManFS"
#define Module_FullVersion "2.39"
#define Module_HelpVersion "2.39 (30 Sep 2013)"
#define Module_LibraryVersionInfo "2:39"
#define Module_FullVersion "2.40"
#define Module_HelpVersion "2.40 (03 Oct 2013)"
#define Module_LibraryVersionInfo "2:40"
......@@ -422,7 +422,7 @@ _kernel_oserror *fsentry_func ( int *R )
if (flushnames) NameCache_Flush(ncf_FSFUNC_EXIT);
#endif
return Xlt_Error(err);
return MsgError(err);
}
......@@ -467,11 +467,11 @@ _kernel_oserror *fsentry_file( int *R )
)
{
R[0] = 0;
return Xlt_Error(OK);
return MsgError(OK);
}
if ( err != OK )
return Xlt_Error(err);
return MsgError(err);
switch ( R[0] )
{
......@@ -680,7 +680,7 @@ _kernel_oserror *fsentry_file( int *R )
if (flushnames) NameCache_Flush(ncf_FSFILE_EXIT);
#endif
return Xlt_Error(err);
return MsgError(err);
}
/* Open/Close subroutines --------------------------------------- */
......@@ -741,11 +741,11 @@ _kernel_oserror *fsentry_open( int *R )
err = Xlt_ConvertPath ( name_R(1), DOSnamebuf );
if ( err != OK )
return Xlt_Error(err);
return MsgError(err);
fid = NewHandle();
if ( fid < 0 )
return Xlt_Error(ENOHANDLES);
return MsgError(ENOHANDLES);
pFI = &FileTbl[fid];
pFI->filesw_id = R[3];
......@@ -806,7 +806,7 @@ _kernel_oserror *fsentry_open( int *R )
NameCache_Flush(ncf_FSOPEN_EXIT);
#endif
}
return Xlt_Error(err);
return MsgError(err);
}
/* GetBytes =================================================== */
......@@ -816,9 +816,9 @@ _kernel_oserror *fsentry_getbytes( int *R )
int fid = R[1]-1;
if ( fid < 0 || fid >= MAXFILES || FileTbl[fid].Free )
return Xlt_Error(EBADPARAM);
return MsgError(EBADPARAM);
return Xlt_Error( SMB_Read (FileTbl[fid].SMB_FH,
return MsgError( SMB_Read (FileTbl[fid].SMB_FH,
R[4], /* Offset */
R[3], /* Length */
(BYTE *)(R[2]), /* Where */
......@@ -833,9 +833,9 @@ _kernel_oserror *fsentry_putbytes( int *R )
int fid = R[1]-1;
if ( fid < 0 || fid >= MAXFILES || FileTbl[fid].Free )
return Xlt_Error(EBADPARAM);
return MsgError(EBADPARAM);
return Xlt_Error ( SMB_Write (FileTbl[fid].SMB_FH,
return MsgError ( SMB_Write (FileTbl[fid].SMB_FH,
R[4], /* Offset */
R[3], /* Length */
(BYTE *)(R[2]), /* Where */
......@@ -847,7 +847,7 @@ _kernel_oserror *fsentry_putbytes( int *R )
_kernel_oserror *fsentry_gbpb( int *R )
{
(void)R;
return Xlt_Error(ENOGBPB);
return MsgError(ENOGBPB);
}
/* Close =================================================== */
......@@ -860,7 +860,7 @@ _kernel_oserror *fsentry_close( int *R )
int fid = R[1]-1;
if ( fid < 0 || fid >= MAXFILES || FileTbl[fid].Free )
return Xlt_Error(EBADPARAM);
return MsgError(EBADPARAM);
/* On entry, R2/R3 contain new timestamp for file.
This call will be unable to alter the file-type as
......@@ -876,7 +876,7 @@ _kernel_oserror *fsentry_close( int *R )
err=SMB_Close( FileTbl[fid].SMB_FH, &FileTbl[fid].da);
FileTbl[fid].Free = true;
return Xlt_Error(err);
return MsgError(err);
}
/* Args ========================================== */
......@@ -927,7 +927,7 @@ _kernel_oserror *fsentry_args( int *R )
debug1("FS_args(%d)\n", R[0]);
if ( fid < 0 || fid >= MAXFILES || FileTbl[fid].Free )
return Xlt_Error(EBADPARAM);
return MsgError(EBADPARAM);
switch( R[0] )
{
......@@ -982,7 +982,7 @@ _kernel_oserror *fsentry_args( int *R )
break;
}
return Xlt_Error(err);
return MsgError(err);
}
/* Init --------------------------------- */
......
/* Copyright 1998 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* *************************************************
C.LMFILER - Filer module for Lan Manager client
Version
25-03-94 INH First proper version
06-09-95 Doesn't keep putting '-' in user name field
*********************************************** */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "kernel.h"
#include "swis.h"
#include "wimp.h"
#include "wimpt.h"
#include "werr.h"
#define ICONBAR (-2)
#define MENUSIZE(a) ((a)*24+28)
typedef struct { wimp_menuhdr hdr; wimp_menuitem item[1]; } wimp_menu;
typedef struct { wimp_wind wind; wimp_icon icon[1]; } wimp_iwind;
static wimp_t TaskHandle;
static char *mod_name = "Lan Manager Filer";
static wimp_menu *iconmenu;
static char work_buf[1200];
static BOOL NoConnections = TRUE;
/* --------------------------- */
/* Definitions for our icons on the icon bar */
#define MAX_DRIVES 4
#define ICON_NAMELEN 8
struct BarIconDef
{
BOOL valid;
int icon_id;
char name[ICON_NAMELEN+1];
}
Bar_Icons[MAX_DRIVES];
/* --------------------------- */
static char *stripCR ( char *buf )
{
char *res=buf;
while ( *buf > 32 ) buf++;
*buf=0;
return res;
}
static char *checkblank ( char *buf )
{
if ( !isprint( buf[0] ) )
return "-";
else
return buf;
}
/*********************** INITIALISATION ******************************/
static BOOL IconBarAdd(int drv, char *icname)
/* Adds an instance of our icon to the icon bar, with the given name. */
{
_kernel_swi_regs R;
wimp_icreate wi; /* Wimp-CreateIcon structure */
int len;
strncpy(Bar_Icons[drv].name, icname, ICON_NAMELEN);
Bar_Icons[drv].name[ICON_NAMELEN] = 0;
len = strlen ( Bar_Icons[drv].name );
if ( drv < 0 || drv >= MAX_DRIVES ) return FALSE;
R.r[0] = 0x33000000; /* Priority */
R.r[1] = (int) &wi;
wi.w = ICONBAR;
wi.i.box.x0 = 0;
wi.i.box.x1 = (len<4) ? 68 : len*16; /* X bounds */
wi.i.box.y0 = -16;
wi.i.box.y1 = 86; /* Y bounds */
wi.i.flags = wimp_ITEXT | wimp_ISPRITE | wimp_INDIRECT |
wimp_IHCENTRE | 0 | 0 |
wimp_IBTYPE*wimp_BCLICKDEBOUNCE |
wimp_IFORECOL * 7 |
wimp_IBACKCOL * 1;
wi.i.data.indirecttext.buffer= Bar_Icons[drv].name;
wi.i.data.indirecttext.validstring="Slan_conn";
wi.i.data.indirecttext.bufflen=len + 1;
if ( _kernel_swi ( Wimp_CreateIcon, &R, &R ) != NULL )
return FALSE;
Bar_Icons[drv].icon_id = R.r[0];
Bar_Icons[drv].valid = TRUE;
return TRUE;
}
/* --------------------- */
static void IconBarDel(int drv)
/* Deletes this instance of our icon */
{
if ( drv < 0 || drv >= MAX_DRIVES || !Bar_Icons[drv].valid)
return;
wimp_delete_icon ( ICONBAR, Bar_Icons[drv].icon_id );
Bar_Icons[drv].valid = FALSE;
}
/* ---------------------------- */
static char indirect_buf[2000];
static wimp_template wt;
static wimp_iwind *LoadTemplate( char *name )
{
wimp_iwind *res;
int size;
char searchname[12];
memset( searchname, 0, 12 );
strcpy( searchname, name );
wt.name = searchname;
wt.buf = (wimp_wind *)work_buf;
wt.font = (wimp_font_array *)(-1);
wt.index = 0;
wimpt_complain( wimp_load_template(&wt) );
if ( wt.index == 0 )
{
werr(TRUE, "Template '%s' not found", name);
return NULL;
}
size = wt.buf->nicons*sizeof(wimp_icon)+sizeof(wimp_wind);
res = (wimp_iwind *)malloc(size);
if ( res != NULL )
memcpy ( res, work_buf, size );
else
werr(FALSE, "Not enough memory for templates");
return res;
}
/* ---------------------------- */
#define LOGON_SERVER 1
#define LOGON_SHARENAME 3
#define LOGON_USERNAME 5
#define LOGON_PASSWORD 7
static wimp_w hLogonWind;
static wimp_w hAboutWind;
static wimp_iwind *LogonWindow;
static wimp_iwind *AboutWindow;
static BOOL CreateWindows(void)
{
if (wimpt_complain ( wimp_open_template("<LanMan$Dir>.Templates") )
!= NULL)
return FALSE;
wt.work_free = indirect_buf;
wt.work_end = indirect_buf + sizeof(indirect_buf) - 1;
LogonWindow = LoadTemplate("logon");
AboutWindow = LoadTemplate("proginfo");
wimp_close_template();
if ( LogonWindow == NULL || AboutWindow == NULL )
return FALSE;
/* Create & get window handles */
if (wimpt_complain ( wimp_create_wind ( &LogonWindow->wind, &hLogonWind ) )
!= NULL)
return FALSE;
if (wimpt_complain ( wimp_create_wind ( &AboutWindow->wind, &hAboutWind ) )
!= NULL)
return FALSE;
return TRUE;
}
/* ---------------------------- */
#define ICON_MENU_ITEMS 3
#define IconMenu_Logon 0
#define IconMenu_Logoff 1
#define IconMenu_Quit 2
static void AddMenu ( wimp_menuitem *i, char *name, int flg )
{
i->flags = flg;
i->submenu = (wimp_menuptr)-1;
i->iconflags = wimp_ITEXT | wimp_IFORECOL*7 | wimp_IBACKCOL*0;
strcpy(i->data.text,name);
}
/* ---------------------------- */
static BOOL IconMenuInit(void)
{
iconmenu = (wimp_menu *)malloc(MENUSIZE(ICON_MENU_ITEMS));
if ( iconmenu == NULL )
return FALSE;
strcpy( iconmenu->hdr.title,"Lan Man");
iconmenu->hdr.tit_fcol=7;
iconmenu->hdr.tit_bcol=2;
iconmenu->hdr.work_fcol = 7;
iconmenu->hdr.work_bcol = 0;
iconmenu->hdr.width = 160;
iconmenu->hdr.height = 44;
iconmenu->hdr.gap = 0;
AddMenu(iconmenu->item, "Logon", 0 );
iconmenu->item[0].submenu = (wimp_menuptr) hLogonWind;
AddMenu(iconmenu->item+1, "Logoff", 0 );
AddMenu(iconmenu->item+2, "Quit", wimp_MLAST );
return TRUE;
}
/* Initialise the program, returning TRUE if it was all OK. ************* */
static BOOL Initialise(void)
{
wimpt_init(mod_name);
TaskHandle = wimpt_task();
NoConnections = TRUE;
if ( !CreateWindows() ||
!IconBarAdd( 0, "Lan Man" ) ||
!IconMenuInit() )
return FALSE;
return TRUE;
}
/* ---------------------------------------- */
#define GetItemText(hWnd,itm) ((hWnd)->icon[(itm)].data.indirecttext.buffer)
static void DoLogon ( void )
{
int drv_no;
if ( NoConnections )
drv_no = 0;
else
{
for ( drv_no=0; drv_no<MAX_DRIVES; drv_no++ )
if ( !Bar_Icons[drv_no].valid )
break;
if ( drv_no >= MAX_DRIVES )
{
werr ( FALSE, "A maximum of %d connections are allowed",
MAX_DRIVES );
return;
}
}
sprintf( work_buf, "CONNECT %d %s %s %s %s", drv_no,
stripCR(GetItemText(LogonWindow,LOGON_SERVER)),
stripCR(GetItemText(LogonWindow,LOGON_SHARENAME)),
checkblank(stripCR(GetItemText(LogonWindow,LOGON_USERNAME))),
stripCR(GetItemText(LogonWindow,LOGON_PASSWORD)) );
if( _kernel_oscli(work_buf)==_kernel_ERROR )
{
wimp_reporterror((os_error *)_kernel_last_oserror(),0, mod_name);
return;
}
if ( NoConnections ) /* Replace 'Lan Man' icon with named one */
IconBarDel ( drv_no );
IconBarAdd ( drv_no, GetItemText(LogonWindow, LOGON_SHARENAME) );
NoConnections = FALSE;
}
/* ---------------------------------------- */
static void DoLogoff ( int drv_no )
{
int i;
if ( NoConnections || drv_no < 0 || drv_no >= MAX_DRIVES )
return;
sprintf( work_buf, "Filer_CloseDir Lanman::%d.$", drv_no );
_kernel_oscli(work_buf);
sprintf( work_buf, "DISCONNECT %d", drv_no );
if(_kernel_oscli(work_buf)==_kernel_ERROR)
wimp_reporterror((os_error *)_kernel_last_oserror(),0, mod_name);
IconBarDel(drv_no);
for ( i=0; i<MAX_DRIVES; i++ )
{