Changeset 1264 for trunk/lang/tcl/src/RpEncodeTclInterface.cc
- Timestamp:
- Jan 7, 2009 9:31:14 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lang/tcl/src/RpEncodeTclInterface.cc
r1042 r1264 68 68 Tcl_AppendResult(interp, 69 69 "wrong # args: should be \"", 70 Tcl_GetString(objv[0])," binary <string>\"",70 Tcl_GetString(objv[0])," binary|encoded <string>\"", 71 71 (char*)NULL); 72 72 return TCL_ERROR; … … 78 78 const char *buf = (const char*) Tcl_GetByteArrayFromObj(objv[2],&bufLen); 79 79 80 if ( strcmp(type,"binary") == 0) {80 if (('b' == *type) && (strcmp(type,"binary") == 0)) { 81 81 if (Rappture::encoding::isbinary(buf,bufLen) != 0) { 82 82 // non-ascii character found, return yes … … 86 86 } 87 87 return TCL_OK; 88 } else if (('e' == *type) && (strcmp(type,"encoded") == 0)) { 89 if (Rappture::encoding::isencoded(buf,bufLen) != 0) { 90 // valid "@@RP-ENC:" header found, return yes 91 Tcl_AppendResult(interp, "yes", (char*)NULL); 92 } else { 93 Tcl_AppendResult(interp, "no",(char*)NULL); 94 } 95 return TCL_OK; 88 96 } 89 97 Tcl_AppendResult(interp, "bad option \"", type, 90 "\": should be binary",98 "\": should be one of binary, encoded", 91 99 (char*)NULL); 92 100 return TCL_ERROR;
Note: See TracChangeset
for help on using the changeset viewer.