This is plstyl.c in view mode; [Download] [Up]
/* Set up a new line style of "nels" elements, with mark and space */
/* lengths given by arrays "mk" and "sp". */
#include "plplot.h"
void plstyl(nels,mk,sp)
int nels, *mk, *sp;
{
short int i;
int level;
glev(&level);
if (level < 1) plexit("Please call plstar before calling plstyl.");
if ((nels < 0) || (nels > 10)) {
plexit("Broken lines cannot have <0 or >10 elements");
}
for (i=0; i<nels; i++) {
if ((mk[i] < 0) || (sp[i] < 0))
plexit("Mark and space lengths must be > 0 in plstyl.");
}
smark(mk,sp,nels);
scure(0,1,0,nels>0 ? mk[0] : 0);
}
/* Updates line style variables, called whenever alarm goes off */
void plupd(nms,mark,space,curel,pendn,timecnt,alarm)
int nms, *mark, *space, *curel, *pendn, *timecnt, *alarm;
{
while ( *timecnt >= *alarm ) {
if (*pendn != 0) {
*pendn = 0;
*timecnt -= *alarm;
*alarm = space[*curel];
}
else {
*pendn = 1;
*timecnt -= *alarm;
(*curel)++;
if (*curel >= nms) *curel = 0;
*alarm = mark[*curel];
}
}
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.