Chameleon

Chameleon Svn Source Tree

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

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

Archive Download this file

Revision: HEAD