/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1998-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
/*
* Glenn Fowler
* AT&T Research
*
* convert delimited/terminated flat file from
* row major to col major order
*/
#include <ast.h>
#include <ctype.h>
#include <error.h>
#include <ls.h>
#include <sfdcgzip.h>
typedef struct Col_s
{
} Col_t;
static struct State_s
{
int delimiter;
int level;
int quote;
int terminator;
int test;
int verbose;
} state;
/*
* flush output to op
*/
static int
{
register size_t n;
{
do
{
{
return -1;
}
}
return 0;
}
/*
* convert one file from ip to op
*/
static int
{
register char* s;
register char* e;
register int d;
register int q;
register int t;
register size_t w;
register size_t n;
register size_t m;
char* b;
t = state.terminator;
{
if (w < n)
{
{
return -1;
}
return -1;
}
w -= n;
for (;;)
{
if (!col)
{
}
if (q && *s == q)
{
b = s;
e = s + n;
while (++b < e)
if (*b == q)
{
b++;
break;
}
m = b - s;
}
else if (e = memchr(s, d, n))
m = e - s + 1;
else
m = n;
{
return -1;
}
if (!e)
break;
s += m;
n -= m;
}
}
{
return -1;
}
return 0;
}
{
char* file;
for (;;)
{
switch (optget(argv, "d:[delimiter]l#[compression-level]q:[quote]t:[terminator]vw#[window-size]T#[test-mask]"))
{
case 'd':
continue;
case 'l':
continue;
case 'q':
continue;
case 't':
continue;
case 'v':
continue;
case 'w':
continue;
case 'T':
continue;
case '?':
continue;
case ':':
continue;
}
break;
}
if (error_info.errors)
if (!*argv)
else
{
{
}
{
continue;
}
}
return error_info.errors != 0;
}