#include "asf_guids.h"
#include <string.h> // memcmp

static const GUID asf_guids[] =
{
    /* 1: header */
    {0x75B22630, 0x668E, 0x11CF, {0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C}},

    /* 2: data chunk */
    {0x75b22636, 0x668E, 0x11CF, {0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C}},

    /* 3: index */
    {0x33000890, 0xe5b1, 0x11CF, {0x89, 0xF4, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xCB}},

    /* 4: stream header */
    {0xB7DC0791, 0xA9B7, 0x11CF, {0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65}},

    /* 5: ASF 2.0 header */
    {0xD6E229D1, 0x35DA, 0x11D1, {0x90, 0x34, 0x00, 0xa0, 0xC9, 0x03, 0x49, 0xBE}},

    /* 6: file header */
    {0x8CABDCA1, 0xA947, 0x11CF, {0x8E, 0xE4, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65}}
};
/*
char* names[]=
{
    "", "header", "data chunk", "index",
    "stream header", "ASF 2.0 header", "file header"
};
*/

asf_chunk_t LookupChunkType(const GUID& u)
{
    for (unsigned i=0; i < sizeof(asf_guids)/sizeof(asf_guids[0]); i++)
	if (asf_guids[i] == u)
	    return (asf_chunk_t) (i+1);
    return ASF_CHUNK_ERROR;
}
