Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

libcurl demo

  • Loading branch information...
commit 05dfccfe52ac19370d6ec4bac0487b3fc67b0270 1 parent e722120
@sbourdeauducq sbourdeauducq authored
View
4 src/Makefile
@@ -8,7 +8,7 @@ OBJCOPY=lm32-rtems$(RTEMS_VERSION)-objcopy
CFLAGS=-O9 -Wall -mbarrel-shift-enabled -mmultiply-enabled -mdivide-enabled -msign-extend-enabled -fsingle-precision-constant -I$(RTEMS_MAKEFILE_PATH)/lib/include -g
LDFLAGS=-mbarrel-shift-enabled -mmultiply-enabled -mdivide-enabled -msign-extend-enabled -B$(RTEMS_MAKEFILE_PATH)/lib -specs bsp_specs -qrtems
-LIBS=-lnfs -lftpd -ltelnetd -lyaffs2 -lmtk -llop -lfpvm -lpng -lz -lm
+LIBS=-lnfs -lftpd -ltelnetd -lyaffs2 -lmtk -llop -lfpvm -lpng -lcurl -lz -lm
OBJDIR=obj
BINDIR=bin
@@ -16,7 +16,7 @@ BINDIR=bin
OBJS=shellext.o sysconfig.o config.o fb.o input.o fbgrab.o shortcuts.o osc.o pngload.o flashvalid.o main.o
# GUI
-OBJS+=messagebox.o filedialog.o resmgr.o guirender.o performance.o cp.o keyboard.o ir.o audio.o midi.o oscsettings.o dmxspy.o dmxdesk.o dmx.o videoin.o patcheditor.o monitor.o firstpatch.o filemanager.o sysettings.o about.o flash.o shutdown.o
+OBJS+=messagebox.o filedialog.o resmgr.o guirender.o performance.o cp.o keyboard.o ir.o audio.o midi.o oscsettings.o dmxspy.o dmxdesk.o dmx.o videoin.o rsswall.o patcheditor.o monitor.o firstpatch.o filemanager.o sysettings.o about.o flash.o shutdown.o
# PDF
ifeq ($(WITH_PDF),1)
View
42 src/cp.c
@@ -26,6 +26,7 @@
#include "oscsettings.h"
#include "dmx.h"
#include "videoin.h"
+#include "rsswall.h"
#include "patcheditor.h"
#include "monitor.h"
#include "firstpatch.h"
@@ -100,15 +101,19 @@ enum {
CP_ITEM_OSC,
CP_ITEM_DMX,
CP_ITEM_VIDEOIN,
+
+ CP_ITEM_RSSWALL,
+ CP_ITEM_WEBUPDATE,
CP_ITEM_EDITOR,
CP_ITEM_MONITOR,
- CP_ITEM_START,
CP_ITEM_NEW,
- CP_ITEM_FIRSTPATCH,
CP_ITEM_LOAD,
CP_ITEM_SAVE,
+ CP_ITEM_FIRSTPATCH,
+ CP_ITEM_START,
+ CP_ITEM_STARTSIMPLE,
CP_ITEM_FILEMANAGER,
CP_ITEM_PDFREADER,
@@ -143,6 +148,12 @@ static void cp_callback(mtk_event *e, void *arg)
open_videoin_window();
break;
+ case CP_ITEM_RSSWALL:
+ open_rsswall_window();
+ break;
+ case CP_ITEM_WEBUPDATE:
+ break;
+
case CP_ITEM_EDITOR:
open_patcheditor_window();
break;
@@ -150,24 +161,27 @@ static void cp_callback(mtk_event *e, void *arg)
open_monitor_window();
break;
- case CP_ITEM_START:
- start_performance();
- break;
case CP_ITEM_NEW:
config_free();
on_config_change();
clear_changed();
break;
- case CP_ITEM_FIRSTPATCH:
- open_firstpatch_window();
- break;
case CP_ITEM_LOAD:
open_filedialog(load_dlg);
break;
case CP_ITEM_SAVE:
open_filedialog(save_dlg);
break;
-
+ case CP_ITEM_FIRSTPATCH:
+ open_firstpatch_window();
+ break;
+ case CP_ITEM_START:
+ start_performance();
+ break;
+ case CP_ITEM_STARTSIMPLE:
+ printf("TODO\n");
+ break;
+
case CP_ITEM_FILEMANAGER:
open_filemanager_window();
break;
@@ -234,9 +248,9 @@ void init_cp()
"g_online0.place(l_online, -column 2 -row 1)",
"g_online0.place(s_online2, -column 3 -row 1)",
"g_online = new Grid()",
- "b_rss = new Button(-text \"RSS wall\")",
+ "b_rsswall = new Button(-text \"RSS wall\")",
"b_webupdate = new Button(-text \"Web update\")",
- "g_online.place(b_rss, -column 1 -row 1)",
+ "g_online.place(b_rsswall, -column 1 -row 1)",
"g_online.place(b_webupdate, -column 2 -row 1)",
"g.place(g_online0, -column 1 -row 4)",
"g.place(g_online, -column 1 -row 5)",
@@ -329,13 +343,15 @@ void init_cp()
mtk_bind(appid, "b_osc", "commit", cp_callback, (void *)CP_ITEM_OSC);
mtk_bind(appid, "b_dmx", "commit", cp_callback, (void *)CP_ITEM_DMX);
mtk_bind(appid, "b_videoin", "commit", cp_callback, (void *)CP_ITEM_VIDEOIN);
+ mtk_bind(appid, "b_rsswall", "commit", cp_callback, (void *)CP_ITEM_RSSWALL);
+ mtk_bind(appid, "b_webupdate", "commit", cp_callback, (void *)CP_ITEM_WEBUPDATE);
mtk_bind(appid, "b_editor", "commit", cp_callback, (void *)CP_ITEM_EDITOR);
mtk_bind(appid, "b_monitor", "commit", cp_callback, (void *)CP_ITEM_MONITOR);
- mtk_bind(appid, "b_start", "commit", cp_callback, (void *)CP_ITEM_START);
- mtk_bind(appid, "b_firstpatch", "commit", cp_callback, (void *)CP_ITEM_FIRSTPATCH);
mtk_bind(appid, "b_new", "commit", cp_callback, (void *)CP_ITEM_NEW);
mtk_bind(appid, "b_load", "commit", cp_callback, (void *)CP_ITEM_LOAD);
mtk_bind(appid, "b_save", "commit", cp_callback, (void *)CP_ITEM_SAVE);
+ mtk_bind(appid, "b_firstpatch", "commit", cp_callback, (void *)CP_ITEM_FIRSTPATCH);
+ mtk_bind(appid, "b_startsimple", "commit", cp_callback, (void *)CP_ITEM_STARTSIMPLE);
mtk_bind(appid, "b_filemanager", "commit", cp_callback, (void *)CP_ITEM_FILEMANAGER);
#ifdef WITH_PDF
mtk_bind(appid, "b_pdfreader", "commit", cp_callback, (void *)CP_ITEM_PDFREADER);
View
2  src/main.c
@@ -63,6 +63,7 @@
#include "dmxdesk.h"
#include "dmx.h"
#include "videoin.h"
+#include "rsswall.h"
#include "patcheditor.h"
#include "firstpatch.h"
#include "monitor.h"
@@ -105,6 +106,7 @@ static rtems_task gui_task(rtems_task_argument argument)
init_dmxdesk();
init_dmx();
init_videoin();
+ init_rsswall();
init_patcheditor();
init_monitor();
init_firstpatch();
View
47 src/rsswall.c
@@ -0,0 +1,47 @@
+/*
+ * Flickernoise
+ * Copyright (C) 2011 Sebastien Bourdeauducq
+ *
+ * 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, version 3 of the License.
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <curl/curl.h>
+
+#include "rsswall.h"
+
+void init_rsswall()
+{
+}
+
+static size_t data_callback(void *ptr, size_t size, size_t nmemb, void *data)
+{
+ return fwrite(ptr, size, nmemb, stdout);
+}
+
+void open_rsswall_window()
+{
+ CURL *curl_handle;
+
+ curl_global_init(CURL_GLOBAL_ALL);
+ curl_handle = curl_easy_init();
+ curl_easy_setopt(curl_handle, CURLOPT_URL, "http://www.milkymist.org/");
+ curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, data_callback);
+ curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0");
+ curl_easy_perform(curl_handle);
+ curl_easy_cleanup(curl_handle);
+ curl_global_cleanup();
+}
View
24 src/rsswall.h
@@ -0,0 +1,24 @@
+/*
+ * Flickernoise
+ * Copyright (C) 2011 Sebastien Bourdeauducq
+ *
+ * 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, version 3 of the License.
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __RSSWALL_H
+#define __RSSWALL_H
+
+void init_rsswall();
+void open_rsswall_window();
+
+#endif /* __RSSWALL_H */
Please sign in to comment.
Something went wrong with that request. Please try again.