getInt explanation

Can anybody explain the meaning of the following line:
int seqLen = getInt(argv[1],GN_GT_O,"seq-len");
I am not quite sure what the second argument is doing?
Thanks in advance!

Last edited on
is this a joke post?
You've given no context whatsoever?
I think given line is sufficient for asked question,if you know,anyways!
My apologises for my lack of understanding then :)
Perhaps the OP has no context to give. That would explain the question in the first place.
So I google'd GN_GT_O which led me to a github project
https://github.com/deferraz/tlpi-book/blob/master/memalloc/free_and_sbrk.c
Included at the top is tlpi_hdr.h, so I searched for that as well and found documentation on some book I have never read
http://man7.org/tlpi/code/online/dist/lib/tlpi_hdr.h.html
[rant]I bet the OP is reading it though, and for some reason decided not to share. Why I have no idea, because every other book reader that posts here will typically share the book title at least. Please in the future just give a slight amount more context, and perhaps the helper will have to do one less google. OK my rant is done, on with the answer.[/rant]
I clicked on getInt which led to here:
http://man7.org/tlpi/code/online/dist/lib/get_num.c.html#getInt
Then I saw that getNum is called so I scrolled up a little and noticed that GN_GT_O
affects the outcome of this if statement
1
2
    if ((flags & GN_GT_0) && res <= 0)
        gnFail(fname, "value must be > 0", arg, name);
Last edited on
Topic archived. No new replies allowed.