summaryrefslogtreecommitdiffstats
path: root/scan_asn1ENUMERATED.c
blob: 36347cc7b3c02c9a37a4bb4a303c8280f29a84c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "asn1.h"

size_t scan_asn1ENUMERATED(const char* src,const char* max,unsigned long* val) {
  size_t tmp;
  unsigned long tag;
  enum asn1_tagclass tc;
  enum asn1_tagtype tt;
  long ltmp;
  if ((tmp=scan_asn1int(src,max,&tc,&tt,&tag,&ltmp)))
    if (tc==UNIVERSAL && tt==PRIMITIVE && tag==ENUMERATED) {
      *val=(unsigned long)ltmp;
      return tmp;
    }
  return 0;
}