0311
This commit is contained in:
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"Init file": {
|
||||
"prefix": "init",
|
||||
"body": ["#include <stdio.h>", "", "int main() {", " return 0;", "}"],
|
||||
"description": "Init file"
|
||||
},
|
||||
"Define function swap two var with macro": {
|
||||
"prefix": "fn_swap_macro",
|
||||
"body": ["#define swap(a, b) { typeof(a) temp = a; a = b; b = temp; }"],
|
||||
"description": "Define function swap two var with macro"
|
||||
},
|
||||
"Define function swap two int": {
|
||||
"prefix": "fn_swap",
|
||||
"body": [
|
||||
"void swap(int *a, int *b) {",
|
||||
" int temp = *a;",
|
||||
" *a = *b;",
|
||||
" *b = temp;",
|
||||
"}"
|
||||
],
|
||||
"description": "Define function swap two int"
|
||||
},
|
||||
"Define function put bool": {
|
||||
"prefix": "fn_putbool",
|
||||
"body": ["#define putbool(x) (printf(\"%s\", (x) ? \"TRUE\" : \"FALSE\"))"],
|
||||
"description": "Define function put bool"
|
||||
},
|
||||
"Define function max": {
|
||||
"prefix": "fake_max",
|
||||
"body": ["#define max(i, j) (((i) > (j)) ? (i) : (j))"],
|
||||
"description": "Define function max"
|
||||
},
|
||||
"Define function min": {
|
||||
"prefix": "fake_min",
|
||||
"body": ["#define min(i, j) (((i) < (j)) ? (i) : (j))"],
|
||||
"description": "Define function min"
|
||||
},
|
||||
"Fake loop": {
|
||||
"prefix": "fake_loop",
|
||||
"body": ["while (0) { // Fake loop", "}"],
|
||||
"description": "Fake loop"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user