da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/***********************************************************************
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* This software is part of the ast package *
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner* Copyright (c) 1985-2010 AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* and is licensed under the *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Common Public License, Version 1.0 *
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin* by AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* A copy of the License is available at *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Information and Software Systems Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* AT&T Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Florham Park NJ *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Glenn Fowler <gsf@research.att.com> *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* David Korn <dgk@research.att.com> *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Phong Vo <kpv@research.att.com> *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin***********************************************************************/
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Glenn Fowler
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * AT&T Research
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * generate a license comment -- see proto(1)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * NOTE: coded for minimal library dependence
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * not so for the legal department
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define PUT(b,c) (((b)->nxt<(b)->end)?(*(b)->nxt++=(c)):((c),(-1)))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define USE(b) ((b)->siz=(b)->nxt-(b)->buf,(b)->nxt=(b)->buf,(b)->siz)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define END(b) (*((b)->nxt>=(b)->end?((b)->nxt=(b)->end-1):(b)->nxt)=0,(b)->nxt-(b)->buf)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * NOTE: key[] element order must match the corresponding macro
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * return index given <name,size>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinlookup(register const Item_t* item, const char* name, int size)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int c;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int i;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (c == item[i].data[0] && size == item[i].size && !strncmp(name, item[i].data, size))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return -1;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * copy s of size n to b
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * n<0 means 0 terminated string
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinstatic void
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (n < 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (n--)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * center and copy comment line s to p
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * if s==0 then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * n>0 first frame line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * n=0 blank line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * n<0 last frame line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * if u>0 then s converted to upper case
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * if u<0 then s is left justified
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinstatic void
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincomment(Notice_t* notice, register Buffer_t* b, register char* s, register int n, int u)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int i;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int m;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int x;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for (i = 0; i < COMDATA; i++)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if ((x = COMDATA - m - n) < 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (m-- > 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (n-- > 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (x-- > 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * expand simple ${...}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinstatic void
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexpand(Notice_t* notice, register Buffer_t* b, const Item_t* item)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register char* t;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register char* e;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int q;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register char* x;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register char* z;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int c;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (t < e)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin x = t += 2;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (t < e && (c = *t++) != '}')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (c == '.')
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner else if (c == '/')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if ((c = lookup(key, x, t - x - 1)) >= 0 && (x = notice->item[c].data))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (x < z)
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner while (t < e && *t++ != '}');
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin else if (q > 0 && *t == '\\' && (*(t + 1) == q || *(t + 1) == '\\'))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * generate a copright notice
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinstatic void
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register char* x;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register char* t;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if ((x = notice->item[SINCE].data) && strncmp(x, t, 4))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * read the license file and generate a comment in p, length size
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * license length in p returned, -1 on error
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * -1 return places 0 terminated error string in p
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinastlicense(char* p, int size, char* file, char* options, int cc1, int cc2, int cc3)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register char* s;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register char* v;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register char* x;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int c;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin tmp.end = (tmp.buf = tmp.nxt = tmpbuf) + sizeof(tmpbuf);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return -1;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (n < 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return -1;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for (i = 0; i < ITEMS; i++)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin notice.item[STYLE] = notice.item[CLASS] = lic[notice.type];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin notice.item[STYLE].quote = notice.item[CLASS].quote = 0;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin contributor = i = k = 0;
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainz while (c = *s)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (c == ' ' || c == '\t' || c == '\n' && ++line || c == '\r' || c == ',' || c == ';' || c == ')')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (c == '#')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (*++s && *s != '\n');
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (c == '\n')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (c == '[')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (c && c != '=' && c != ']' && c != ')' && c != ',' && c != ' ' && c != '\t' && c != '\n' && c != '\r')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin n = s - x;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (c == ']')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (c == '=')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (c == '(')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin else if (h == CONTRIBUTOR)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin switch (*s++)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (!i && !--q)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case '\'':
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin i = *(s - 1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin else if (i == *(s - 1))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case '\\':
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (*s == i && i == '"')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case '\n':
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while ((c = *s) && (q == '"' && (c == '\\' && (*(s + 1) == '"' || *(s + 1) == '\\') && s++ && (quote = q)) || q && c != q || !q && c != ' ' && c != '\t' && c != '\n' && c != '\r' && c != ',' && c != ';'))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (c == '\n')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (c == '\n')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (n == notice.id[i].name.size && !strncmp(x, notice.id[i].name.data, n))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin else if (h == QUERY)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if ((s - v) == 3 && v[0] == 'a' && v[1] == 'l' && v[2] == 'l')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for (i = 0; i < ITEMS; i++)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for (h = 0;; h++)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin else if (notice.item[i].data[h] == ' ' || notice.item[i].data[h] == '\t')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin /*FALLTHROUGH*/
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (h >= 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin notice.item[h].data = (notice.item[h].size = s - v) ? v : (char*)0;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do *--x = ("0123456789")[line % 10]; while (line /= 10);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return -1;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (notice.type == INLINE && (!notice.verbose || !notice.item[NOTICE].data))
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner if (notice.type == CPL || notice.type == EPL)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin copy(&tmp, notice.item[PACKAGE].data ? "and" : "This software", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (notice.item[CORPORATION].data || notice.item[COMPANY].data)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "A copy of the License is available at", 0);
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner COMMENT(¬ice, &buf, "http://www.eclipse.org/org/documents/epl-v10.html", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "http://www.opensource.org/licenses/cpl", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin copy(&tmp, notice.item[PACKAGE].data ? "and it" : "This software", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin copy(&tmp, " may only be used by you under license from", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "A copy of the Source Code Agreement is available", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (i >= 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "If you have copied or used this software without agreeing", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "to the terms of the license you are infringing on", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "the license and copyright and are violating", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (i >= 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "This is free software; you can redistribute it and/or", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "modify it under the terms of the GNU General Public License", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "as published by the Free Software Foundation;", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "either version 2, or (at your option) any later version.", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "This software is distributed in the hope that it", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "will be useful, but WITHOUT ANY WARRANTY;", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "without even the implied warranty of MERCHANTABILITY", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "or FITNESS FOR A PARTICULAR PURPOSE.", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "See the GNU General Public License for more details.", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "You should have received a copy of the", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "GNU General Public License", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "along with this software (see the file COPYING.)", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "If not, a copy is available at", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "http://www.gnu.org/copyleft/gpl.html", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "Redistribution and use in source and binary forms, with or", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "without modification, are permitted provided that the following", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " 1. Redistributions of source code must retain the above", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " copyright notice, this list of conditions and the", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " 2. Redistributions in binary form must reproduce the above", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " copyright notice, this list of conditions and the", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " following disclaimer in the documentation and/or other", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " materials provided with the distribution.", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (notice.item[i = PARENT].data || notice.item[i = CORPORATION].data || notice.item[i = COMPANY].data)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " names of its contributors may be used to endorse or", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " promote products derived from this software without", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " specific prior written permission.", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "POSSIBILITY OF SUCH DAMAGE.", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "This software is provided 'as-is', without any express or implied", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "warranty. In no event will the authors be held liable for any", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "damages arising from the use of this software.", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "Permission is granted to anyone to use this software for any", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "purpose, including commercial applications, and to alter it and", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "redistribute it freely, subject to the following restrictions:", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " 1. The origin of this software must not be misrepresented;", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " you must not claim that you wrote the original software. If", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " you use this software in a product, an acknowledgment in the", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " product documentation would be appreciated but is not", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " 2. Altered source versions must be plainly marked as such,", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " and must not be misrepresented as being the original", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, " 3. This notice may not be removed or altered from any source", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "Permission is hereby granted, free of charge, to any person", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "obtaining a copy of this software and associated", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "documentation files (the \"Software\"), to deal in the", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "Software without restriction, including without limitation", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "the rights to use, copy, modify, merge, publish, distribute,", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "sublicense, and/or sell copies of the Software, and to", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "permit persons to whom the Software is furnished to do so,", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "subject to the following conditions:", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "The above copyright notice and this permission notice shall", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "be included in all copies or substantial portions of the", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (notice.item[i = PARENT].data || notice.item[i = CORPORATION].data || notice.item[i = COMPANY].data)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (i >= 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin copy(&tmp, "This is unpublished proprietary source code", -1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (i >= 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (notice.item[i = PARENT].data || notice.item[i = CORPORATION].data)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "and is not to be disclosed or used except in", 1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "accordance with applicable agreements", 1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "For nonexclusive individual use", 1);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (notice.type >= PROPRIETARY && !notice.item[URL].data)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "Unpublished & Not for Publication", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (notice.item[CORPORATION].data || notice.item[COMPANY].data)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if ((notice.item[PARENT].size + (notice.item[CORPORATION].data ? (notice.item[CORPORATION].size + notice.item[INCORPORATION].size) : notice.item[COMPANY].size)) >= (COMLONG - 6))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "under the terms and conditions of the license in", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "The copyright notice above does not evidence any", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin COMMENT(¬ice, &buf, "actual or intended publication of such source code", 0);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (*v == '\n')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin } while (v++ < x);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (notice.item[i = PARENT].data || notice.item[i = CORPORATION].data)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (v < x && (*v == ' ' || *v == '\t' || *v == '\r' || *v == '\n' || *v == ',' || *v == '+'))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (v >= x)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (v < x && *v != ',' && *v != '+' && *v++ != '>');
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (q || item.size == notice.id[i].name.size && !strncmp(item.data, notice.id[i].name.data, item.size))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (k < 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (k < 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (k > 0)