-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotes
More file actions
53 lines (37 loc) · 2.6 KB
/
notes
File metadata and controls
53 lines (37 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Oct 25 22:19:13 kronos kernel: main[24320]: segfault at 7f48f7330000 ip 00007f48f9532b29 sp 00007fff63ce2850 error 4 in libpcap.so.1.4.0[7f48f952a000+3d000]
Scrolling issue
case 'j'
if ((selection < Dptr->count-1) && (usePart2 == 0)) {
if (selection == p1scrollbottom-1) {
wmove(p1index, selection, 0);
werase(p1index);
p1scrolltop++;
p1scrollbottom++;
selection++;
wmove(p1index, selection, 0);
waddstr(p1index, "->");
PREFRESHP1DOMAINSSCROLL;
PREFRESHP1INDEXSCROLL;
#define PREFRESHP1DOMAINSSCROLL prefresh(p1domains, p1scrolltop, 0, 1, 3, part1rows, columns);
#define PREFRESHP1INDEXSCROLL prefresh(p1index, p1scrolltop, 0, 1, 0, part1rows, columns);
void NcursesPart1(Domains *Dptr)
{
int i;
// check if Part 1 needs its pads resized
//if (Dptr->count == rows-1)
//if (Dptr->count >= rows-1)
if (Dptr->count >= part1rows-1)
part1rows and Part1Resize()
20 rows fit on the screen but 24 items, when I scroll down to 24 then i scroll up, it is 4 behind
when not using realtime shutting down gets interrupted by PrintScreen
make Domains, IP, Request array automatically grow using master list of pointers to malloc new blocks of fixed size, then find domain using size or number from the start
for (i = 0; i < Dptr->count; i++) {
if (strncmp(Dptr->dptr[i]->name, host, strlen(host)) == 0)
return i;
}
// didn't find domain
return -1;
1. with the GetDomainIndex(), I have it iterate through all the "Domains" arrays(memory blocks) until it successfully gets a match on strncmp, in the Dptr struct I can have a variable holding the number of separate memory blocks, that increments each time a new malloc allocates a new memory block of Domain struct
2. once it finds the pointer in the master pointer list, it can give the domain_master_list[element][domain](2d array) to pass to functions like AddRequest, IncrementRequest, etc.
3. then in AddDomain, if I'm at the end of a memory block, I call a function to allocate a new memory block which will return the new pointer to the master list which will if at the end of the master list do a malloc by a factor of two to hold more pointers, copy all pointers from old master list to new master list, and increment the value holding the number of memory blocks in the Domains struct, then add the domain to the domain_master_list[element][domain]
* use hash tables hcreate /usr/include/search.h