Version 15.168.3

This commit is contained in:
Antonio Cañas Vargas 2016-03-30 17:48:18 +02:00
parent d94944b09c
commit 06ee5510a7
2 changed files with 19 additions and 22 deletions

View File

@ -138,13 +138,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.168.2 (2016-03-30)"
#define Log_PLATFORM_VERSION "SWAD 15.168.3 (2016-03-30)"
#define CSS_FILE "swad15.165.5.css"
#define JS_FILE "swad15.131.3.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/*
Version 15.168.3: Mar 30, 2016 Code refactoring in list of parameters. (197124 lines)
Version 15.168.2: Mar 30, 2016 Code refactoring in list of parameters. (197128 lines)
Version 15.168.1: Mar 30, 2016 Fixed bug in list of parameters. (197097 lines)
Version 15.168: Mar 30, 2016 When content is normal, all parameters are retrieved in a list. (197085 lines)

View File

@ -157,6 +157,19 @@ bool Par_GetQueryString (void)
/*****************************************************************************/
/************************ Create list of parameters **************************/
/*****************************************************************************/
/* Parameter #1 Parameter #2 Parameter #3
+-------------+ +-------------+ +-------------+
List -> | Name.Start | --> | Name.Start | --> | Name.Start |
+-------------+ / +-------------+ / +-------------+
| Name.Length | / | Name.Length | / | Name.Length |
+-------------+ / +-------------+ / +-------------+
| Value.Start | / | Value.Start | / | Value.Start |
+-------------+ / +-------------+ / +-------------+
| Value.Lengh | / | Value.Lengh | / | Value.Lengh |
+-------------+ / +-------------+ / +-------------+
| Next ----- | Next ----- | NULL |
+-------------+ +-------------+ +-------------+
*/
static void Par_CreateListOfParams (void)
{
@ -174,19 +187,7 @@ static void Par_CreateListOfParams (void)
/*****************************************************************************/
/**************** Create list of parameters from query string ****************/
/*****************************************************************************/
/*
+-------------+ +-------------+ +-------------+
List -> | Name.Start | --> | Name.Start | --> | Name.Start |
+-------------+ / +-------------+ / +-------------+
| Name.Length | / | Name.Length | / | Name.Length |
+-------------+ / +-------------+ / +-------------+
| Value.Start | / | Value.Start | / | Value.Start |
+-------------+ / +-------------+ / +-------------+
| Value.Lengh | / | Value.Lengh | / | Value.Lengh |
+-------------+ / +-------------+ / +-------------+
| Next ----- | Next ----- | NULL |
+-------------+ +-------------+ +-------------+
*/
static void Par_CreateListOfParamsFromQueryString (void)
{
unsigned long CurPos; // Current position in query string
@ -194,16 +195,11 @@ static void Par_CreateListOfParamsFromQueryString (void)
struct Param *NewParam;
/***** Check if query string is empty *****/
Gbl.Params.List = NULL;
if (Gbl.Params.QueryString == NULL)
{
Gbl.Params.List = NULL;
return;
}
if (!Gbl.Params.QueryString[0])
{
Gbl.Params.List = NULL;
return;
}
/***** Go over the query string
getting start positions and lengths of parameters *****/
@ -217,9 +213,9 @@ static void Par_CreateListOfParamsFromQueryString (void)
/* Link the previous element in list with the current element */
if (CurPos == 0)
Gbl.Params.List = NewParam;
Gbl.Params.List = NewParam; // Pointer to first param
else
Param->Next = NewParam;
Param->Next = NewParam; // Pointer from former param to new param
/* Make the current element to be the just created */
Param = NewParam;