LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   truct keyword... (https://www.linuxquestions.org/questions/linux-kernel-70/truct-keyword-727102/)

antiregulator 05-19-2009 01:17 PM

truct keyword...
 
hi there...

as i was wandering in the world of linux kernel headers, i stumbled on a type-name-like-thing with the name truct.

one example follows...

Code:

truct modversion_info
    unsigned long crc;
    char name[MODULE_NAME_LEN];
;

does anyone know anything more or should i just grep it until i find its definition!?

thx ppl!
dave.

pixellany 05-20-2009 06:58 AM

Unless someone declared an alias (or whatever C calls it), it's a typo. Should be "struct".

syg00 05-20-2009 07:01 AM

Something is trimming column 1 off your data (or your display). I'd lay a small wager it should look like
Code:

struct modversion_info
{
    unsigned long crc;
    char name[MODULE_NAME_LEN];
};


pixellany 05-20-2009 02:22 PM

Quote:

Originally Posted by syg00 (Post 3546865)
Something is trimming column 1 off your data (or your display). I'd lay a small wager it should look like
Code:

struct modversion_info
{
    unsigned long crc;
    char name[MODULE_NAME_LEN];
};


bingo!! That's the answer.

antiregulator 05-21-2009 08:17 AM

well, it kinda crossed my mind, but, on the same file all edge charachters are present!

#includes <...> are not deprived of a #, and as you can see, the semicolons line up properly!

pixellany 05-21-2009 08:26 AM

Does it matter what program you use to read the file?

What happens if you do this?:

grep -A4 "truct modversion" filename

antiregulator 05-21-2009 08:31 AM

just try the next command...
Code:

/usr/src/linux/include/linux/grep -o truct ./*|sort|most
and see how widesperad is the use of truct!

syg00 05-21-2009 08:38 AM

Instead of -o, try word bounding ... :eek:

pixellany 05-21-2009 08:53 AM

Quote:

Originally Posted by antiregulator (Post 3548114)
just try the next command...
Code:

/usr/src/linux/include/linux/grep -o truct ./*|sort|most
and see how widesperad is the use of truct!

how is that syntax supposed to work?? Here, it tries to run "grep" in that path and of course cannot find it.

But, why are you asking us to run commands? You need to figure what's happening on your machine......

antiregulator 05-21-2009 09:18 AM

i did not force anyone to run any command at anytime m8!

and what is happening to my computer, possibly happens to yours as well!

and i am trully sorry for making a mistake in my command syntax. what i meant was
Code:

/usr/src/linux/include/linux/# grep -o truct ./*|sort|most

pixellany 05-22-2009 08:20 AM

bingo!! that does make more sense.....;)

"grep -o" returns only the search string, so what you are seeing is quite normal. It will find every line containing "truct" and print out only the "truct". It will do this for every line containing "struct".

syg00 has the right answer (word bounding)

I also asked if you had the same issue when using different programs to read the files.......


All times are GMT -5. The time now is 12:34 AM.