summaryrefslogblamecommitdiffstats
path: root/scan_ldapresult.c
blob: 930f458f7adbb790202e3d77774fc37a99a373a1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                             
#include "ldap.h"

size_t scan_ldapresult(const char* src,const char* max,unsigned long* result,
		       struct string* matcheddn,struct string* errormessage,
		       struct string* referral) {
  size_t res,tmp;
  if (!(res=scan_asn1ENUMERATED(src,max,result))) return 0;
  if (!(tmp=scan_ldapstring(src+res,max,matcheddn))) return 0;
  res+=tmp;
  if (!(tmp=scan_ldapstring(src+res,max,errormessage))) return 0;
  res+=tmp;
  if (src+res==max) { referral->l=0; referral->s=0; return res; }
  if (!(tmp=scan_ldapstring(src+res,max,referral))) return 0;
  return res+tmp;
}