2 Copyright © 1995-2007, 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 OpenCatalog(), CloseCatalog()
58 27-11-96 digulla automatically created from
59 locale_lib.fd and clib/locale_protos.h
61 *****************************************************************************/
65 CONST_STRPTR str
= defaultString
;
69 struct CatStr
*cs
= IntCat(catalog
)->ic_CatStrings
;
70 ULONG numstrings
= IntCat(catalog
)->ic_NumStrings
;
73 for(i
= 0; i
< numstrings
; i
++, cs
++)
75 if(cs
->cs_Id
== stringNum
)
82 if((IntCat(catalog
)->ic_Flags
& ICF_INORDER
) &&
83 (cs
->cs_Id
> stringNum
))