/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>
#include <string.h>

#define START int getfid(const char *fnam) {
#define F(s,v) if(strcmp(fnam,#s)==0) return v;
#define END return -1; }
#define fid getfid(__FUNCTION__)

START
F(main,0)
END

int main()
{
    printf("%s\n", __FUNCTION__);
    printf("%d\n", fid);
    return 0;
}
