grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / dos / dosgetstring.c
blob1a2dbc9322cc36fe4a9ede4030dbfc88312a3e17
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: DosGetString() - Support for localized strings.
6 Lang: english
7 */
9 #include "dos_intern.h"
11 /*****i***********************************************************************
13 NAME */
14 #include <proto/dos.h>
16 AROS_LH1(STRPTR, DosGetString,
18 /* SYNOPSIS */
19 AROS_LHA(LONG, stringNum, D1),
21 /* LOCATION */
22 struct DosLibrary *, DOSBase, 163, Dos)
24 /* FUNCTION
25 Internal DOS function, will return the string corresponding to
26 the number stringNum.
28 INPUTS
29 stringNum - The number of the string you want.
31 RESULT
32 A pointer to a string, or NULL if no string could be found with
33 a matching number.
35 NOTES
36 Error strings will ALWAYS be less than 80 characters, and should
37 ideally be less than 60 characters.
39 This is a private function, whose the only purpose is to be patched
40 by locale.library.
42 EXAMPLE
44 BUGS
46 SEE ALSO
48 INTERNALS
49 This is dosPrivate5()
51 ******************************************************************************/
53 AROS_LIBFUNC_INIT
55 LONG *p = DOSBase->dl_Errors->estr_Nums;
56 UBYTE *q = DOSBase->dl_Errors->estr_Strings;
60 LONG n = p[0];
61 LONG m = p[1];
63 while (n <= m)
65 if (n == stringNum)
66 return q + 1;
68 q += q[0] + 1;
69 ++n;
72 p += 2;
74 while (p[0] != 0);
76 return "undefined error";
78 AROS_LIBFUNC_EXIT
80 } /* DosGetString */