LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 06-18-2018, 05:21 PM   #1
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Three curly brackets in c++ comments


I apologise for this naïve question, but I am having a look at some C++ code in the apt package and notice that there often appear to be comments containing only three curly brackets, e.g.

Code:
int main(int argc,const char *argv[])	/*{{{*/
{
   ...
}
					/*}}}*/
I can't determine what these are for. Is it some sort of pre-processing?
 
Old 06-18-2018, 06:03 PM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
It is not a naive question from my perspective because I didn't know what they meant either.

The explanation is in "doc/style.txt"
Quote:
The }}} and {{{ are folding marks if you have a folding
editor such as jed, the function separators are intended to give
a visual separate between functions for easier browsing of the larger files,
or indexed folding if you have such an editor.
https://sources.debian.org/src/apt/1...style.txt/#L17
 
1 members found this post helpful.
Old 06-18-2018, 06:07 PM   #3
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048

Original Poster
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Very interesting!

Thanks norobro.
 
  


Reply



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
[SOLVED] Want to grep data between square brackets(Including brackets) harshagr Programming 20 02-15-2018 07:23 AM
[SOLVED] Undefined variable inside Curly braces in the function srinietrx Programming 4 10-13-2015 02:38 AM
C Curly Brace Style MTK358 Programming 40 07-05-2010 04:16 AM
Kylix 3 and insert curly braket Dukov Programming 0 02-29-2004 01:01 PM
Curly Modem Problem stefanvg Linux - Hardware 0 04-28-2003 01:59 AM

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

All times are GMT -5. The time now is 05:40 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