old-cross-binutils/gprof/search_list.c
Ken Raeburn 03c35bcb6e * __bb_exit_func.c: New file, from David Mosberger-Tang.
Thu Feb  9 16:56:07 1995  David Mosberger-Tang  <davidm@piston.cs.arizona.edu>

* All *.c: More cleanup towards GNU format.

* gmon_out.h (struct gmon_hist_hdr, struct gmon_cg_arc_record): replaced sizeof
(bfd_vma) by size (char*) because Ken tells me that bfd_vma is only guaranteed
to be at least as big as a pointer.

(GMON_Record_tag): added explicit enumeration values to ensure compatibility
across compilers.

* gmon_io.c (get_vma, put_vma): replaced sizeof(bfd_vma) by sizeof(char*).
1995-03-14 02:58:16 +00:00

44 lines
768 B
C

#include "libiberty.h"
#include "gprof.h"
#include "search_list.h"
void
DEFUN (search_list_append, (list, paths),
Search_List * list AND const char *paths)
{
Search_List_Elem *new_el;
const char *beg, *colon;
int len;
colon = paths - 1;
do
{
beg = colon + 1;
colon = strchr (beg, ':');
if (colon)
{
len = colon - beg;
}
else
{
len = strlen (beg);
}
new_el = (Search_List_Elem *) xmalloc (sizeof (*new_el) + len);
memcpy (new_el->path, beg, len);
new_el->path[len] = '\0';
/* append new path at end of list: */
new_el->next = 0;
if (list->tail)
{
list->tail->next = new_el;
}
else
{
list->head = new_el;
}
list->tail = new_el;
}
while (colon);
}