/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2002-2012 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> *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* omf archive format method
*/
#include <ardirlib.h>
#include <cdt.h>
#include <omf.h>
#ifndef EILSEQ
#endif
typedef struct _arfile_
{
char *alias;
int flags;
} Arfile_t;
{
void *addr;
int state;
} State_t;
struct Table
{
};
{
char *l= (char*)left;
char *r= (char*)right;
char *suffix;
return(strcmp(l,r));
}
{
if (l < r)
return -1;
if (l > r)
return 1;
return 0;
}
{
};
{
};
{
if(big)
{
return(cp+4);
}
return(cp+2);
}
{
if(*cp&0x80)
{
return(cp+2);
}
return(cp);
}
{
return(0);
if(*buff==OMF_THEADR)
return(buff[3]);
return(0);
}
{
const char *cp;
if(!fp)
{
return(0);
{
}
}
return(fp);
}
/*
* closef
*/
static int
{
{
/* update modification times */
{
{
}
}
}
if (dp)
if(sp)
return 0;
}
{
while(tp)
{
break;
}
return(disp);
}
static void omfload(Ardir_t *ar,unsigned char *base, unsigned char *last, struct Table *tp, int dmars)
{
int *ip;
int len;
if(dmars)
{
/* string table at the top */
while(*cp)
while(cp[4]==0)
cp++;
}
else
{
}
{
if(dmars)
else
break;
return;
if(ip[6])
}
while(tp)
{
}
}
/*
* openf
*/
static int
{
int pagesize;
return -1;
return -1;
goto nope;
return 0;
goto nope;
goto nope;
goto nope;
pagesize = n+3;
{
if(*addr==OMF_LIBDHD)
return(0);
{
if(special)
{
if(base)
special = 0;
}
else
{
return(0);
}
addr +=n;
n = 0;
}
else if(type==OMF_THEADR)
{
{
{
len -=2;
begin +=2;
}
}
else
special = 1;
}
{
int offset;
return(0);
if(!base)
else
{
}
}
}
nope:
return -1;
}
/*
* nextf
*/
static Ardirent_t*
{
else
{
}
return(0);
{
if(last)
last++;
else
}
}
/*
* returns -1 for error
* returns 0 for ignore
* returns ARDIR_CREATE add
* returns ARDIR_REPLACE replace
* returns ARDIR_DELETE delete
*/
{
int m,n,fd;
else
{
{
fname[m] = 0;
ret = ARDIR_CREATE;
}
}
return -1;
if(fp)
{
if(op&ARDIR_DELETE)
{
return ARDIR_DELETE;
}
return 0 ;
ret = ARDIR_REPLACE;
}
else
{
if(op&ARDIR_DELETE)
return -1 ;
return -1 ;
}
if(m)
if(suffix)
return(ret);
}
{
return(FILENAME);
}
/*
* changef
*/
static int
{
return 0;
}
{
"omf",
"omf archive",
};