2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: Sets the name of the current program.
8 #include <proto/exec.h>
11 #include <dos/dosextens.h>
12 #include "dos_intern.h"
14 /*****************************************************************************
18 #include <proto/dos.h>
20 AROS_LH1(BOOL
, SetProgramName
,
23 AROS_LHA(CONST_STRPTR
, name
, D1
),
26 struct DosLibrary
*, DOSBase
, 95, Dos
)
29 Sets the name for the current program in the CLI structure. If the
30 name doesn't fit the old name is kept and a failure is returned.
31 If the current process doesn't have a CLI structure this function
35 name - Name for the current program.
38 != 0 on success, 0 on failure.
45 Never copies more than 255 bytes.
52 *****************************************************************************/
56 return internal_SetProgramName(Cli(), name
, DOSBase
) ? DOSTRUE
: DOSFALSE
;
59 } /* SetProgramName */
62 BOOL
internal_SetProgramName(struct CommandLineInterface
*cli
,
63 CONST_STRPTR name
, struct DosLibrary
*DOSBase
)
79 namelen
= s
- name
- 1;
86 bs
= AROS_BSTR_ADDR(cli
->cli_CommandName
);
88 AROS_BSTR_setstrlen(cli
->cli_CommandName
, namelen
);
89 CopyMem((APTR
)name
, bs
, namelen
);