2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Close a message catalog.
8 #include <exec/types.h>
9 #include <proto/exec.h>
10 #include "locale_intern.h"
12 #define DEBUG_CLOSECATALOG(x) ;
14 /*****************************************************************************
17 #include <proto/locale.h>
19 AROS_LH1(void, CloseCatalog
,
22 AROS_LHA(struct Catalog
*, catalog
, A0
),
25 struct LocaleBase
*, LocaleBase
, 6, Locale
)
28 Conclude access to a message catalog, and decrement the use count.
29 If this use count is 0, the catalog can be expunged when the
30 system memory is running low.
33 catalog - the message catalog to close, note that NULL is
37 The catalog is closed, and should no longer be used by the
47 GetCatalogStr(), OpenCatalogA()
51 *****************************************************************************/
55 DEBUG_CLOSECATALOG(dprintf("CloseCatalog: catalog 0x%lx\n",
60 ObtainSemaphore(&IntLB(LocaleBase
)->lb_CatalogLock
);
62 /* Decrement the use counter. */
63 IntCat(catalog
)->ic_UseCount
--;
65 if (0 == IntCat(catalog
)->ic_UseCount
)
67 Remove(&catalog
->cat_Link
);
69 dispose_catalog((struct IntCatalog
*)catalog
, LocaleBase
);
73 ReleaseSemaphore(&IntLB(LocaleBase
)->lb_CatalogLock
);
77 DEBUG_CLOSECATALOG(dprintf("CloseCatalog: done\n"));