LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-12-2018, 01:59 PM   #1
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 149

Rep: Reputation: 12
cpp basic syntax question


Near the top of this cpp file is found:
Code:
BEGIN_APS( “the app name in all caps” );
BEGIN_STATUS();
   INT32 ( GOOD_COUNT, UNITS_NONE,OPTIONAL);
   INT32( BAD_COUNT, UNITS_NONE, OPTIONAL );
// repeat for multiple lines
END_STATUS();
Further down is found:
Code:
GOOD_COUNT ++;
These look like simple declarations, but UNITS_NONE and OPTIONAL are repeated. Structures? But the semicolon at end of BEGIN_STATUS(); surprises me.

Please enlighten me.
Edit: It occurs to me that macros may be in use here. I have never written any? Is that a possibility?

Last edited by bkelly; 04-12-2018 at 05:36 PM.
 
Old 04-12-2018, 05:38 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,383

Rep: Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540
Those are likely macros. Somewhere in that file, or in files it #includes, there is some #define BEGIN_APS(appname) statement. So you have to see what the macro definitions are in order to decide what they're doing.
 
Old 04-12-2018, 07:40 PM   #3
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 877

Rep: Reputation: 208Reputation: 208Reputation: 208
Earlier, it was conventional wisdom that #defines do not end with a semi colon.. This is because the semi colon marks the end of a statement and when the definition is used, that might not be the case.

Looks more like a header.

Further, the name INT32 (as opposed to int32) looks like a custom name.

OK
 
  


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
gphoto2- basic syntax for deleting file from command line eco_bach Linux - Software 8 12-30-2016 02:16 AM
Bash shell scripting basic question regarding the syntax BeingGokul Linux - General 2 09-23-2013 10:39 AM
basic if then else syntax question tmaxx Linux - General 1 01-23-2007 11:31 PM
debian dpkg cpp depends on cpp error darkleaf Linux - Software 2 06-25-2004 01:47 AM
help with basic syntax in bash script Supp0rtLinux Linux - Software 4 03-27-2003 06:57 PM

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

All times are GMT -5. The time now is 04:52 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration