core/vgui/vgui_tag.cxx
Go to the documentation of this file.
00001 // This is core/vgui/vgui_tag.cxx
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005 //:
00006 // \file
00007 // \author fsm
00008 // \brief  See vgui_tag.h for a description of this file.
00009 
00010 #include "vgui_tag.h"
00011 #include <vcl_cassert.h>
00012 
00013 #define MAXTAGS 255
00014 
00015 // POD
00016 static unsigned numtags = 0;
00017 static vgui_tag_function tags[MAXTAGS+1];
00018 
00019 int vgui_tag_add(vgui_tag_function f, char const * /*tk*/) {
00020   if (f) {
00021     assert(numtags < MAXTAGS);
00022     tags[numtags++] = f;
00023   }
00024   return numtags;
00025 }
00026 
00027 vgui_tag_function const *vgui_tag_list() {
00028   tags[numtags] = 0;
00029   return tags;
00030 }
00031 
00032 void vgui_tag_call() {
00033   for (unsigned i=0; i<numtags; ++i)
00034     (*tags[i])();
00035   numtags = 0;
00036 }