12 if ( len >= 0 && (
unsigned int) len <= input.length() ) {
13 std::string retval = input.substr( 0, len );
14 input = input.substr( len );
22 char retval = input[0];
23 input = input.substr( 1 );
29 std::string::size_type where = input.find(
" " );
30 if (where != string::npos) {
31 std::string num = input.substr( 0, where );
33 input = input.substr( where+1 );
47 char add[2] = {
adder,
'\0'};
48 input += std::string( add, 1 );
123 if (
size-1 < newsize) {
124 char *tmp =
new char[newsize+1];
125 memset( tmp, 0, newsize+1 );
136 if (offset+len >=
size) {
137 std::cerr<<
"!!! ERROR : trying to read more data than buffer size (offset="<<offset<<
" - size="<<
size<<
" - to read="
138 <<len<<
") in "<<fun<<
" !!!"<<std::endl;
142 (
const_cast< char*
> (fun) )[0] += *
x;
174 #define NB_CASE( a ) \
206 sprintf(
typeerrbuf,
"<<Byte %d>>", (
int) c );
213 int tmpsize =
sizeof (
c);
225 offset +=
sizeof (
c);
236 std::cerr<<
"!!! ERROR : attempt to read invalid data at offset="<<offset<<
": Actual type is a "<<typgot
237 <<
" but I wanted a "<<typ<<
" !!!"<<std::endl;
241 (
const_cast< char*
> (typ) )[0] += *
x;
248 #define NETBUF_DEBUG_CLISERV
250 #ifdef NETBUF_DEBUG_CLISERV
253 #define ADD_NB( type ) addType( type )
254 #define CHECK_NB( type ) checkType( type )
256 #define ADD_NB( type )
257 #define CHECK_NB( type )
344 for (
int i = 0;
i < 9;
i++)
352 for (
int i = 0;
i < 9;
i++)
353 m.
r[
i] = this->getFloat();
523 int tmpsize =
sizeof (f);
538 offset +=
sizeof (s);
548 if (f > 1.0) ch = 255;
551 else ch = (
unsigned char) (f*255);
563 unsigned char ch( sch );
564 return ( (
float) ch )/255.0;
571 int tmpsize =
sizeof (d);
584 offset +=
sizeof (s);
591 int tmpsize =
sizeof (s);
605 offset +=
sizeof (s);
612 int tmpsize =
sizeof (i);
625 offset +=
sizeof (s);
632 int tmpsize =
sizeof (i);
645 offset +=
sizeof (s);
652 int tmpsize =
sizeof (
c);
665 offset +=
sizeof (
c);
681 unsigned char *retval = (
unsigned char*)
buffer+offset;
686 static unsigned char null =
'\0';
693 unsigned char *tmp = (
unsigned char*)
buffer+offset;
702 unsigned int len = str.length();
704 unsigned short length = len;
710 assert( len < 0xffffffff );
726 return std::string();
729 string str(
buffer+offset );
736 unsigned int len = this->
getInt32();
738 return std::string();
741 string str(
buffer+offset );
810 for (i = 0; i < 3; i++)
811 light.
vect[i] = this->getFloat();
813 for (i = 0; i < 4; i++)
814 light.
diffuse[i] = this->getFloat();
815 for (i = 0; i < 4; i++)
816 light.
specular[i] = this->getFloat();
817 for (i = 0; i < 4; i++)
818 light.
ambient[i] = this->getFloat();
819 for (i = 0; i < 3; i++)
821 for (i = 0; i < 3; i++)
834 for (i = 0; i < 3; i++)
837 for (i = 0; i < 4; i++)
839 for (i = 0; i < 4; i++)
841 for (i = 0; i < 4; i++)
843 for (i = 0; i < 3; i++)
845 for (i = 0; i < 3; i++)