2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Get the current prompt.
8 #include <proto/exec.h>
10 #include "dos_intern.h"
13 /*****************************************************************************
16 #include <proto/dos.h>
18 AROS_LH2(BOOL
, GetPrompt
,
21 AROS_LHA(STRPTR
, buf
, D1
),
22 AROS_LHA(LONG
, len
, D2
),
25 struct DosLibrary
*, DOSBase
, 98, Dos
)
28 Copies the prompt from the CLI structure into the buffer. If the
29 buffer is too small the name is truncated, and a failure is returned.
30 If the current process doesn't have a CLI structure, a 0 length string
31 is put into the buffer and a failure is returned.
34 buf - Buffer for the prompt.
35 len - Size of the buffer in bytes.
38 !=0 on success, 0 on failure. IoErr() gives additional information
52 *****************************************************************************/
55 AROS_LIBBASE_EXT_DECL(struct DosLibrary
*,DOSBase
)
57 struct Process
*me
= (struct Process
*)FindTask(NULL
);
58 struct CommandLineInterface
*cli
= BADDR(me
->pr_CLI
);
67 me
->pr_Result2
= ERROR_OBJECT_WRONG_TYPE
;
71 cname
= AROS_BSTR_ADDR(cli
->cli_Prompt
);
72 clen
= (ULONG
)AROS_BSTR_strlen(cli
->cli_Prompt
);
76 me
->pr_Result2
= ERROR_LINE_TOO_LONG
;
79 CopyMem(cname
, buf
, clen
);