2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Get the current prompt.
8 #include <aros/debug.h>
10 #include <proto/exec.h>
12 #include "dos_intern.h"
15 /*****************************************************************************
18 #include <proto/dos.h>
20 AROS_LH2(BOOL
, GetPrompt
,
23 AROS_LHA(STRPTR
, buf
, D1
),
24 AROS_LHA(LONG
, len
, D2
),
27 struct DosLibrary
*, DOSBase
, 98, Dos
)
30 Copies the prompt from the CLI structure into the buffer. If the
31 buffer is too small the name is truncated, and a failure is returned.
32 If the current process doesn't have a CLI structure, a 0 length string
33 is put into the buffer and a failure is returned.
36 buf - Buffer for the prompt.
37 len - Size of the buffer in bytes.
40 !=0 on success, 0 on failure. IoErr() gives additional information
54 *****************************************************************************/
58 struct Process
*me
= (struct Process
*)FindTask(NULL
);
59 struct CommandLineInterface
*cli
= BADDR(me
->pr_CLI
);
64 ASSERT_VALID_PROCESS(me
);
70 me
->pr_Result2
= ERROR_OBJECT_WRONG_TYPE
;
74 cname
= AROS_BSTR_ADDR(cli
->cli_Prompt
);
75 clen
= (ULONG
)AROS_BSTR_strlen(cli
->cli_Prompt
);
79 me
->pr_Result2
= ERROR_LINE_TOO_LONG
;
82 CopyMem(cname
, buf
, clen
);