/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 2000-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* Phong Vo <[email protected]> *18* *19***********************************************************************/20#pragma prototyped2122#include "ivlib.h"2324typedef struct Method_s25{26const char* name;27Ivmeth_t** meth;28} Method_t;2930#define IVMETHOD(m) extern Ivmeth_t* Iv ## m;3132#include "ivmethods.h"3334#define IVMETHOD(m) #m, & Iv ## m,3536static Method_t methods[] =37{38#include "ivmethods.h"39};4041Ivmeth_t*42ivmeth(const char* name)43{44int i;4546if ((name[0] == 'i' || name[0] == 'I') && (name[1] == 'v' || name[1] == 'V'))47name += 2;48for (i = 0; i < elementsof(methods); i++)49if (!strncmp(methods[i].name, name, 4))50return *methods[i].meth;51return 0;52}535455