Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

skel.c

00001 /* 00002 * Copyright (C) 1997-2004 The CDG Team <cdg@nats.informatik.uni-hamburg.de> 00003 * 00004 * This file is free software; as a special exception the author gives 00005 * unlimited permission to copy and/or distribute it, with or without 00006 * modifications, as long as this notice is preserved. 00007 * 00008 * This program is distributed in the hope that it will be useful, but 00009 * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 00010 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00011 * 00012 * $Id: skel.c,v 1.9 2004/02/25 14:28:04 micha Exp $ 00013 */ 00014 00015 /* ------------------------------------------------------------------------- 00016 * @addtogroup Skel Skel - A Skeleton Module 00017 * @author your name 00018 * @date date of birth 00019 * 00020 * 00021 * Demonstration of the current @ref CodingStyle "coding style" and blueprint 00022 * for new modules. 00023 * 00024 * This module demonstrates how a module for the @c CDG typically looks like. 00025 * In addition it serves as a rough demonstration of some of the doxygen 00026 * capabilities. See skel.h and skel.c for the sources of this documentation. 00027 * 00028 * Note, that most of the documentation of a module should be placed into its 00029 * implementations file (e.g. skel.c) and only the documentation of 00030 * exported data structures (e.g. MyExportedType) and exported macros are left in the 00031 * declatrations file (e.g. skel.h). 00032 * So avoid rendundant documentation of functions and stuff in both places. 00033 * @{ 00034 */ 00035 00036 /* -- INCLUDES ------------------------------------------------------------- */ 00037 #include <cdg.h> 00038 #include <skel.h> 00039 00040 /* -- MACROS --------------------------------------------------------------- */ 00041 00042 /* -- TYPE DEFINITIONS ----------------------------------------------------- */ 00043 00044 /* ------------------------------------------------------------------------- 00045 * short description. 00046 * long description 00047 */ 00048 typedef struct { 00049 int memberA; /**< description */ 00050 int memberB; /**< description */ 00051 } MyPrivateTypeStruct; 00052 typedef MyPrivateTypeStruct *MyPrivateType; /**< type definition */ 00053 00054 /* -- VARIABLES ------------------------------------------------------------ */ 00055 00056 /** short description. long description */ 00057 int myExportedVariable; 00058 00059 /** short description. This variable is private to this module */ 00060 static int myPrivateVariable; 00061 00062 /* -- FUNCTIONS ------------------------------------------------------------ */ 00063 static int myPrivateFunction(int a, int b); 00064 00065 /* -- IMPLEMENTATION ------------------------------------------------------- */ 00066 00067 /* ------------------------------------------------------------------------- 00068 * short description. 00069 * long description 00070 * @param a comments on @a a 00071 * @param b comments on @a b 00072 * @returns the result 00073 */ 00074 static inline int myPrivateFunction(int a, int b) 00075 { 00076 return ++myPrivateVariable + a + b; 00077 } 00078 00079 /* ------------------------------------------------------------------------- 00080 * short description. 00081 * long description 00082 * @param a comments on @a a 00083 * @param b comments on @a b 00084 * @returns the result 00085 */ 00086 int myExportedFunction(int a, int b) 00087 { 00088 int result; 00089 00090 myExportedVariable++; 00091 00092 return result; 00093 } 00094 00095 /* ------------------------------------------------------------------------- */ 00096 /* -- ENDOFFILE ------------------------------------------------------------ */ 00097 /** @} */ 00098 00099

CDG 0.95 (20 Oct 2004)