#include #include #include #include #include #include #include #include #include "tinyosc.h" #include "tinyosc.c" /* type.c. sends text to vrchat using osc from user input. Copyright (C) 2026 iceyrazor This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ int main(int argc, char **argv){ char wbuffer[2048]; // declare a 2Kb buffer to read packet data into int port=9000; struct sockaddr_in servaddr; int socketfd = socket(AF_INET, SOCK_DGRAM, 0); if (socketfd < 0) { perror("ERROR:"); return -1; } servaddr.sin_family = AF_INET; // IPv4 servaddr.sin_port = htons(port); // Server port servaddr.sin_addr.s_addr = inet_addr("127.0.0.1"); // Server IP size_t size=0; for (int i=1; i < argc; i++){ size+=strlen(argv[i])+1; } char *send_str=(char*)malloc(sizeof(char)*size+1); send_str[0]='\0'; for (int i=1; i < argc; i++){ strcat(send_str,argv[i]); strcat(send_str," "); } int len = tosc_writeMessage(wbuffer, sizeof(wbuffer), "/chatbox/input", "sTF", send_str); sendto(socketfd, wbuffer, len, MSG_CONFIRM, (const struct sockaddr *)&servaddr, sizeof(servaddr)); free(send_str); return 0; }