Skip to content

Commit

Permalink
compile fix for rxtcp; link fails
Browse files Browse the repository at this point in the history
  • Loading branch information
rvjansen committed Dec 9, 2024
1 parent ed903f8 commit b18bd06
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions lib/plugins/rxtcp/rxtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,20 @@ uintptr_t *Messages=0;
* this and that
* ------------------------------------------------------------------------------------------------
*/
#if defined(__APPLE__)
#else



/* #if defined(__APPLE__) */
/* #else */

void toUpperCase(char *str) {
if (str == NULL) return; // Handle null pointer
while (*str) {
*str = toupper((unsigned char)*str); // Convert current character to uppercase
str++;
}
}

void GetWord(char *result, const char *str, int n) {
int i = 0, j = 0, wordCount = 0;

Expand All @@ -78,6 +83,7 @@ void GetWord(char *result, const char *str, int n) {
strcpy(result, "");
}
}

int CountWords(const char *str) {
int i = 0,wordCount = 0;

Expand All @@ -91,7 +97,7 @@ int CountWords(const char *str) {
}
return wordCount;
}
#endif
/* #endif */
/* ------------------------------------------------------------------------------------------------
* Open a TCP address to access a TCP server
* ------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -356,7 +362,8 @@ ENDPROC
* ------------------------------------------------------------------------------------------------
*/
PROCEDURE(waitX) {
wait(GETINT(ARG0));
int waittime = 10;
wait(&waittime);
RETURNINTX(0);
ENDPROC
}
Expand All @@ -365,7 +372,11 @@ ENDPROC
* ------------------------------------------------------------------------------------------------
*/
PROCEDURE(tcpflags) {
char *flags = GETSTRING(ARG0);
void toUpperCase(char *str);
void GetWord(char *result, const char *str, int n);
int CountWords(const char *str);

char *flags = GETSTRING(ARG0);
char word[32];
int words = 0,i;
toUpperCase(flags);
Expand Down Expand Up @@ -403,4 +414,4 @@ LOADFUNCS
ADDPROC(tcpserver, "rxtcp.tcpserver", "b",".int", "port=.int,expose sockets=.string[]");
ADDPROC(tcpwait, "rxtcp.tcpwait", "b",".int", "server=.int,timeout=.int,expose sockets=.string[]");

ENDLOADFUNCS
ENDLOADFUNCS

0 comments on commit b18bd06

Please sign in to comment.