LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-13-2006, 02:32 PM   #1
dogslayer
LQ Newbie
 
Registered: Feb 2006
Posts: 23

Rep: Reputation: 15
whats the significance of __ and "<0>"


cud any one plz tell me the significance of __ in a #define statement eg #define __KERNEL__ or #define __LINUX_MAC_H and so on.....whats the point of __ prefix in these statements? Is it some kind of programing standard???


And also what does the following statement do?
#define KERN_EMERG "<0>"
#define KERN_ALERT "<1>" and so on.......
here what does "<0>" and "<1>"signify?????
for what purpose is "< >" keyword used???

Last edited by dogslayer; 03-13-2006 at 02:33 PM.
 
Old 03-13-2006, 04:26 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Originally Posted by dogslayer
cud any one plz tell me the significance of __ in a #define statement eg #define __KERNEL__ or #define __LINUX_MAC_H and so on.....whats the point of __ prefix in these statements? Is it some kind of programing standard???
Yes, it's done by convention. When you include the kernel-header in your program you can be sure not to accidentally #define a macro that already 'taken'. Just remember not to use macro-names that start with __.

Quote:
Originally Posted by dogslayer
And also what does the following statement do?
#define KERN_EMERG "<0>"
#define KERN_ALERT "<1>" and so on.......
here what does "<0>" and "<1>"signify?????
for what purpose is "< >" keyword used???
I have no idea.
Maybe they're just printed (logged) literally?
 
Old 03-13-2006, 05:09 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
KERN_EMERG, and friends are used to specify the error log level in stuff you write using "printk". For example:
Code:
printk (KERN_NOTICE "setup_cdev(devno= 0x%x, major= %d, minor= %d, err= %d)...\n", 
  devno, fbdev2_info.major, minor, err);
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie question: whats the difference between "su root", "su" and "su -&quo mojarron Slackware 9 12-07-2009 04:08 PM
Whats with all the ads that mislead us into the "windows vs linux" thing? simeandrews General 6 03-30-2005 12:19 AM
c++ - what is the significance of ";" in the program argument? megaspaz Programming 2 07-23-2004 05:52 AM
whats the "chkdsk /f" equivlent on linux ? perry Linux - Software 1 05-27-2004 06:59 PM
Whats "Parity error during Data-In phase"?? markng Linux - General 0 08-06-2002 03:25 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration