/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2002-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
/*
* opaque method
*
* Glenn Fowler
* AT&T Research
*/
static const char usage[] =
"[+DESCRIPTION?The \bdss\b opaque method handles anonymous fixed record "
"data. Field names and expressions are not supported.]"
"[n:name?The magic header generic data/application name.]:[name]"
"[s:size?The fixed record size; must be specified.]#[size]"
"[t:type?The magic header specific data type.]:[type]"
"[v:version?The magic header version stamp, either \aYYYYMMDD\a or"
" \a0xWWXXYYZZ\a.]#[version]"
;
#include <dsslib.h>
#include <magicid.h>
struct Opaque_s
{
};
extern Dsslib_t dss_lib_opaque;
/*
* identf
*/
static int
{
return 0;
{
return 0;
return 0;
return 0;
return 0;
return 0;
}
return 1;
}
/*
* opaque fopenf
*/
static int
{
{
return -1;
}
return 0;
}
/*
* opaque fclosef
*/
static int
{
if (!file)
return -1;
return 0;
}
/*
* opaque readf
*/
static int
{
return 1;
(*disc->errorf)(NiL, disc, 2, "%slast record truncated -- record ignored", cxlocation(file->dss->cx, record));
return 0;
}
/*
* opaque writef
*/
static int
{
}
{
"opaque",
"opaque format (2010-05-28)",
CXH,
0,
0,
0,
0
};
/*
* methf
*/
static Dssmeth_t*
opaquemeth(const char* name, const char* options, const char* schema, Dssdisc_t* disc, Dssmeth_t* meth)
{
char* s;
{
return 0;
}
if (options)
{
goto drop;
for (;;)
{
{
case 'n':
continue;
case 's':
continue;
case 't':
continue;
case 'v':
continue;
case '?':
goto drop;
case ':':
goto drop;
}
break;
}
}
{
goto drop;
}
drop:
return 0;
}
{
"opaque",
"opaque fixed record data with optional magic",
CXH,
};
{
"opaque",
"opaque method"
"[-1ls5Pp0?\n@(#)$Id: dss opaque method (AT&T Research) 2002-11-22 $\n]"
CXH,
0,
};