/**
  Common utilities for MPU Libraries

  @author Jeff Schoen
  @version $Id: MPULibNative.h,v 1.1 2011/04/27 13:09:47 jgs Exp $
*/

#include "cdefs.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>

#define keyMatch(A) keyCheck(A,key)

int_4 keyCheck (char *keyinp, char *keycfg) {
  int ki = (keyinp[1]==':')? 2:0;
  int kc = (keycfg[1]==':')? 2:0;
  if (strcmp(keyinp+ki,keycfg+kc)!=0) return 0;
  if (ki==0 || kc==0 || keyinp[0]==keycfg[0]) return 1;
  printf("Type=%c does not match Key=%s\n",keyinp[0],keycfg);
  return 0;
}

