MIDAS
Loading...
Searching...
No Matches
Param Class Reference

Public Member Functions

 Param ()
 
 ~Param ()
 
void initparam ()
 
void setparam (const char *param, const char *value)
 
void freeparam ()
 
void printparam ()
 
const chargetparam (const char *param)
 
std::string xgetparam (const char *param)
 
BOOL isparam (const char *param)
 
void unsetparam (const char *param)
 

Public Attributes

char _param [MAX_PARAM][PARAM_LENGTH]
 
char_value [MAX_PARAM]
 
char _text [TEXT_SIZE]
 

Detailed Description

Definition at line 701 of file mhttpd.cxx.

Constructor & Destructor Documentation

◆ Param()

Param::Param ( )
inline

Definition at line 709 of file mhttpd.cxx.

710 {
711 initparam();
712 }
void initparam()
Definition mhttpd.cxx:719
Here is the call graph for this function:

◆ ~Param()

Param::~Param ( )
inline

Definition at line 714 of file mhttpd.cxx.

715 {
716 freeparam();
717 }
void freeparam()
Definition mhttpd.cxx:756
Here is the call graph for this function:

Member Function Documentation

◆ freeparam()

void Param::freeparam ( )
inline

Definition at line 756 of file mhttpd.cxx.

757 {
758 int i;
759
760 for (i=0 ; i<MAX_PARAM ; i++)
761 if (_value[i] != NULL) {
762 free(_value[i]);
763 _value[i] = NULL;
764 }
765 }
char * _value[MAX_PARAM]
Definition mhttpd.cxx:705
INT i
Definition mdump.cxx:32
#define MAX_PARAM
Definition mhttpd.cxx:697
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getparam()

const char * Param::getparam ( const char param)
inline

Definition at line 776 of file mhttpd.cxx.

777 {
778 int i;
779
780 if (equal_ustring(param, "text"))
781 return _text;
782
783 for (i = 0; i < MAX_PARAM && _param[i][0]; i++)
785 break;
786
787 if (i == MAX_PARAM)
788 return NULL;
789
790 if (_value[i] == NULL)
791 return "";
792
793 return _value[i];
794 }
char _param[MAX_PARAM][PARAM_LENGTH]
Definition mhttpd.cxx:704
char _text[TEXT_SIZE]
Definition mhttpd.cxx:706
BOOL equal_ustring(const char *str1, const char *str2)
Definition odb.cxx:3206
char param[10][256]
Definition mana.cxx:250
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initparam()

void Param::initparam ( )
inline

Definition at line 719 of file mhttpd.cxx.

720 {
721 memset(_param, 0, sizeof(_param));
722 memset(_value, 0, sizeof(_value));
723 _text[0] = 0;
724 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isparam()

BOOL Param::isparam ( const char param)
inline

Definition at line 805 of file mhttpd.cxx.

806 {
807 int i;
808
809 for (i = 0; i < MAX_PARAM && _param[i][0]; i++)
811 break;
812
813 if (i < MAX_PARAM && _param[i][0])
814 return TRUE;
815
816 return FALSE;
817 }
#define FALSE
Definition cfortran.h:309
#define TRUE
Definition midas.h:182
Here is the call graph for this function:
Here is the caller graph for this function:

◆ printparam()

void Param::printparam ( )
inline

Definition at line 767 of file mhttpd.cxx.

768 {
769 int i;
770
771 for (i = 0; i < MAX_PARAM && _param[i][0]; i++) {
772 printf("param %d name [%s] value [%s]\n", i, _param[i], _value[i]);;
773 }
774 }
Here is the call graph for this function:

◆ setparam()

void Param::setparam ( const char param,
const char value 
)
inline

Definition at line 726 of file mhttpd.cxx.

727 {
728 int i;
729
730 if (equal_ustring(param, "text")) {
731 if (strlen(value) >= TEXT_SIZE)
732 printf("Error: parameter value too big\n");
733
735 _text[TEXT_SIZE - 1] = 0;
736 return;
737 }
738
739 for (i = 0; i < MAX_PARAM; i++)
740 if (_param[i][0] == 0)
741 break;
742
743 if (i < MAX_PARAM) {
745
746 int size = strlen(value)+1;
747 _value[i] = (char*)malloc(size);
748 mstrlcpy(_value[i], value, size);
749 _value[i][strlen(value)] = 0;
750
751 } else {
752 printf("Error: parameter array too small\n");
753 }
754 }
#define PARAM_LENGTH
Definition mhttpd.cxx:698
#define TEXT_SIZE
Definition mhttpd.cxx:699
double value[100]
Definition odbhist.cxx:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unsetparam()

void Param::unsetparam ( const char param)
inline

Definition at line 819 of file mhttpd.cxx.

820 {
821 int i;
822
823 for (i = 0; i < MAX_PARAM; i++)
825 break;
826
827 if (i < MAX_PARAM) {
828 _param[i][0] = 0;
829 _value[i][0] = 0;
830 }
831 }
Here is the call graph for this function:

◆ xgetparam()

std::string Param::xgetparam ( const char param)
inline

Definition at line 796 of file mhttpd.cxx.

797 {
798 const char* s = getparam(param);
799 if (s)
800 return s;
801 else
802 return "";
803 }
const char * getparam(const char *param)
Definition mhttpd.cxx:776
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _param

char Param::_param[MAX_PARAM][PARAM_LENGTH]

Definition at line 704 of file mhttpd.cxx.

◆ _text

char Param::_text[TEXT_SIZE]

Definition at line 706 of file mhttpd.cxx.

◆ _value

char* Param::_value[MAX_PARAM]

Definition at line 705 of file mhttpd.cxx.


The documentation for this class was generated from the following file: