/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1987-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* pax tnef format
*/
#include "format.h"
#include <tm.h>
typedef struct Tnef_s
{
char* format;
} Tnef_t;
static int
tnef_getprologue(Pax_t* pax, Format_t* fp, register Archive_t* ap, File_t* f, unsigned char* buf, size_t size)
{
if (size < 6)
return 0;
magic = TNEF_MAGIC;
return 0;
nospace();
return 1;
}
static int
{
char* s;
char* e;
unsigned char* x;
size_t n;
size_t m;
size_t z;
unsigned int level;
unsigned int type;
unsigned int name;
unsigned int checksum;
{
type = n >> 16;
n = 0;
{
if (level == 2)
{
level = 0;
if (name == 0x800f)
{
}
else
}
{
error(3, "%s: %s format 0x%04x attribute data truncated -- %d expected", ap->name, ap->format->name, name, part);
x = (unsigned char*)s;
e = s + part;
while (x < (unsigned char*)e)
n += *x++;
}
}
error(3, "%s: %s format 0x%04x attribute data truncated -- %d expected", ap->name, ap->format->name, name, size);
x = (unsigned char*)s;
e = s + size;
while (x < (unsigned char*)e)
n += *x++;
n &= ((1<<16)-1);
if (checksum != n)
if (level == 2)
switch (name)
{
case 0x800f: /* data */
break;
case 0x8010: /* title */
if (!f->name)
break;
case 0x8013: /* date */
{
}
break;
case 0x9005: /* attachment */
if (size >= 4)
{
e = s + size - 4;
while (n-- && s < e)
{
switch (type)
{
case 0x0002:
case 0x000b:
s += 2;
break;
case 0x0003:
case 0x0004:
case 0x0007:
case 0x000a:
case 0x000d:
case 0x0048:
s += 4;
break;
case 0x0005:
case 0x0006:
case 0x0014:
case 0x0040:
s += 8;
break;
case 0x001e:
case 0x001f:
case 0x0102:
while (m--)
{
z = roundof(z, 4);
if (name == 0x3707)
s += z;
}
break;
}
}
}
if (!*f->name)
{
s++;
else
e = s + strlen(s);
}
return 1;
}
}
return 0;
}
static int
{
{
}
return 0;
}
static int
{
return 1;
}
{
"tnef",
0,
"MS outlook transport neutral encapsulation format",
0,
0,
0,
0,
};