2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
9 #include <exec/types.h>
10 #include <proto/exec.h>
11 #include "locale_intern.h"
13 /*****************************************************************************
16 #include <proto/locale.h>
18 AROS_LH3(CONST_STRPTR
, GetCatalogStr
,
21 AROS_LHA(const struct Catalog
*, catalog
, A0
),
22 AROS_LHA(ULONG
, stringNum
, D0
), /* Not a typo! Needs to be unsigned for ICF_INORDER */
23 AROS_LHA(CONST_STRPTR
, defaultString
, A1
),
26 struct LocaleBase
*, LocaleBase
, 12, Locale
)
29 This function will return the string specified by the
30 stringNum from the given message catalog, or the defaultString
31 if the string could not be found.
33 If the catalog == NULL, then the defaultString will also be
37 catalog - Message catalog to search. May be NULL.
38 stringNum - ID of the string to find.
39 defaultString - String to return in case catalog is NULL or
40 string could not be found.
43 A pointer to a READ ONLY NULL terminated string. This string
44 pointer is valid as long as the catalog remains open.
53 OpenCatalogA(), CloseCatalog()
57 *****************************************************************************/
61 CONST_STRPTR str
= defaultString
;
65 struct CatStr
*cs
= IntCat(catalog
)->ic_CatStrings
;
66 ULONG numstrings
= IntCat(catalog
)->ic_NumStrings
;
69 for (i
= 0; i
< numstrings
; i
++, cs
++)
71 if (cs
->cs_Id
== stringNum
)
79 if ((IntCat(catalog
)->ic_Flags
& ICF_INORDER
) &&
80 (cs
->cs_Id
> stringNum
))