summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastian Wissler2009-04-02 17:45:49 +0200
committerBastian Wissler2009-04-02 17:45:49 +0200
commit19a7589eab90fc4f0df10ffd13537038c5e0e1d3 (patch)
tree45b3d826fa23ba833213b119b3c05c9e436a8087
parentvmchooser source: (diff)
downloadvmchooser-19a7589eab90fc4f0df10ffd13537038c5e0e1d3.tar.gz
vmchooser-19a7589eab90fc4f0df10ffd13537038c5e0e1d3.tar.xz
vmchooser-19a7589eab90fc4f0df10ffd13537038c5e0e1d3.zip
vmchoooser source + libs:
* added various fixes to vmchooser sources * changed default printer.sh and scanner.sh path to /etc/opt/openslx * imported missing libraries (fltk+libxml2 soft ignored from svn) git-svn-id: http://svn.openslx.org/svn/openslx/openslx-src-tools/vmchooser/trunk@2790 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r--fltk/lib/libfltk2.abin0 -> 1267776 bytes
-rw-r--r--fltk/lib/libfltk2_images.abin0 -> 63574 bytes
-rwxr-xr-xlibxml2/libs/libxml2.abin0 -> 1818552 bytes
-rw-r--r--vmchooser/Makefile4
-rw-r--r--vmchooser/SWindow.cxx6
-rw-r--r--vmchooser/inc/DataEntry.h1
-rw-r--r--vmchooser/main.cxx13
-rw-r--r--vmchooser/readLinSess.cxx2
-rw-r--r--vmchooser/readXmlDir.cxx12
-rw-r--r--vmchooser/runImage.cxx2
10 files changed, 20 insertions, 20 deletions
diff --git a/fltk/lib/libfltk2.a b/fltk/lib/libfltk2.a
new file mode 100644
index 0000000..2134332
--- /dev/null
+++ b/fltk/lib/libfltk2.a
Binary files differ
diff --git a/fltk/lib/libfltk2_images.a b/fltk/lib/libfltk2_images.a
new file mode 100644
index 0000000..b592740
--- /dev/null
+++ b/fltk/lib/libfltk2_images.a
Binary files differ
diff --git a/libxml2/libs/libxml2.a b/libxml2/libs/libxml2.a
new file mode 100755
index 0000000..2e20fd1
--- /dev/null
+++ b/libxml2/libs/libxml2.a
Binary files differ
diff --git a/vmchooser/Makefile b/vmchooser/Makefile
index 4e3cbc5..4531c8f 100644
--- a/vmchooser/Makefile
+++ b/vmchooser/Makefile
@@ -6,7 +6,7 @@ XDEPS := $(wildcard ${DEPS})
CC = g++
DEBUG_CCFLAGS = -O0 -Wall -I/usr/include -I../fltk/ -I. -I../libxml2/include -ggdb #-ggdb #-Werror
-CCFLAGS = -O2 -Wall -I/usr/include -I../fltk/ -I../libxml2/include/
+CCFLAGS = -O2 -Wall -I/usr/include -I../fltk/ -I. -I../libxml2/include/
LDFLAGS = -L/usr/lib
LIBS = -lpng ../fltk/lib/libfltk2_images.a -ljpeg -lz -lXi -lXinerama -lpthread -lm -lXext -lsupc++ -lXrender -lfontconfig -lXft -lXdmcp -lXau -ldl -lz -lfreetype -lX11 ../libxml2/libs/libxml2.a ../fltk/lib/libfltk2.a /usr/lib/libboost_regex-s.a /usr/lib/libboost_filesystem-s.a
@@ -25,7 +25,7 @@ debug: ${OBJS}
${CC} ${LDFLAGS} -o vmchooserdbg $^ ${LIBS}
${OBJS}: %.o: %.cxx %.dep
- ${CC} ${DEBUG_CCFLAGS} -o $@ -c $<
+ ${CC} ${CCFLAGS} -o $@ -c $<
${DEPS}: %.dep: %.cxx Makefile
${CC} ${CCFLAGS} -MM $< > $@
diff --git a/vmchooser/SWindow.cxx b/vmchooser/SWindow.cxx
index f70e8d2..97a964b 100644
--- a/vmchooser/SWindow.cxx
+++ b/vmchooser/SWindow.cxx
@@ -187,7 +187,10 @@ void SWindow::free_entries()
/******************************************************
* Small helper function to unfold the 2 parent groups
*
- * ADDED: Now reads session from ~/.vmchooser via helper
+ * ADDED: Now reads session from ~/.openslx/vmchooser via helper
+ *
+ * WARNING: this->ent and/or this->lin_ent
+ * has to assigned before WARNING
******************************************************/
void SWindow::unfold_entries(bool lin_entries, bool vm_entries) {
int ind = 0;
@@ -219,7 +222,6 @@ void SWindow::unfold_entries(bool lin_entries, bool vm_entries) {
if ( prename == '\0' ) {
return;
} else {
- //cout << "readSession returned:" << prename << endl;
sel.goto_index(0);
Item* it = (Item*) sel.next();
diff --git a/vmchooser/inc/DataEntry.h b/vmchooser/inc/DataEntry.h
index e012a4b..35d3091 100644
--- a/vmchooser/inc/DataEntry.h
+++ b/vmchooser/inc/DataEntry.h
@@ -28,7 +28,6 @@ struct DataEntry {
bool active;
bool locked;
- string password;
string pools;
string xdm;
int priority;
diff --git a/vmchooser/main.cxx b/vmchooser/main.cxx
index 82d7fdb..b266333 100644
--- a/vmchooser/main.cxx
+++ b/vmchooser/main.cxx
@@ -72,7 +72,7 @@ int main(int argc, char** argv) {
if (xmlpath == NULL) {
// Default Path comes here
- xmlpath = (char *) "/var/lib/virt/vmware/vmconfigs/";
+ xmlpath = (char *) "/var/lib/virt/vmware/";
}
/* VERSION */
@@ -126,7 +126,7 @@ int main(int argc, char** argv) {
// read xml image
xmlDoc* doc = xmlReadFile(opt->getArgv(0), NULL, XML_PARSE_RECOVER);
if (doc == NULL) {
- fprintf(stderr, "error: could not parse file %s\n", opt->getArgv(0));
+ fprintf(stderr, "Error: could not parse file %s\n", opt->getArgv(0));
return 1;
}
@@ -140,19 +140,14 @@ int main(int argc, char** argv) {
/* read xml files */
DataEntry** sessions = NULL;
DataEntry** lsessions = NULL;
- if (xmlpath != NULL) {
- sessions = readXmlDir(xmlpath);
- } else {
- fprintf(stderr,"Please give a path to xml directory for session images!");
- exit(1);
- }
+ sessions = readXmlDir(xmlpath);
lsessions = readLinSess(lsesspath);
SWindow& win = *SWindow::getInstance(width, height);
mainwin = &win;
bool lin_entries=false;
bool vm_entries=false;
-
+
if(lsessions != NULL) {
win.set_lin_entries(lsessions);
lin_entries = true;
diff --git a/vmchooser/readLinSess.cxx b/vmchooser/readLinSess.cxx
index 73dae0e..0779937 100644
--- a/vmchooser/readLinSess.cxx
+++ b/vmchooser/readLinSess.cxx
@@ -62,7 +62,7 @@ DataEntry** readLinSess(char* path)
return NULL;
}
DataEntry** result =
- (DataEntry**) malloc(gResult->gl_pathc *( sizeof(DataEntry*) +1));
+ (DataEntry**) malloc(gResult->gl_pathc * sizeof(DataEntry*) +1);
int c = 0;
diff --git a/vmchooser/readXmlDir.cxx b/vmchooser/readXmlDir.cxx
index aa88cb7..8e0e00c 100644
--- a/vmchooser/readXmlDir.cxx
+++ b/vmchooser/readXmlDir.cxx
@@ -253,9 +253,9 @@ DataEntry** readXmlDir(char* path)
// We need to reserve the memory for all the pointers here
if(xmlVec.size() == 0) {
- return new DataEntry*;
+ return NULL;
}
- DataEntry** result = (DataEntry**) malloc(xmlVec.size() * (sizeof(DataEntry*) +1));
+ DataEntry** result = (DataEntry**) malloc(xmlVec.size() * sizeof(DataEntry*) +1);
for (unsigned int i=0; i < xmlVec.size(); i++) {
loc = xmlVec[i].find( "Vorlage" );
@@ -289,9 +289,13 @@ DataEntry** readXmlDir(char* path)
// xmlFreeDoc(doc);
}
- result[c] = (DataEntry*) malloc(sizeof(DataEntry*));
result[c] = '\0';
- return result;
+ if(c!= 0) {
+ return result;
+ }
+ else {
+ return NULL;
+ }
}
diff --git a/vmchooser/runImage.cxx b/vmchooser/runImage.cxx
index 750d408..a5363ca 100644
--- a/vmchooser/runImage.cxx
+++ b/vmchooser/runImage.cxx
@@ -130,7 +130,7 @@ char* getFolderName() {
string writeConfXml(DataEntry& dat) {
//char* pname = getFolderName();
- string pname = string().append("/var/lib/virt/vmware/runscripts");
+ string pname = "/etc/opt/openslx/";
xmlNodePtr cur = 0;
xmlNodePtr root = 0;