Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/i386/libsaio/openbsd.c

  • Property svn:executable set to *
1#include "libsaio.h"
2#include "sl.h"
3#include "openbsd.h"
4
5#define OpenBSDProbeSize2048
6
7bool OpenBSDProbe (const void *buf)
8{
9return (OSReadLittleInt32(buf+0x200,0)==0x82564557);
10}
11void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen)
12{
13char * buf=malloc(OpenBSDProbeSize);
14if (!buf)
15return;
16 str[0]=0;
17Seek(ih, 0);
18Read(ih, (long)buf, OpenBSDProbeSize);
19if (!OpenBSDProbe (buf))
20{
21free (buf);
22return;
23}
24if (OSReadLittleInt32 (buf+0x44c,0)<1)
25{
26free (buf);
27return;
28}
29str[strMaxLen]=0;
30strncpy (str, buf+0x478, min (strMaxLen, 32));
31free (buf);
32}

Archive Download this file

Revision: 1984