/*************************************************************************\ * Copyright (c) 2002 The University of Chicago, as Operator of Argonne * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. * This file is distributed subject to a Software License Agreement found * in the file LICENSE that is included with this distribution. \*************************************************************************/ /* $Log: headers.c,v $ Revision 1.3 2002/08/14 16:06:09 soliday Added Open License Revision 1.2 1995/09/05 21:17:37 saunders First test release of the SDDS1.5 package. */ /* routine: add_to_headers() * purpose: add columns to strings that will be suitable for * table headings * * Michael Borland, 1989 */ #include "mdb.h" void add_to_headers( char **header, /* array of header strings */ long n_headers, char **item, /* array of items to use for new column */ long min_width, /* minimum acceptable width of new column */ long format /* index of item that is a C format specifier */ ) { long max_strlen; long i, j, len, excess, width; char *ptr; max_strlen = min_width; for (i=0; imax_strlen) max_strlen = width; } else if ((len=strlen(item[i]))>max_strlen) max_strlen = len; } for (i=0; i