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 699 of file mhttpd.cxx.

Constructor & Destructor Documentation

◆ Param()

Param::Param ( )
inline

Definition at line 707 of file mhttpd.cxx.

708 {
709 initparam();
710 }
void initparam()
Definition mhttpd.cxx:717
Here is the call graph for this function:

◆ ~Param()

Param::~Param ( )
inline

Definition at line 712 of file mhttpd.cxx.

713 {
714 freeparam();
715 }
void freeparam()
Definition mhttpd.cxx:754
Here is the call graph for this function:

Member Function Documentation

◆ freeparam()

void Param::freeparam ( )
inline

Definition at line 754 of file mhttpd.cxx.

755 {
756 int i;
757
758 for (i=0 ; i<MAX_PARAM ; i++)
759 if (_value[i] != NULL) {
760 free(_value[i]);
761 _value[i] = NULL;
762 }
763 }
char * _value[MAX_PARAM]
Definition mhttpd.cxx:703
INT i
Definition mdump.cxx:32
#define MAX_PARAM
Definition mhttpd.cxx:695
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 774 of file mhttpd.cxx.

775 {
776 int i;
777
778 if (equal_ustring(param, "text"))
779 return _text;
780
781 for (i = 0; i < MAX_PARAM && _param[i][0]; i++)
783 break;
784
785 if (i == MAX_PARAM)
786 return NULL;
787
788 if (_value[i] == NULL)
789 return "";
790
791 return _value[i];
792 }
char _param[MAX_PARAM][PARAM_LENGTH]
Definition mhttpd.cxx:702
char _text[TEXT_SIZE]
Definition mhttpd.cxx:704
BOOL equal_ustring(const char *str1, const char *str2)
Definition odb.cxx:3201
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 717 of file mhttpd.cxx.

718 {
719 memset(_param, 0, sizeof(_param));
720 memset(_value, 0, sizeof(_value));
721 _text[0] = 0;
722 }
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 803 of file mhttpd.cxx.

804 {
805 int i;
806
807 for (i = 0; i < MAX_PARAM && _param[i][0]; i++)
809 break;
810
811 if (i < MAX_PARAM && _param[i][0])
812 return TRUE;
813
814 return FALSE;
815 }
#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 765 of file mhttpd.cxx.

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

◆ setparam()

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

Definition at line 724 of file mhttpd.cxx.

725 {
726 int i;
727
728 if (equal_ustring(param, "text")) {
729 if (strlen(value) >= TEXT_SIZE)
730 printf("Error: parameter value too big\n");
731
733 _text[TEXT_SIZE - 1] = 0;
734 return;
735 }
736
737 for (i = 0; i < MAX_PARAM; i++)
738 if (_param[i][0] == 0)
739 break;
740
741 if (i < MAX_PARAM) {
743
744 int size = strlen(value)+1;
745 _value[i] = (char*)malloc(size);
746 mstrlcpy(_value[i], value, size);
747 _value[i][strlen(value)] = 0;
748
749 } else {
750 printf("Error: parameter array too small\n");
751 }
752 }
#define PARAM_LENGTH
Definition mhttpd.cxx:696
#define TEXT_SIZE
Definition mhttpd.cxx:697
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 817 of file mhttpd.cxx.

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

◆ xgetparam()

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

Definition at line 794 of file mhttpd.cxx.

795 {
796 const char* s = getparam(param);
797 if (s)
798 return s;
799 else
800 return "";
801 }
const char * getparam(const char *param)
Definition mhttpd.cxx:774
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 702 of file mhttpd.cxx.

◆ _text

char Param::_text[TEXT_SIZE]

Definition at line 704 of file mhttpd.cxx.

◆ _value

char* Param::_value[MAX_PARAM]

Definition at line 703 of file mhttpd.cxx.


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