[Anet-checkins] CVS: ANet/ANet_Daemon/Common ANetCommon.h,1.1,1.2 Args.c,1.1,1.2 Args.h,1.1,1.2 File
Status: Abandoned
Brought to you by:
benad
From: Benoit N. <be...@us...> - 2001-12-12 20:05:13
|
Update of /cvsroot/anet/ANet/ANet_Daemon/Common In directory usw-pr-cvs1:/tmp/cvs-serv3540/ANet_Daemon/Common Modified Files: ANetCommon.h Args.c Args.h Files.h Log Message: Starting low-level docs with doxygen Index: ANetCommon.h =================================================================== RCS file: /cvsroot/anet/ANet/ANet_Daemon/Common/ANetCommon.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ANetCommon.h 2001/11/05 23:27:03 1.1 --- ANetCommon.h 2001/12/12 20:05:09 1.2 *************** *** 11,14 **** --- 11,35 ---- #define ANET_COMMON + /*! + \addtogroup common Common + Code commom between the various parts of the ANet Daemon and common throughout its various ports. + */ + + /*! + \addtogroup utils Utilities + \ingroup common + Useful stuff, but maybe not essential. + */ + + /*! + \addtogroup common + \{ + */ + + /*! + \file + \brief Common declarations in the ANet Daemon. + */ + #ifndef __MACTYPES__ Index: Args.c =================================================================== RCS file: /cvsroot/anet/ANet/ANet_Daemon/Common/Args.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Args.c 2001/12/01 01:48:09 1.1 --- Args.c 2001/12/12 20:05:09 1.2 *************** *** 1,51 **** #include "Args.h" ! /* ! int main(int argc, char ** argv) ! { ! char * inString; ! char * ptr; ! char * argument; ! int i, argsSize; ! ! argsSize = 0; ! for(i = 0; i < argc; i++) ! { ! for(ptr = argv[i]; *ptr; ptr++, argsSize++); ! argsSize++; ! } ! ! printf("argsSize = %d\n", argsSize); ! ! if (!(inString = malloc(argsSize))) ! return -1; ! ! MakeArgumentString(argc, argv, inString, argsSize); ! ! printf("The argument string is [%s]\n", inString); ! ! if (!(argument = malloc(80))) ! return -1; ! ! if (GetArgument(inString, "d", argument, 80) != 0) ! printf("Argument -d is not passed\n"); ! else ! printf("argument -d is [%s]\n", argument); ! ! free(argument); ! if (!(argument = malloc(80))) ! return -1; ! ! if (GetArgument(inString, "c", argument, 80) != 0) ! printf("Argument -c is not passed\n"); ! else ! printf("argument -c is [%s]\n", argument); ! ! free(inString); ! return 0; ! } */ void MakeArgumentString(int argc, char ** argv, char * outArgs, int argsSize) { --- 1,26 ---- #include "Args.h" ! /*! ! \addtogroup argUtils Argument Utilities ! \ingroup utils ! Here are the argument utilities. They help parse/generate argument ! lists in the style of command-line arguments. ! \{ ! */ ! /*! ! \file ! \brief Argument utilities. ! \author Chyrag ! \author Benad */ + //! Makes a string from main-style argc and argv. + /*! + \param argc The number of arguments. + \param argv Array to a list of argument strings of size argc. + \param outArgs The generated string. Memory must already be allocated. + \param argsSize The size, in bytes, of the pre-allocated <CODE>outArgs</CODE>. + */ void MakeArgumentString(int argc, char ** argv, char * outArgs, int argsSize) { *************** *** 63,66 **** --- 38,52 ---- } + //! Gets a specified argument from an argument string. + /*! + This function tries to find the argument and, if possible, its value. + One-letter arguments can be grouped together as in "<CODE>-xzf</CODE>" but in this case all these arguments cannot have a value. + Otherwise, values can be assigned with "<CODE>--argument value</CODE>" or "<CODE>-a value</CODE>". + \param inString The argument string to parse. + \param inArg The argument to get. Must be a proper NULL-terminated string, even if it is a single letter. + \param outVal The value of the argument. Memory must already be allocated. + \param valSize The size, in bytes, of the pre-allocated <CODE>outVal</CODE>. + \return 1 if and only if the argument is in the string. + */ int GetArgument(char * inString, char * inArg, char * outVal, int valSize) { *************** *** 161,162 **** --- 147,149 ---- } + /*! \} */ Index: Args.h =================================================================== RCS file: /cvsroot/anet/ANet/ANet_Daemon/Common/Args.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Args.h 2001/12/01 01:48:09 1.1 --- Args.h 2001/12/12 20:05:09 1.2 *************** *** 3,6 **** --- 3,13 ---- #include <string.h> + /*! + \file + \brief Argument utilities. + \author Chyrag + \author Benad + */ + void MakeArgumentString(int argc, char ** argv, char * outArgs, int argsSize); int GetArgument(char * inString, char * inArg, char * outVal, int valSize); Index: Files.h =================================================================== RCS file: /cvsroot/anet/ANet/ANet_Daemon/Common/Files.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Files.h 2001/12/04 00:50:03 1.4 --- Files.h 2001/12/12 20:05:09 1.5 *************** *** 17,20 **** --- 17,33 ---- #include "FilesSpecific.h" + /*! + \addtogroup files File Management Wrappers + \ingroup common + Here are the File Management Wrappers. They are "wrapper" functions that allow access to file management functions in a cross-platform way. + \{ + */ + + /*! + \file + \brief File management declarations. + \author Benad + */ + ANetFile ANetInitFile(); UInt32 ANetGetSetFilePath(ANetFile *f, ANetMemoryTag path, UInt8 set); *************** *** 31,32 **** --- 44,47 ---- #endif + + /*! \} */ |