signal.c revision 3e14f97f673e8a630f076077de35afdd43dc1587
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
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin * AT&T Research
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * generate signal features
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define elementsof(x) (sizeof(x)/sizeof(x[0]))
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinextern char* strsignal(int);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int i;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int j;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int k;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin if ((j = map[i].value) > 0 && j < elementsof(mapindex) && !mapindex[j])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin if (i <= j && i > 0 && i < elementsof(mapindex) && j > 0 && j < elementsof(mapindex))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while (++i < j)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for (i = 0; i <= k; i++)
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin if (!(j = mapindex[i]))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin else if (j & RANGE_RT)
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin else if (j & RANGE_MAX)
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin if (m > n / 2)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for (i = 0; i <= k; i++)
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin if (!(j = mapindex[i]))
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin else if (j & RANGE_RT)
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin printf(" \"Realtime priority %d%s\",\n", j & RANGE_SIG, (j & RANGE_MIN) ? " (lo)" : (j & RANGE_MAX) ? " (hi)" : "");
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin else if (s = strsignal(i))