_on_stdin(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh EINA_UNUSED)
{
char *line = NULL;
+#ifdef _WIN32
+ char lbuf[4096] = "";
+ ssize_t r;
+ if (fgets(lbuf, sizeof(lbuf), stdin) == NULL)
+ r = -1;
+ else
+ {
+ line = strdup(lbuf);
+ r = strlen(line);
+ }
+#else
size_t len = 0;
ssize_t r = getline(&line, &len, stdin);
+#endif
if (r < 0)
{
"%.*s\n"
">>>>>\n",
ev->size,
- ev->size, ev->data);
+ ev->size, (const char *)ev->data);
return ECORE_CALLBACK_RENEW;
}
Eina_Bool
-_write(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Con_Event_Server_Write *ev)
+_write_(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_Con_Event_Server_Write *ev)
{
printf("Sent %d bytes to server\n", ev->size);
return ECORE_CALLBACK_RENEW;
/* set event handler for receiving server data */
ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA, (Ecore_Event_Handler_Cb)_data, NULL);
/* set event handler that notifies of sent data */
- ecore_event_handler_add(ECORE_CON_EVENT_SERVER_WRITE, (Ecore_Event_Handler_Cb)_write, NULL);
+ ecore_event_handler_add(ECORE_CON_EVENT_SERVER_WRITE, (Ecore_Event_Handler_Cb)_write_, NULL);
/* set event handler that notifies of errors */
ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ERROR, (Ecore_Event_Handler_Cb)_error, NULL);
/* set event handler that notifies of upgrades */
Eina_Bool
-_write(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
+_write_(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
Ecore_Con_Event_Client_Write *ev = event;
printf("Sent %d bytes to client %s\n", ev->size, ecore_con_client_ip_get(ev->client));
/* set event handler for receiving client data */
ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA, (Ecore_Event_Handler_Cb)_data, NULL);
/* set event handler that notifies of sent data */
- ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_WRITE, (Ecore_Event_Handler_Cb)_write, NULL);
+ ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_WRITE, (Ecore_Event_Handler_Cb)_write_, NULL);
/* set event handler that notifies of errors */
ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ERROR, (Ecore_Event_Handler_Cb)_error, NULL);
/* set event handler that notifies of upgrades */