Commi

Various KDE Stuff

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 50.0%
Description:

Commi is a line orientated serial terminal like minicom.
Supporting receiving and sending files, batchfile-processing, a history like in a bash.
It has a nice QT-GUI.

kritzner

12 years ago

diff commi-0.3.1/CHANGELOG commi-0.3.1a/CHANGELOG
0a1,2
> 2008/02/07 Arndt Kritzner
> * Handling of escape sequences in send function
diff commi-0.3.1/commimainform.ui.h commi-0.3.1a/commimainform.ui.h
513a514,578
> // Patch AK 20080207: handling of escape sequences
> int CommiMainForm::UnEscape(char *target, const char *source)
> {
> int result = 0;
> char *position = (char *)source;
> int sourcelen = strlen(source);
> unsigned char hexVal;
> unsigned Digits;
> while ((position-source)<sourcelen) {
> // printf("CommiMainForm::UnEscape [%d]->[%d] 0x%x, (%s)\n",position-source,result,*position,position);
> switch (*position) {
> case '\\': position++;
> if ((position-source)<sourcelen) {
> switch (*position) {
> case '\\': target[result] = '\\';
> break;
> case 'a': target[result] = '\x07';
> break;
> case 'b': target[result] = '\x08';
> break;
> case 'f': target[result] = '\x0c';
> break;
> case 'n': target[result] = '\x0a';
> break;
> case 'r': target[result] = '\x0d';
> break;
> case 't': target[result] = '\x09';
> break;
> case 'v': target[result] = '\x0b';
> break;
> case 'x': hexVal = 0;
> Digits = 0;
> position++;
> while (((position-source)<sourcelen) && (Digits<2) && (strchr("0123456789abcdefABCDEF",*position)!=NULL)) {
> hexVal<<=4;
> if (*position>='a')
> hexVal+=10+(*position-'a');
> else
> if (*position>='A')
> hexVal+=10+(*position-'A');
> else
> hexVal+=(*position-'0');
> position++;
> Digits++;
> }
> position--;
> target[result] = hexVal;
> break;
> default: target[result] = '\\';
> position--;
> break;
> }
> } else
> target[result] = '\\';
> break;
> default: target[result] = *position;
> break;
> }
> result++;
> position++;
> }
> target[result] = '\0';
> return result;
> }
>
517c582,588
< for (unsigned int i=0; i<s.length(); i++)
---
> char *binarybytes=new char[strlen(bytes)+1];
> unsigned int bytecount;
> bool is_binary;
> bytecount = UnEscape(binarybytes,bytes);
> is_binary = (strcmp(bytes,binarybytes) != 0);
> // printf("CommiMainForm::sendString [%s] =(%d)> [%s] (%d)\n",bytes,bytecount,binarybytes,is_binary);
> for (unsigned int i=0; i<bytecount; i++)
519c590
< if (!sendByte(*bytes))
---
> if (!sendByte(*binarybytes))
521c592
< bytes++;
---
> binarybytes++;
523a595
> if (!is_binary) {
525a598
> }

Report

kritzner

12 years ago

diff commi-0.3.1/CHANGELOG commi-0.3.1a/CHANGELOG
0a1,2
> 2008/02/07 Arndt Kritzner
> * Handling of escape sequences in send function
diff commi-0.3.1/commimainform.ui.h commi-0.3.1a/commimainform.ui.h
513a514,578
> // Patch AK 20080207: handling of escape sequences
> int CommiMainForm::UnEscape(char *target, const char *source)
> {
> int result = 0;
> char *position = (char *)source;
> int sourcelen = strlen(source);
> unsigned char hexVal;
> unsigned Digits;
> while ((position-source)<sourcelen) {
> // printf("CommiMainForm::UnEscape [%d]->[%d] 0x%x, (%s)\n",position-source,result,*position,position);
> switch (*position) {
> case '\\': position++;
> if ((position-source)<sourcelen) {
> switch (*position) {
> case '\\': target[result] = '\\';
> break;
> case 'a': target[result] = '\x07';
> break;
> case 'b': target[result] = '\x08';
> break;
> case 'f': target[result] = '\x0c';
> break;
> case 'n': target[result] = '\x0a';
> break;
> case 'r': target[result] = '\x0d';
> break;
> case 't': target[result] = '\x09';
> break;
> case 'v': target[result] = '\x0b';
> break;
> case 'x': hexVal = 0;
> Digits = 0;
> position++;
> while (((position-source)<sourcelen) && (Digits<2) && (strchr("0123456789abcdefABCDEF",*position)!=NULL)) {
> hexVal<<=4;
> if (*position>='a')
> hexVal+=10+(*position-'a');
> else
> if (*position>='A')
> hexVal+=10+(*position-'A');
> else
> hexVal+=(*position-'0');
> position++;
> Digits++;
> }
> position--;
> target[result] = hexVal;
> break;
> default: target[result] = '\\';
> position--;
> break;
> }
> } else
> target[result] = '\\';
> break;
> default: target[result] = *position;
> break;
> }
> result++;
> position++;
> }
> target[result] = '\0';
> return result;
> }
>
517c582,588
< for (unsigned int i=0; i<s.length(); i++)
---
> char *binarybytes=new char[strlen(bytes)+1];
> unsigned int bytecount;
> bool is_binary;
> bytecount = UnEscape(binarybytes,bytes);
> is_binary = (strcmp(bytes,binarybytes) != 0);
> // printf("CommiMainForm::sendString [%s] =(%d)> [%s] (%d)\n",bytes,bytecount,binarybytes,is_binary);
> for (unsigned int i=0; i<bytecount; i++)
519c590
< if (!sendByte(*bytes))
---
> if (!sendByte(*binarybytes))
521c592
< bytes++;
---
> binarybytes++;
523a595
> if (!is_binary) {
525a598
> }

Report

12345678910
product-maker Base: 4 x 5.0 Ratings
File (click to download) Version Description PackagetypeArchitecture Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.3.1
updated Oct 25 2004
added Oct 25 2004
downloads 24h
0
mediaviews 24h 0
pageviews 24h 0