grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / graphics / stripfont.c
blob258faac8f2f6529f6717dfb75c2c09af6b47d73a
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function StripFont()
6 Lang: english
7 */
8 #include <proto/graphics.h>
9 #include <proto/exec.h>
10 #include <proto/utility.h>
11 #include <proto/oop.h>
12 #include "graphics_intern.h"
14 /*****************************************************************************
16 NAME */
17 #include <clib/graphics_protos.h>
19 AROS_LH1(void, StripFont,
21 /* SYNOPSIS */
22 AROS_LHA(struct TextFont *, font, A0),
24 /* LOCATION */
25 struct GfxBase *, GfxBase, 137, Graphics)
27 /* FUNCTION
28 Removes a TextFontExtension from a font.
30 INPUTS
31 font - font to remove extension from.
33 RESULT
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
42 ExtendFont()
44 INTERNALS
46 HISTORY
47 27-11-96 digulla automatically created from
48 graphics_lib.fd and clib/graphics_protos.h
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
54 struct TextFontExtension *tfe;
55 struct tfe_hashnode *hn;
57 /* Valid parameter ? */
58 if (font == NULL)
59 return;
61 /* Does the font have an extension ? */
63 ObtainSemaphore(&PrivGBase(GfxBase)->fontsem);
65 hn = tfe_hashlookup(font, GfxBase);
66 if (NULL != hn)
68 tfe = hn->ext;
70 if (hn->chunky_colorfont) FreeVec(hn->chunky_colorfont);
72 /* Remove the hashitem (tfe_hashdelete() has semaphore protection) */
73 tfe_hashdelete(font, GfxBase);
75 if (NULL != tfe)
77 font->tf_Extension = tfe->tfe_OrigReplyPort;
79 /* Font is not tagged anymore */
80 font->tf_Style &= ~FSF_TAGGED;
82 FreeTagItems(tfe->tfe_Tags);
83 FreeMem(tfe, sizeof (struct TextFontExtension_intern));
88 ReleaseSemaphore(&PrivGBase(GfxBase)->fontsem);
90 return;
92 AROS_LIBFUNC_EXIT
93 } /* StripFont */