diff options
author | Ole Loots <ole@monochrom.net> | 2012-12-31 03:37:43 +0100 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2012-12-31 03:37:43 +0100 |
commit | 695f0522370e43c5c6aa6b35a1c7c0ff93e5faa9 (patch) | |
tree | 4a95965fa12b7e5d2029e6a36e22774c2892b7d5 /atari/clipboard.c | |
parent | f0f57e34314b1a2e3327ab0ae65ec840efa3ee3a (diff) | |
download | netsurf-695f0522370e43c5c6aa6b35a1c7c0ff93e5faa9.tar.gz netsurf-695f0522370e43c5c6aa6b35a1c7c0ff93e5faa9.tar.bz2 |
Moved form handling into gemtk,
removed several windom includes
Diffstat (limited to 'atari/clipboard.c')
-rw-r--r-- | atari/clipboard.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/atari/clipboard.c b/atari/clipboard.c new file mode 100644 index 000000000..9b45e73cd --- /dev/null +++ b/atari/clipboard.c @@ -0,0 +1,79 @@ +/*
+ * Copyright 2013 Ole Loots <ole@monochrom.net>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf 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; version 2 of the License.
+ *
+ * NetSurf 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 <http://www.gnu.org/licenses/>.
+ *
+ * Module Description:
+ *
+ *
+ *
+ */
+ +#include <stdlib.h> +#include <stdint.h> +#include <string.h> +#include <stdio.h> +#include <mint/osbind.h> +#include "atari/clipboard.h" + + +static int filesize(char * path) +{ + FILE *f; + int fs; + + f = fopen( path, "r+b"); + if(!f) + return(-1); + + fseek(f, 0L, SEEK_END); + fs = ftell(f); + fclose(f); + + return(fs); +} + +int scrap_txt_write(char *str) +{ + scrap_wtxt(str); +} +
+char *scrap_txt_read(void) +{ + char * buf = NULL; + char path[80]; + int file; + int len; + + if (get_scrapdir (path)) + { + strcat (path, "scrap.txt"); + len = filesize(path); + if(len > 0){ + if ((file = (int) Fopen (path, 0)) >= 0) + { + buf = malloc(len); + if(buf){ + len = Fread (file, len, buf); + Fclose (file); + buf[len] = '\0'; + return buf; + } + } + } + } + +} + |