|
|
BSD 4.3reno
/* $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/others/quipu/uips/xd/sequence.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $ */
#ifndef lint
static char *rcsid = "$Id: sequence.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $";
#endif
/*
$Log: sequence.c,v $
Revision 1.1.1.1 2018/04/24 16:12:56 root
BSD 4.3reno
* Revision 7.0 90/06/12 13:10:52 mrose
* *** empty log message ***
*
* Revision 1.5 90/04/26 10:22:46 emsrssn
* Installation fixed
*
*
* Revision 1.4 90/04/25 17:28:15 emsrssn
* Lint tidy up
*
*
* Revision 1.3 90/04/19 13:54:17 emsrssn
* keyboard accelerator now activates button highlight.
*
* search types available is dependent on current position
* to prevent unreasonable searches.
*
* the help popup changes automatically depending on the
* position of the cursor
*
* buttons remain a fixed size when the application is
* resized
*
* command line options are now handled properly
*
* logging added
*
* "reads" are now sorted to show mail address at top etc.
*
*
* Revision 1.2 90/03/09 15:57:34 emsrssn
* First public distribution
*
*
* Revision 1.1 90/03/08 13:18:41 emsrssn
* Initial revision
*
*
*/
/* This file contains code to implement the list storage facilities
* in the modified widget program (renamed SD 5/1/90).
*/
/* This file was written by Damanjit Mahl @ Brunel University
* on 31st October 1989 as part of the modifications made to
* the Quipu X.500 widget interface written by Paul Sharpe
* at GEC Research, Hirst Research Centre.
*/
/*
* NOTICE
*
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
* this agreement.
*
*/
#include "sequence.h"
add_seq (seq, str)
D_seq *seq;
char *str;
{
D_seq curr;
if (*seq) {
for (curr = *seq; curr->next; curr = curr->next) {}
curr->next = (struct d_seq *) malloc (sizeof (struct d_seq));
curr = curr->next;
curr->strlen = strlen (str);
curr->dname = malloc ((curr->strlen)+5);
(void) strcpy(curr->dname, str);
curr->next = 0;
} else {
curr = (struct d_seq *) malloc (sizeof (struct d_seq));
curr->strlen = strlen (str);
curr->dname = malloc ((curr->strlen)+5);
(void) strcpy(curr->dname, str);
curr->next = 0;
*seq = curr;
}
}
char *
get_from_seq (seq_num, seq_ptr)
int seq_num;
D_seq seq_ptr;
{
for (; seq_num > 1 && seq_ptr; seq_ptr = seq_ptr->next, seq_num--) {}
if (seq_ptr)
return seq_ptr->dname;
else
return 0;
}
free_seq (seq_ptr)
D_seq seq_ptr;
{
D_seq next_seq;
while (seq_ptr) {
free(seq_ptr->dname);
next_seq = seq_ptr->next;
free((char *) seq_ptr);
seq_ptr = next_seq;
}
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.