2012-01-06 13:07:23 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of Winix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
|
|
|
* Copyright (c) 2012, Tomasz Sowa
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "templates.h"
|
|
|
|
#include "core/request.h"
|
|
|
|
#include "core/misc.h"
|
|
|
|
#include "functions/functions.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace TemplatesFunctions
|
|
|
|
{
|
|
|
|
|
|
|
|
static Functions::Iterator winixfun_iter;
|
2012-01-06 13:55:08 +01:00
|
|
|
static size_t winixfun_curreq = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool man_winixfun_tabcheck()
|
|
|
|
{
|
|
|
|
if( winixfun_curreq != cur->request->id )
|
|
|
|
{
|
|
|
|
winixfun_curreq = cur->request->id;
|
|
|
|
winixfun_iter = functions->Begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
return winixfun_iter != functions->End();
|
|
|
|
}
|
2012-01-06 13:07:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
void man_winixfun_tab(Info & i)
|
|
|
|
{
|
2012-01-06 13:55:08 +01:00
|
|
|
man_winixfun_tabcheck();
|
|
|
|
|
2012-01-06 13:07:23 +01:00
|
|
|
if( i.iter == 0 )
|
|
|
|
winixfun_iter = functions->Begin();
|
|
|
|
else
|
|
|
|
if( winixfun_iter != functions->End() )
|
|
|
|
++winixfun_iter;
|
2012-01-06 13:55:08 +01:00
|
|
|
|
|
|
|
i.res = winixfun_iter != functions->End();
|
2012-01-06 13:07:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void man_winixfun_tab_index(Info & i)
|
|
|
|
{
|
|
|
|
i.out << (i.iter+1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void man_winixfun_tab_name(Info & i)
|
|
|
|
{
|
2012-01-06 13:55:08 +01:00
|
|
|
if( man_winixfun_tabcheck() )
|
2012-01-06 13:07:23 +01:00
|
|
|
i.out << winixfun_iter->first;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-06 13:55:08 +01:00
|
|
|
|
|
|
|
|
2012-01-06 13:07:23 +01:00
|
|
|
static EzcFun::Iterator ezcfun_iter;
|
2012-01-06 13:55:08 +01:00
|
|
|
static size_t ezcfun_curreq = 0;
|
2012-01-06 13:07:23 +01:00
|
|
|
|
|
|
|
|
2012-01-06 13:55:08 +01:00
|
|
|
bool man_ezcfun_tabcheck()
|
|
|
|
{
|
|
|
|
if( ezcfun_curreq != cur->request->id )
|
|
|
|
{
|
|
|
|
ezcfun_curreq = cur->request->id;
|
|
|
|
ezcfun_iter = ezc_functions.Begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
return ezcfun_iter != ezc_functions.End();
|
|
|
|
}
|
|
|
|
|
2012-01-06 13:07:23 +01:00
|
|
|
|
|
|
|
void man_ezcfun_tab(Info & i)
|
|
|
|
{
|
2012-01-06 13:55:08 +01:00
|
|
|
man_ezcfun_tabcheck();
|
|
|
|
|
2012-01-06 13:07:23 +01:00
|
|
|
if( i.iter == 0 )
|
|
|
|
ezcfun_iter = ezc_functions.Begin();
|
|
|
|
else
|
|
|
|
if( ezcfun_iter != ezc_functions.End() )
|
|
|
|
++ezcfun_iter;
|
|
|
|
|
2012-01-06 13:55:08 +01:00
|
|
|
i.res = ezcfun_iter != ezc_functions.End();
|
2012-01-06 13:07:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void man_ezcfun_tab_index(Info & i)
|
|
|
|
{
|
|
|
|
i.out << (i.iter+1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void man_ezcfun_tab_name(Info & i)
|
|
|
|
{
|
2012-01-06 13:55:08 +01:00
|
|
|
if( man_ezcfun_tabcheck() )
|
2012-01-06 13:07:23 +01:00
|
|
|
i.out << ezcfun_iter->first;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace TemplatesFunctions
|
|
|
|
|
|
|
|
|
|
|
|
|