+static int qc_strcat(qc_program *prog)
+{
+ char *buffer;
+ size_t len1, len2;
+ char *cstr1, *cstr2;
+ qcany *str1, *str2;
+ qcany out;
+
+ CheckArgs(2);
+ str1 = GetArg(0);
+ str2 = GetArg(1);
+ cstr1 = prog_getstring(prog, str1->string);
+ cstr2 = prog_getstring(prog, str2->string);
+ len1 = strlen(cstr1);
+ len2 = strlen(cstr2);
+ buffer = (char*)mem_a(len1 + len2 + 1);
+ memcpy(buffer, cstr1, len1);
+ memcpy(buffer+len1, cstr2, len2+1);
+ out.string = prog_tempstring(prog, buffer);
+ mem_d(buffer);
+ Return(out);
+ return 0;
+}
+
+static int qc_strcmp(qc_program *prog)
+{
+ char *cstr1, *cstr2;
+ qcany *str1, *str2;
+ qcany out;
+
+ if (prog->argc != 2 && prog->argc != 3) {
+ printf("ERROR: invalid number of arguments for strcmp/strncmp: %i, expected 2 or 3\n",
+ prog->argc);
+ return -1;
+ }
+
+ str1 = GetArg(0);
+ str2 = GetArg(1);
+ cstr1 = prog_getstring(prog, str1->string);
+ cstr2 = prog_getstring(prog, str2->string);
+ if (prog->argc == 3)
+ out._float = strncmp(cstr1, cstr2, GetArg(2)->_float);
+ else
+ out._float = strcmp(cstr1, cstr2);
+ Return(out);
+ return 0;
+}
+