fix function to take the hook param
[AROS.git] / workbench / libs / datatypes / getdtstring.c
blob6583486f790893db85649bf7d29d07563a3de9e4
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 #include "datatypes_intern.h"
10 #include <proto/locale.h>
13 struct StringDef
15 ULONG sd_StringID;
16 UBYTE *sd_String;
19 struct StringDef __dtStrings[]=
21 { DTERROR_UNKNOWN_DATATYPE, "Unknown data type for %s" },
22 { DTERROR_COULDNT_SAVE, "Couldn't save %s" },
23 { DTERROR_COULDNT_OPEN, "Couldn't open %s" },
24 { DTERROR_COULDNT_SEND_MESSAGE, "Couldn't send message" },
25 { DTERROR_COULDNT_OPEN_CLIPBOARD, "Couldn't open clipboard" },
26 { DTERROR_Reserved, "Unknown data type" },
27 { DTERROR_UNKNOWN_COMPRESSION, "Unknown compression type" },
28 { DTERROR_NOT_ENOUGH_DATA, "Not enough data" },
29 { DTERROR_INVALID_DATA, "Invalid data" },
30 { DTMSG_TYPE_OFFSET + DTF_BINARY, "Binary" },
31 { DTMSG_TYPE_OFFSET + DTF_ASCII, "ASCII" },
32 { DTMSG_TYPE_OFFSET + DTF_IFF, "IFF" },
33 { DTMSG_TYPE_OFFSET + DTF_MISC, "Miscellaneous" },
34 { GID_SYSTEM, "System" },
35 { GID_TEXT, "Text" },
36 { GID_DOCUMENT, "Document" },
37 { GID_SOUND, "Sound" },
38 { GID_INSTRUMENT, "Instrument" },
39 { GID_MUSIC, "Music" },
40 { GID_PICTURE, "Picture" },
41 { GID_ANIMATION, "Animation" },
42 { GID_MOVIE, "Movie" },
43 { 0, NULL }
47 /*****************************************************************************
49 NAME */
50 #include <proto/datatypes.h>
52 AROS_LH1(CONST_STRPTR, GetDTString,
54 /* SYNOPSIS */
55 AROS_LHA(ULONG, id, D0),
57 /* LOCATION */
58 struct Library *, DataTypesBase, 23, DataTypes)
60 /* FUNCTION
62 Get a pointer to a localized datatypes string.
64 INPUTS
66 id -- ID of the string to get
68 RESULT
70 Pointer to a NULL terminated string.
72 NOTES
74 EXAMPLE
76 BUGS
78 SEE ALSO
80 INTERNALS
82 HISTORY
84 *****************************************************************************/
86 AROS_LIBFUNC_INIT
88 CONST_STRPTR str = NULL;
89 struct StringDef *sd;
91 if((LocaleBase != NULL) &&
92 (GPB(DataTypesBase)->dtb_LibsCatalog != NULL))
93 str = GetCatalogStr(GPB(DataTypesBase)->dtb_LibsCatalog, id, NULL);
95 if(str == NULL)
97 for(sd = __dtStrings; sd->sd_String; sd++)
99 if (sd->sd_StringID == id)
101 str = sd->sd_String;
102 break;
107 return str;
109 AROS_LIBFUNC_EXIT
110 } /* GetDTString */