ESDM
Middleware for Earth System Data
|
This document describes the style guide to use in the code.
//First add standard libraries #include <stdio.h> #include <stdlib.h>
// Add an empty line before adding any ESDM include file #include <esdm-internal.h>
struct x_t{ int a; int b; int *p; };
typedef struct x_t x_t; // needs always to be split separately, to allow it to coexist in a public header file
int testfunc(int a){ { // Additional basic block } if (a == 5){
}else{
}
// allocate variables as late as possible, such that we can see when it is needed and what it does. int ret;
switch(a){ case(5):{ break; }case(2):{
} default:{ xxx } }
return 0; }