Lines Matching refs:node

90   GlhHashBucket *bucket; /* The parent hash-table bucket of this node */
179 GlhLineNode *id_node;/* The node at which the last ID search terminated */
193 unsigned long seq; /* The next ID to assign to a line node */
208 static void _glh_discard_line(GlHistory *glh, GlhLineNode *node);
408 GlhHashNode *hnode; /* The hash-table node of the line */
409 GlhLineNode *lnode; /* A node in the time-ordered list of lines */
469 * then return a reference-counted hash-node pointer to this copy.
478 * Allocate a new node in the time-ordered list of lines.
482 * If a new line-node couldn't be allocated, discard our copy of the
493 * list node.
500 * Append the new node to the end of the time-ordered list.
532 GlhLineNode *node; /* The line location node being checked */
566 node = glh->recall->prev;
569 node = glh->list.tail;
576 while(node && (node->group != glh->group || node->line == old_line ||
577 !_glh_line_matches_prefix(node->line, glh->prefix)))
578 node = node->prev;
582 if(node) {
584 * Recall the found node as the starting point for subsequent
587 glh->recall = node;
591 _glh_return_line(node->line, line, dim);
620 GlhLineNode *node; /* The line location node being checked */
649 node = glh->recall->next;
658 while(node && (node->group != glh->group || node->line == old_line ||
659 !_glh_line_matches_prefix(node->line, glh->prefix)))
660 node = node->next;
664 if(node) {
668 _glh_return_line(node->line, line, dim);
672 glh->recall = node;
677 if(node == glh->list.tail)
724 * Delete the node of the preserved line.
794 GlhLineNode *node; /* The line location node being checked */
826 for(node=glh->list.head; node && node->group != glh->group;
827 node = node->next)
832 if(!node)
835 * Record the above node as the starting point for subsequent
838 glh->recall = node;
842 _glh_return_line(node->line, line, dim);
847 if(node == glh->list.tail)
919 GlhLineNode *node; /* The line location node being checked */
929 for(node=glh->recall; node && offset != 0; node=node->next) {
930 if(node->group == glh->group)
934 for(node=glh->recall; node && offset != 0; node=node->prev) {
935 if(node->group == glh->group)
939 return node ? node->id : 0;
958 GlhLineNode *node; /* The line location node being checked */
972 node = _glh_find_id(glh, id);
976 if(!node || node->group != glh->group)
979 * Record the node of the matching line as the starting point
982 glh->recall = node;
986 _glh_return_line(node->line, line, dim);
1019 GlhLineNode *node; /* The line being saved */
1053 for(node=head; node; node=node->next) {
1058 _glh_write_timestamp(fp, node->timestamp) ||
1059 fprintf(fp, " %u\n", node->group) < 0) {
1065 for(seg=node->line->head; seg; seg=seg->next) {
1461 GlhLineNode *node; /* The line being displayed */
1495 for(node=glh->list.head; node; node=node->next) {
1496 if(node->group > grpmax)
1497 grpmax = node->group;
1505 * Find the node that follows the oldest line to be displayed.
1526 for(node=oldest; node; node=node->next) {
1531 if(all_groups || node->group == glh->group) {
1535 * Work out the calendar representation of the node timestamp.
1537 if(node->timestamp != (time_t) -1)
1538 t = localtime(&node->timestamp);
1581 snprintf(buffer, sizeof(buffer), "%*lu", idlen, (unsigned long) node->id);
1587 snprintf(buffer, sizeof(buffer), "%*u", grplen, (unsigned) node->group);
1593 for(seg=node->line->head; seg; seg=seg->next) {
1766 * list, or until we have seen max_lines lines (at which point 'node'
1770 GlhLineNode *node;
1771 for(node=glh->list.tail; node && ++nline <= max_lines; node=node->prev)
1776 if(node) {
1777 GlhLineNode *oldest = node->next; /* The oldest line to be kept */
1779 * Delete nodes from the head of the list until we reach the node that
1852 GlhLineNode *node; /* The line node being checked */
1853 GlhLineNode *next; /* The line node that follows 'node' */
1857 for(node=glh->list.head; node; node=next) {
1859 * Keep a record of the following node before we delete the current
1860 * node.
1862 next = node->next;
1864 * Discard this node?
1866 if(node->group == glh->group)
1867 _glh_discard_line(glh, node);
1892 * node GlhLineNode * The line to be discarded, specified via its
1896 static void _glh_discard_line(GlHistory *glh, GlhLineNode *node)
1899 * Remove the node from the linked list.
1901 if(node->prev)
1902 node->prev->next = node->next;
1904 glh->list.head = node->next;
1905 if(node->next)
1906 node->next->prev = node->prev;
1908 glh->list.tail = node->prev;
1910 * If we are deleting the node that is marked as the start point of the
1913 if(node == glh->id_node)
1916 * If we are deleting the node that is marked as the start point of the
1919 if(node == glh->recall)
1924 node->line = _glh_discard_copy(glh, node->line);
1926 * Return the node to the freelist.
1928 (void) _del_FreeListNode(glh->list.node_mem, node);
1958 GlhLineNode *node; /* The located line location node */
1967 node = _glh_find_id(glh, id);
1971 if(!node)
1981 if(node->line->len + 1 > glh->lbuf_dim) {
1982 int lbuf_dim = node->line->len + 1;
1994 _glh_return_line(node->line, glh->lbuf, glh->lbuf_dim);
2004 *group = node->group;
2009 *timestamp = node->timestamp;
2014 * Lookup a node in the history list by its ID.
2020 * return GlhLIneNode * The located node, or NULL if not found.
2024 GlhLineNode *node; /* The node being checked */
2034 node = glh->id_node;
2035 if(!node)
2036 node = glh->list.head;
2038 * Search forwards from 'node'?
2040 if(node->id < id) {
2041 while(node && node->id != id)
2042 node = node->next;
2043 glh->id_node = node ? node : glh->list.tail;
2045 * Search backwards from 'node'?
2048 while(node && node->id != id)
2049 node = node->prev;
2050 glh->id_node = node ? node : glh->list.head;
2053 * Return the located node (this will be NULL if the ID wasn't found).
2055 return node;
2158 * then return a reference-counted hash-node pointer to this copy.
2166 * return GlhHashNode * The hash-node containing the stored line, or
2173 GlhHashNode *hnode; /* The hash-table node of the line */
2216 * Create a new hash-node for the line.
2223 * the hash node.
2231 * Prepend the new hash node to the list within the associated bucket.
2236 * Initialize the rest of the members of the hash node.
2251 * Decrement the reference count of the history line of a given hash-node,
2252 * and if the count reaches zero, delete both the hash-node and the
2257 * hnode GlhHashNode * The node to be removed.
2259 * return GlhHashNode * The deleted hash-node (ie. NULL).
2266 * If decrementing the reference count of the hash-node doesn't reduce
2269 * access to the hash-node copy has been deleted.
2274 * Remove the hash-node from the list in its parent bucket.
2279 GlhHashNode *prev; /* The node which precedes hnode in the bucket */
2287 * Return the line segments of the hash-node to the list of unused segments.
2290 GlhLineSeg *tail; /* The last node in the list of line segments */
2293 * Get the last node of the list of line segments referenced in the hash-node,
2299 * Prepend the list of line segments used by the hash node to the
2308 * Return the container of the hash-node to the freelist.
2358 GlhHashNode *node; /* A node in the list of lines in the bucket */
2362 for(node=bucket->lines; node; node=node->next) {
2363 if(_glh_is_line(node, line, n))
2364 return node;
2371 * node.
2385 GlhLineSeg *seg; /* A node in the list of line segments */
2469 GlhLineSeg *seg; /* A node in the list of line segments */