Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 156070 Details for
Bug 235648
does nlm_lookup_host lose hosts in hash table?
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
test program
testprog.c (text/plain), 1.29 KB, created by
Jeff Layton
on 2007-06-04 13:04:15 UTC
(
hide
)
Description:
test program
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2007-06-04 13:04:15 UTC
Size:
1.29 KB
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> > >struct nlm_host { > int h_val; > struct nlm_host *h_next; >}; > > >int main (int argc, char **argv) { > struct nlm_host host_table[10]; > struct nlm_host *head, *host, **hp; > long compare; > int i; > > if (argc != 2) { > printf("usage: %s <match>\n", argv[0]); > return 1; > } > > compare = strtol(argv[1], NULL, 10); > printf("matching %ld\n", compare); > >// initialize > for (i = 0; i < 9; ++i) { > host_table[i].h_val = i; > host_table[i].h_next = &host_table[i+1]; > } > host_table[9].h_val = 9; > host_table[9].h_next = NULL; > head = &host_table[0]; > > printf("BEFORE:\n"); > printf("head = %p\n", head); > for (i = 0; i < 10; ++i) > printf("%d: %p, h_val=%d, h_next=%p\n", i, &host_table[i], > host_table[i].h_val, host_table[i].h_next); > >// shuffle > for (hp = &head; (host = *hp) != 0; hp = &host->h_next) { > if (compare == host->h_val) { > if (*hp != head) { > *hp = host->h_next; > host->h_next = head; > head = host; > } > break; > } > } > >// output > printf("\nAFTER:\n"); > printf("head = %p\n", head); > for (i = 0; i < 10; ++i) > printf("%d: %p, h_val=%d, h_next=%p\n", i, &host_table[i], > host_table[i].h_val, host_table[i].h_next); > > printf("\nLINKED LIST ORDER:\n"); > host = head; > while (host != NULL) { > printf("%d\n", host->h_val); > host = host->h_next; > } > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 235648
: 156070