Skip to content

Commit

Permalink
Merge pull request #388 from REmerald/patch
Browse files Browse the repository at this point in the history
(c.json) small improvements
  • Loading branch information
rafamadriz authored Jan 24, 2024
2 parents 7183d12 + e83ce90 commit aced40b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions snippets/c/c.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
"body": ["#define ${1:MACRO}($2) ($3)"],
"description": "Function-like macro snippet"
},
"_GNU_SOURCE": {
"prefix": "#gnu",
"body": ["#define _GNU_SOURCE"],
"description": "Enable GNU extensions (functions)"
},
"#if": {
"prefix": "#if",
"body": ["#if ${1:0}", "$0", "#endif /* if $1 */"],
Expand Down Expand Up @@ -214,13 +219,13 @@
"body": ["for (int ${1:i} = ${2:1}; $1 < argc; $1++) {$0", "}"],
"description": "'for' loop for cmdline arguments"
},
"Function declaration": {
"prefix": "fund",
"body": ["${2:void} ${1:fun}(${3:void});"],
"description": "Declare a function"
"Function ...": {
"prefix": "fun",
"body": ["${2:void} ${1:fun}(${3:void})$0"],
"description": "Make a function declaration/definition/pointer"
},
"Function definition": {
"prefix": "fun",
"prefix": "func",
"body": ["${2:void} ${1:fun}(${3:void})", "{$0", "}"],
"description": "Define a function"
},
Expand Down

0 comments on commit aced40b

Please sign in to comment.