File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / others / quipu / uips / sd / sequence.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

#ifndef lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/others/quipu/uips/sd/sequence.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $";
#endif

/*
 * $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/others/quipu/uips/sd/sequence.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $
 */

/*
 * $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:14:05  mrose
 * *** empty log message ***
 * 
 * Revision 1.6  90/04/26  10:36:30  emsrdsm
 * *** empty log message ***
 * 
 * Revision 1.5  90/04/25  15:07:42  emsrdsm
 * i) lint'ed
 * 
 * Revision 1.4  90/04/20  17:57:56  emsrdsm
 * i) no more freeing
 * 
 * Revision 1.3  90/04/18  18:28:04  emsrdsm
 * fixed i) does not move to leaves
 *       ii) added default mechanism described using "typeDefaults" file.
 * 	 iii) added 'sorting' to attribute display
 * 
 * Revision 1.2  90/03/15  16:32:08  emsrdsm
 * fixes i) Prints messages correctly on exit.
 *      ii) Added rfc822 to greybook mailbox conversion
 *     iii) Removed bug that caused crash if 'local_dit' undefined
 * 
 * Revision 1.1  90/03/09  17:40:34  emsrdsm
 * Initial revision
 * 
 * Revision 1.1  90/03/09  13:37:16  emsrdsm
 * 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;
	}
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.