Skip to content
Snippets Groups Projects
Commit 3261f802 authored by rswindell's avatar rswindell
Browse files

Added smb_getfirstidx() API function.

parent 4e6c5ac8
No related branches found
No related tags found
No related merge requests found
......@@ -534,6 +534,20 @@ int SMBCALL smb_getmsgidx(smb_t* smb, smbmsg_t* msg)
return(0);
}
/****************************************************************************/
/* Reads the first index record in the open message base */
/****************************************************************************/
int SMBCALL smb_getfirstidx(smb_t* smb, idxrec_t *idx)
{
clearerr(smb->sid_fp);
fseek(smb->sid_fp,0,SEEK_SET);
if(!fread(idx,sizeof(idxrec_t),1,smb->sid_fp)) {
sprintf(smb->last_error,"reading index");
return(-2);
}
return(0);
}
/****************************************************************************/
/* Reads the last index record in the open message base */
/****************************************************************************/
......
......@@ -104,6 +104,7 @@ SMBEXPORT int SMBCALL smb_getstatus(smb_t* smb);
SMBEXPORT int SMBCALL smb_putstatus(smb_t* smb);
SMBEXPORT int SMBCALL smb_unlocksmbhdr(smb_t* smb);
SMBEXPORT int SMBCALL smb_getmsgidx(smb_t* smb, smbmsg_t* msg);
SMBEXPORT int SMBCALL smb_getfirstidx(smb_t* smb, idxrec_t *idx);
SMBEXPORT int SMBCALL smb_getlastidx(smb_t* smb, idxrec_t *idx);
SMBEXPORT uint SMBCALL smb_getmsghdrlen(smbmsg_t* msg);
SMBEXPORT ulong SMBCALL smb_getmsgdatlen(smbmsg_t* msg);
......@@ -171,6 +172,7 @@ SMBEXPORT void SMBCALL smb_clearerr(FILE* fp);
#pragma aux smb_putstatus "_*"
#pragma aux smb_unlocksmbhdr "_*"
#pragma aux smb_getmsgidx "_*"
#pragma aux smb_getfirstidx "_*"
#pragma aux smb_getlastidx "_*"
#pragma aux smb_getmsghdrlen "_*"
#pragma aux smb_getmsgdatlen "_*"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment