[Swift-commit] cog r3460
swift at ci.uchicago.edu
swift at ci.uchicago.edu
Sat Sep 8 20:40:18 CDT 2012
------------------------------------------------------------------------
r3460 | hategan | 2012-09-08 20:38:12 -0500 (Sat, 08 Sep 2012) | 1 line
non-working, initial version of coaster c client
------------------------------------------------------------------------
Index: modules/provider-coaster-c-client/.project
===================================================================
--- modules/provider-coaster-c-client/.project (revision 0)
+++ modules/provider-coaster-c-client/.project (revision 3460)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>provider-coaster-c-client</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.linuxtools.cdt.autotools.core.genmakebuilderV2</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2</nature>
+ </natures>
+</projectDescription>
Index: modules/provider-coaster-c-client/AUTHORS
===================================================================
--- modules/provider-coaster-c-client/AUTHORS (revision 0)
+++ modules/provider-coaster-c-client/AUTHORS (revision 3460)
@@ -0,0 +1 @@
+Mihael Hategan
Index: modules/provider-coaster-c-client/src/CoasterChannel.h
===================================================================
--- modules/provider-coaster-c-client/src/CoasterChannel.h (revision 0)
+++ modules/provider-coaster-c-client/src/CoasterChannel.h (revision 3460)
@@ -0,0 +1,115 @@
+/*
+ * coaster-channel.h
+ *
+ * Created on: Jun 9, 2012
+ * Author: mike
+ */
+
+#ifndef COASTER_CHANNEL_H_
+#define COASTER_CHANNEL_H_
+
+#define HEADER_LENGTH 20
+
+#define READ_STATE_IDLE 0
+#define READ_STATE_HDR 1
+#define READ_STATE_DATA 2
+
+#include <map>
+#include <list>
+#include <string>
+
+#include "CommandCallback.h"
+#include "Handler.h"
+#include "Command.h"
+#include "HandlerFactory.h"
+#include "ChannelCallback.h"
+#include "Flags.h"
+#include "CoasterLoop.h"
+#include "CoasterClient.h"
+#include "Lock.h"
+#include "Buffer.h"
+#include "Logger.h"
+
+using namespace std;
+
+class Command;
+class Handler;
+class CoasterLoop;
+class CoasterClient;
+class HandlerFactory;
+
+
+class DataChunk {
+ public:
+ Buffer* buf;
+ int bufpos;
+ ChannelCallback* cb;
+
+ DataChunk();
+ DataChunk(Buffer* buf, ChannelCallback* pcb);
+ void reset();
+};
+
+class CoasterChannel: public CommandCallback {
+ private:
+ list<DataChunk*> sendQueue;
+ DataChunk readChunk;
+
+ HandlerFactory* handlerFactory;
+ map<int, Handler*> handlers;
+ map<int, Command*> commands;
+
+ int sockFD;
+ bool connected;
+
+ DataChunk whdr, rhdr, msg;
+ int rtag, rflags, rlen;
+
+ int tagSeq;
+ int readState;
+
+ CoasterLoop* loop;
+ CoasterClient* client;
+ Lock writeLock;
+
+ void makeHeader(int tag, Buffer* buf, int flags);
+ void decodeHeader(int* tag, int* flags, int* len);
+ void dispatchData();
+ void dispatchRequest();
+ void dispatchReply();
+ bool read(DataChunk* dc);
+
+ public:
+ CoasterChannel(CoasterClient* client, CoasterLoop* pLoop, HandlerFactory* pHandlerFactory);
+ virtual ~CoasterChannel();
+
+ int getSockFD();
+ void setSockFD(int psockFD);
+
+ list<DataChunk*> getSendQueue();
+
+ void shutdown();
+ void start();
+
+ void read();
+ bool write();
+
+ void registerCommand(Command* cmd);
+ void unregisterCommand(Command* cmd);
+
+ void registerHandler(int tag, Handler* h);
+ void unregisterHandler(Handler* h);
+
+ void send(int tag, Buffer* buf, int flags, ChannelCallback* cb);
+
+ CoasterClient* getClient();
+
+ void checkHeartbeat();
+
+ friend ostream& operator<< (ostream& os, CoasterChannel* channel);
+
+ void errorReceived(Command* cmd, string* message, string* details);
+ void replyReceived(Command* cmd);
+};
+
+#endif /* COASTER_CHANNEL_H_ */
Index: modules/provider-coaster-c-client/src/CoasterClient.cpp
===================================================================
--- modules/provider-coaster-c-client/src/CoasterClient.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/CoasterClient.cpp (revision 3460)
@@ -0,0 +1,227 @@
+/*
+ * coaster-client.c
+ *
+ * Created on: Jun 9, 2012
+ * Author: mike
+ */
+
+#include "CoasterClient.h"
+#include "JobSubmitCommand.h"
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "Logger.h"
+
+ConnectionError::ConnectionError(string msg) {
+ message = msg.c_str();
+}
+
+const char* ConnectionError::what() const throw() {
+ return message;
+}
+
+CoasterClient::CoasterClient(string URLp, CoasterLoop& ploop) {
+ URL = URLp;
+ sockFD = 0;
+ loop = &ploop;
+ started = false;
+}
+
+void CoasterClient::start() {
+ if (started) {
+ return;
+ }
+
+ struct addrinfo* addrInfo;
+ struct addrinfo* it;
+
+ char* error = NULL;
+
+ addrInfo = resolve(getHostName().c_str(), getPort());
+
+ for (it = addrInfo; it != NULL; it = it->ai_next) {
+ sockFD = socket(it->ai_family, it->ai_socktype, it->ai_protocol);
+
+ if (sockFD == -1) {
+ continue;
+ }
+
+ if (connect(sockFD, it->ai_addr, it->ai_addrlen) == 0) {
+ break;
+ }
+
+ error = strerror(errno);
+
+ close(sockFD);
+ sockFD = -1;
+ }
+
+ freeaddrinfo(addrInfo);
+
+ if (sockFD == -1) {
+ // none succeeded
+ if (error != NULL) {
+ throw ConnectionError("Failed to connect to " + URL + ": " + error);
+ }
+ else {
+ throw ConnectionError("Failed to connect to " + URL);
+ }
+ }
+
+ channel = new CoasterChannel(this, loop, handlerFactory);
+ channel->setSockFD(sockFD);
+ channel->start();
+ loop->addChannel(channel);
+
+ started = true;
+}
+
+void CoasterClient::stop() {
+ if (!started) {
+ return;
+ }
+
+ channel->shutdown();
+ loop->removeChannel(channel);
+ close(sockFD);
+
+ delete channel;
+
+ started = false;
+}
+
+void CoasterClient::submit(Job& job) {
+ { Lock::Scoped l(lock);
+ jobs[&job.getIdentity()] = &job;
+ }
+ JobSubmitCommand* sjc = new JobSubmitCommand(&job);
+ sjc->send(channel, this);
+}
+
+void CoasterClient::errorReceived(Command* cmd, string* message, string* details) {
+ if (*(cmd->getName()) == JobSubmitCommand::NAME) {
+ JobSubmitCommand* jsc = static_cast<JobSubmitCommand*>(cmd);
+ updateJobStatus(jsc->getJob()->getIdentity(), new JobStatus(FAILED, message, details));
+ }
+ else {
+ LogWarn << "Error received for command " << cmd;
+ if (message != NULL) {
+ LogWarn << ": " << message;
+ }
+ if (details != NULL) {
+ LogWarn << "\n" << message;
+ }
+ LogWarn << endl;
+ }
+
+ delete cmd;
+}
+
+void CoasterClient::replyReceived(Command* cmd) {
+ if (*(cmd->getName()) == JobSubmitCommand::NAME) {
+ JobSubmitCommand* jsc = static_cast<JobSubmitCommand*>(cmd);
+ updateJobStatus(jsc->getJob()->getIdentity(), new JobStatus(SUBMITTED));
+ }
+ delete cmd;
+}
+
+void CoasterClient::updateJobStatus(string& jobId, JobStatus* status) { Lock::Scoped l(lock);
+ if (jobs.count(&jobId) == 0) {
+ LogWarn << "Received job status notification for unknown job (" << jobId << "): " << status << endl;
+ }
+ else {
+ Job* job = jobs[&jobId];
+ job->setStatus(status);
+ if (status->isTerminal()) {
+ jobs.erase(&jobId);
+ doneJobs.push_back(job);
+ cv.broadcast();
+ }
+ }
+}
+
+int CoasterClient::getPort() {
+ size_t index;
+
+ index = URL.find(':');
+ if (index == string::npos) {
+ // default port
+ return 1984;
+ }
+ else {
+ return atoi(URL.substr(index).c_str());
+ }
+}
+
+string CoasterClient::getHostName() {
+ size_t index;
+
+ index = URL.find(':');
+ if (index == string::npos) {
+ return URL;
+ }
+ else {
+ return URL.substr(0, index);
+ }
+}
+
+struct addrinfo* CoasterClient::resolve(const char* hostName, int port) {
+ struct addrinfo hints;
+ struct addrinfo* info;
+
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_INET;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = 0;
+ hints.ai_protocol = 0;
+
+ char* sPort = (char *) malloc(sizeof(int) * 8 + 1);
+ sprintf(sPort, "%d", port);
+
+ int result = getaddrinfo(hostName, sPort, &hints, &info);
+
+ if (result != 0) {
+ throw ConnectionError(string("Host name lookup failure: ") + gai_strerror(result));
+ }
+
+ free(sPort);
+
+ return info;
+}
+
+/**
+ * Retrieve the list of completed/failed/canceled jobs. If no more jobs
+ * finish after this call, a subsequent call to this method will return
+ * NULL. It's the caller's responsibility to delete the returned list.
+ */
+list<Job*>* CoasterClient::getAndPurgeDoneJobs() { Lock::Scoped l(lock);
+ if (doneJobs.size() == 0) {
+ return NULL;
+ }
+ else {
+ list<Job*>* l = new list<Job*>(doneJobs);
+ doneJobs.clear();
+ return l;
+ }
+}
+
+void CoasterClient::waitForJobs() { Lock::Scoped l(lock);
+ while (jobs.size() != 0) {
+ cv.wait(lock);
+ }
+}
+
+void CoasterClient::waitForJob(Job& job) { Lock::Scoped l(lock);
+ while (jobs.count(&(job.getIdentity())) != 0) {
+ cv.wait(lock);
+ }
+}
+
+string& CoasterClient::getURL() {
+ return URL;
+}
Index: modules/provider-coaster-c-client/src/CoasterClientTest.cpp
===================================================================
--- modules/provider-coaster-c-client/src/CoasterClientTest.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/CoasterClientTest.cpp (revision 3460)
@@ -0,0 +1,43 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <list>
+
+#include "CoasterLoop.h"
+#include "CoasterClient.h"
+#include "Job.h"
+
+using namespace std;
+
+int main(void) {
+ try {
+ CoasterLoop loop = CoasterLoop();
+ loop.start();
+
+ CoasterClient client("localhost:1984", loop);
+ client.start();
+
+ Job j1("/bin/date");
+ Job j2("/bin/echo");
+ j2.addArgument("testing");
+ j2.addArgument("1, 2, 3");
+
+ client.submit(j1);
+ client.submit(j2);
+
+ client.waitForJob(j1);
+ client.waitForJob(j2);
+ list<Job*>* doneJobs = client.getAndPurgeDoneJobs();
+
+ printf("All done\n");
+
+ client.stop();
+ loop.stop();
+
+ return EXIT_SUCCESS;
+ }
+ catch (exception& e) {
+ cerr << "Exception caught: " << e.what() << endl;
+ return EXIT_FAILURE;
+ }
+}
Index: modules/provider-coaster-c-client/src/CoasterLoop.h
===================================================================
--- modules/provider-coaster-c-client/src/CoasterLoop.h (revision 0)
+++ modules/provider-coaster-c-client/src/CoasterLoop.h (revision 3460)
@@ -0,0 +1,70 @@
+/*
+ * coaster-loop.h
+ *
+ * Created on: Jun 9, 2012
+ * Author: mike
+ */
+
+#ifndef COASTER_LOOP_H_
+#define COASTER_LOOP_H_
+
+#include "CoasterChannel.h"
+#include "Lock.h"
+#include <map>
+#include <list>
+#include <pthread.h>
+#include <sys/select.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <ctime>
+#include <stdio.h>
+
+// 1 minute
+#define HEARTBEAT_CHECK_INTERVAL 60
+
+using namespace std;
+
+class CoasterLoop {
+ private:
+ pthread_t thread;
+
+ map<int, CoasterChannel*> channelMap;
+ list<CoasterChannel*> addList;
+ list<CoasterChannel*> removeList;
+
+ int wakePipe[2];
+ fd_set rfds, wfds;
+ int socketCount;
+ int maxFD;
+
+ void updateMaxFD();
+ void acknowledgeWake();
+
+ time_t lastHeartbeatCheck;
+ public:
+ bool started;
+ bool done;
+ Lock lock;
+
+ CoasterLoop();
+ void start();
+ void stop();
+
+ void addChannel(CoasterChannel* channel);
+ void removeChannel(CoasterChannel* channel);
+ void addSockets();
+ void removeSockets();
+ void awake();
+ fd_set* getReadFDs();
+ fd_set* getWriteFDs();
+ int getMaxFD();
+ bool readSockets(fd_set* fds);
+ void writeSockets(fd_set* fds);
+ int getWakePipeReadFD();
+
+ void requestWrite(CoasterChannel* channel);
+
+ void checkHeartbeats();
+};
+
+#endif /* COASTER_LOOP_H_ */
Index: modules/provider-coaster-c-client/src/ConditionVariable.h
===================================================================
--- modules/provider-coaster-c-client/src/ConditionVariable.h (revision 0)
+++ modules/provider-coaster-c-client/src/ConditionVariable.h (revision 3460)
@@ -0,0 +1,25 @@
+/*
+ * ConditionVariable.h
+ *
+ * Created on: Sep 7, 2012
+ * Author: mike
+ */
+
+#ifndef CONDITIONVARIABLE_H_
+#define CONDITIONVARIABLE_H_
+
+#include <pthread.h>
+#include "Lock.h"
+
+class ConditionVariable {
+ private:
+ pthread_cond_t cv;
+ public:
+ ConditionVariable();
+ virtual ~ConditionVariable();
+ void wait(Lock& lock);
+ void signal();
+ void broadcast();
+};
+
+#endif /* CONDITIONVARIABLE_H_ */
Index: modules/provider-coaster-c-client/src/HeartBeatCommand.h
===================================================================
--- modules/provider-coaster-c-client/src/HeartBeatCommand.h (revision 0)
+++ modules/provider-coaster-c-client/src/HeartBeatCommand.h (revision 3460)
@@ -0,0 +1,29 @@
+/*
+ * HeartBeatCommand.h
+ *
+ * Created on: Sep 5, 2012
+ * Author: mike
+ */
+
+#ifndef HEARTBEATCOMMAND_H_
+#define HEARTBEATCOMMAND_H_
+
+#include "Command.h"
+#include <sys/time.h>
+#include <string>
+
+using namespace std;
+
+class HeartBeatCommand: public Command {
+ private:
+ long sendtime;
+ public:
+ static string NAME;
+ HeartBeatCommand();
+ virtual ~HeartBeatCommand();
+ void send(CoasterChannel* channel, CommandCallback* cb);
+ virtual void dataSent(Buffer* buf);
+ virtual void replyReceived();
+};
+
+#endif /* HEARTBEATCOMMAND_H_ */
Index: modules/provider-coaster-c-client/src/ClientHandlerFactory.cpp
===================================================================
--- modules/provider-coaster-c-client/src/ClientHandlerFactory.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/ClientHandlerFactory.cpp (revision 3460)
@@ -0,0 +1,17 @@
+/*
+ * ClientHandlerFactory.cpp
+ *
+ * Created on: Aug 31, 2012
+ * Author: mike
+ */
+
+#include "ClientHandlerFactory.h"
+#include "JobStatusHandler.h"
+
+ClientHandlerFactory::ClientHandlerFactory() {
+ addHandler<JobStatusHandler>("JOBSTATUS");
+}
+
+ClientHandlerFactory::~ClientHandlerFactory() {
+ // TODO Auto-generated destructor stub
+}
Index: modules/provider-coaster-c-client/src/RequestReply.cpp
===================================================================
--- modules/provider-coaster-c-client/src/RequestReply.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/RequestReply.cpp (revision 3460)
@@ -0,0 +1,116 @@
+/*
+ * RequestReply.cpp
+ *
+ * Created on: Aug 30, 2012
+ * Author: mike
+ */
+
+#include "RequestReply.h"
+#include "CoasterError.h"
+
+#include <sstream>
+
+using namespace std;
+
+RequestReply::RequestReply() {
+ channel = NULL;
+}
+
+RequestReply::~RequestReply() {
+ clearBufferVector(inData);
+ clearBufferVector(outData);
+ clearBufferVector(*errorData);
+ delete errorData;
+}
+
+void RequestReply::clearBufferVector(vector<Buffer*>& v) {
+ vector<Buffer*>::iterator i;
+
+ for (i = v.begin(); i != v.end(); i++) {
+ delete *i;
+ }
+}
+
+void RequestReply::setChannel(CoasterChannel* pchannel) {
+ channel = pchannel;
+}
+
+CoasterChannel* RequestReply::getChannel() {
+ return channel;
+}
+
+void RequestReply::setTag(int ptag) {
+ tag = ptag;
+}
+
+int RequestReply::getTag() {
+ return tag;
+}
+
+void RequestReply::addOutData(Buffer* buf) {
+ outData.push_back(buf);
+}
+
+void RequestReply::addInData(Buffer* buf) {
+ inData.push_back(buf);
+}
+
+void RequestReply::getInDataAsString(int index, string& dest) {
+ Buffer* buf = getInData()->at(index);
+ dest.assign(buf->getData(), buf->getLen());
+}
+
+int RequestReply::getInDataAsInt(int index) {
+ return getInData()->at(index)->getInt(0);
+}
+
+long RequestReply::getInDataAsLong(int index) {
+ return getInData()->at(index)->getLong(0);
+}
+
+void RequestReply::addErrorData(Buffer* buf) {
+ if (errorData == NULL) {
+ errorData = new vector<Buffer*>;
+ }
+ errorData->push_back(buf);
+}
+
+vector<Buffer*>* RequestReply::getOutData() {
+ return &outData;
+}
+
+vector<Buffer*>* RequestReply::getInData() {
+ return &inData;
+}
+
+vector<Buffer*>* RequestReply::getErrorData() {
+ return errorData;
+}
+
+void RequestReply::dataReceived(Buffer* buf, int flags) {
+ if (flags & FLAG_ERROR != 0) {
+ addErrorData(buf);
+ }
+ else {
+ addInData(buf);
+ }
+}
+
+void RequestReply::signalReceived(Buffer* buf) {
+ throw CoasterError("Unhandled signal: " + string(buf->getData(), buf->getLen()));
+}
+
+string RequestReply::getErrorString() {
+ if (errorData == NULL) {
+ return "";
+ }
+ else {
+ stringstream ss;
+ vector<Buffer*>::iterator it;
+
+ for (it = errorData->begin(); it != errorData->end(); it++) {
+ ss << (*it) << '\n';
+ }
+ return ss.str();
+ }
+}
Index: modules/provider-coaster-c-client/src/HandlerFactory.h
===================================================================
--- modules/provider-coaster-c-client/src/HandlerFactory.h (revision 0)
+++ modules/provider-coaster-c-client/src/HandlerFactory.h (revision 3460)
@@ -0,0 +1,30 @@
+/*
+ * HandlerFactory.h
+ *
+ * Created on: Aug 28, 2012
+ * Author: mike
+ */
+
+#ifndef HANDLERFACTORY_H_
+#define HANDLERFACTORY_H_
+
+#include <map>
+#include <string>
+#include "Handler.h"
+
+using namespace std;
+
+class Handler;
+
+class HandlerFactory {
+ private:
+ map<string, Handler*(*)()> creators;
+ public:
+ HandlerFactory();
+ virtual ~HandlerFactory();
+ template<typename T> void addHandler(string name);
+ Handler* newInstance(string& name);
+ Handler* newInstance(const string* name);
+};
+
+#endif /* HANDLERFACTORY_H_ */
Index: modules/provider-coaster-c-client/src/JobStatus.cpp
===================================================================
--- modules/provider-coaster-c-client/src/JobStatus.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/JobStatus.cpp (revision 3460)
@@ -0,0 +1,105 @@
+/*
+ * job-status.c
+ *
+ * Created on: Jun 9, 2012
+ * Author: mike
+ */
+
+#include <stdlib.h>
+#include <time.h>
+#include "JobStatus.h"
+
+JobStatus::JobStatus(JobStatusCode pstatusCode, time_t ptime, const string* pmessage, const string* pexception) {
+ statusCode = pstatusCode;
+ stime = ptime;
+ // always copy strings because the job status' lifetime is weird
+ if (pmessage != NULL) {
+ message = new string(*pmessage);
+ }
+ else {
+ message = NULL;
+ }
+ if (pexception != NULL) {
+ exception = new string(*pexception);
+ }
+ else {
+ exception = NULL;
+ }
+}
+
+JobStatus::JobStatus(JobStatusCode pstatusCode, const string* pmessage, const string* pexception) {
+ JobStatus(pstatusCode, time(NULL), pmessage, pexception);
+}
+
+JobStatus::JobStatus(JobStatusCode pstatusCode) {
+ JobStatus(pstatusCode, NULL, NULL);
+}
+
+JobStatus::JobStatus() {
+ JobStatus(UNSUBMITTED);
+}
+
+JobStatusCode JobStatus::getStatusCode() {
+ return statusCode;
+}
+
+time_t JobStatus::getTime() {
+ return stime;
+}
+
+string* JobStatus::getMessage() {
+ return message;
+}
+
+string* JobStatus::getException() {
+ return exception;
+}
+
+void JobStatus::setPreviousStatus(JobStatus* pprev) {
+ prev = pprev;
+}
+
+const JobStatus* JobStatus::getPreviousStatus() {
+ return prev;
+}
+
+bool JobStatus::isTerminal() {
+ return statusCode == COMPLETED || statusCode == CANCELED || statusCode == FAILED;
+}
+
+JobStatus::~JobStatus() {
+ if (prev != NULL) {
+ delete prev;
+ }
+}
+
+static const char* statusCodeToStr(JobStatusCode code) {
+ switch (code) {
+ case UNSUBMITTED: return "UNSUBMITTED";
+ case SUBMITTING: return "SUBMITTING";
+ case SUBMITTED: return "SUBMITTED";
+ case ACTIVE: return "ACTIVE";
+ case SUSPENDED: return "SUSPENDED";
+ case RESUMED: return "RESUMED";
+ case FAILED: return "FAILED";
+ case CANCELED: return "CANCELED";
+ case COMPLETED: return "COMPLETED";
+ case STAGE_IN: return "STAGE_IN";
+ case STAGE_OUT: return "STAGE_OUT";
+ default: return "UNKNWON";
+ }
+}
+
+ostream& operator<< (ostream& os, JobStatus& s) {
+ return os << &s;
+}
+
+ostream& operator<< (ostream& os, JobStatus* s) {
+ os << "Status(" << statusCodeToStr(s->getStatusCode());
+ if (s->getMessage()->length() != 0) {
+ os << ", msg: " << s->getMessage();
+ }
+ os << ")";
+ return os;
+}
+
Index: modules/provider-coaster-c-client/src/Buffer.h
===================================================================
--- modules/provider-coaster-c-client/src/Buffer.h (revision 0)
+++ modules/provider-coaster-c-client/src/Buffer.h (revision 3460)
@@ -0,0 +1,67 @@
+/*
+ * Buffer.h
+ *
+ * Created on: Aug 30, 2012
+ * Author: mike
+ */
+
+#ifndef BUFFER_H_
+#define BUFFER_H_
+
+#include <string>
+#include <ostream>
+#include <stdexcept>
+
+using namespace std;
+
+class Buffer {
+ protected:
+ int len;
+ public:
+ Buffer(int plen);
+ int getLen() const;
+ virtual const char* getData();
+ virtual char* getModifiableData();
+ virtual void setData(const char* data);
+ virtual ~Buffer();
+
+ virtual string* str();
+
+ int getInt(int index);
+ long getLong(int index);
+ void putInt(int index, int value);
+ void putLong(int index, long value);
+
+
+ static Buffer* wrap(int i);
+ static Buffer* wrap(long l);
+ static Buffer* wrap(const char* buf, int len);
+ static Buffer* wrap(string s);
+ static Buffer* wrap(const string* s);
+};
+
+class StaticBuffer: public Buffer {
+ private:
+ const char* data;
+ public:
+ StaticBuffer(int plen);
+ virtual ~StaticBuffer();
+
+ virtual const char* getData();
+ virtual void setData(const char* data);
+};
+
+class DynamicBuffer: public Buffer {
+ private:
+ char* data;
+ public:
+ DynamicBuffer(int plen);
+ virtual ~DynamicBuffer();
+
+ virtual const char* getData();
+ virtual char* getModifiableData();
+
+ friend ostream& operator<< (ostream& os, Buffer& buf);
+};
+
+#endif /* BUFFER_H_ */
Index: modules/provider-coaster-c-client/src/Job.h
===================================================================
--- modules/provider-coaster-c-client/src/Job.h (revision 0)
+++ modules/provider-coaster-c-client/src/Job.h (revision 3460)
@@ -0,0 +1,90 @@
+/*
+ * job-description.h
+ *
+ * Created on: Jun 9, 2012
+ * Author: mike
+ */
+
+#ifndef JOB_H_
+#define JOB_H_
+
+#include "StagingSetEntry.h"
+#include "JobStatus.h"
+#include <string>
+#include <vector>
+#include <map>
+
+using namespace std;
+
+class Job {
+ private:
+ string identity;
+ string executable;
+ vector<string*>* arguments;
+ string* directory;
+ string* stdinLocation;
+ string* stdoutLocation;
+ string* stderrLocation;
+ string* jobManager;
+
+ map<string, string>* env;
+ map<string, string>* attributes;
+ vector<StagingSetEntry>* stageIns;
+ vector<StagingSetEntry>* stageOuts;
+ vector<string>* cleanups;
+
+ string* stdout;
+ string* stderr;
+ JobStatus* status;
+ public:
+ Job(string executable);
+ virtual ~Job();
+
+ string& getExecutable();
+
+ string& getIdentity();
+
+ vector<string*>* getArguments();
+ void addArgument(string& arg);
+ void addArgument(const char* arg);
+
+ string* getDirectory();
+ void setDirectory(string& directory);
+
+ string* getStdinLocation();
+ void setStdinLocation(string& loc);
+
+ string* getStdoutLocation();
+ void setStdoutLocation(string& loc);
+
+ string* getStderrLocation();
+ void setStderrLocation(string& loc);
+
+ string* getJobManager();
+ void setJobManager(string& jm);
+
+ map<string, string>* getEnv();
+ string* getEnv(string name);
+ void setEnv(string name, string value);
+
+ map<string, string>* getAttributes();
+ string* getAttribute(string name);
+ void setAttribute(string name, string value);
+
+ vector<StagingSetEntry>* getStageIns();
+ void addStageIn(string src, string dest, StagingMode mode);
+
+ vector<StagingSetEntry>* getStageOuts();
+ void addStageOut(string src, string dest, StagingMode mode);
+
+ vector<string>* getCleanups();
+ void addCleanup(string cleanup);
+
+ string* getStderr();
+ string* getStdout();
+
+ JobStatus* getStatus();
+ void setStatus(JobStatus* status);
+};
+
+#endif /* JOB_DESCRIPTION_H_ */
Index: modules/provider-coaster-c-client/src/CoasterError.h
===================================================================
--- modules/provider-coaster-c-client/src/CoasterError.h (revision 0)
+++ modules/provider-coaster-c-client/src/CoasterError.h (revision 3460)
@@ -0,0 +1,30 @@
+/*
+ * CoasterError.h
+ *
+ * Created on: Aug 26, 2012
+ * Author: mike
+ */
+
+#ifndef COASTERERROR_H_
+#define COASTERERROR_H_
+
+#include <string>
+#include <stdarg.h>
+#include <stdio.h>
+#include <sstream>
+
+#define MAX_MSG_LEN 256
+
+using namespace std;
+
+class CoasterError: public exception {
+ private:
+ const char* message;
+ public:
+ CoasterError(string msg);
+ CoasterError(const char* format, ...);
+ CoasterError(const stringstream* ss);
+ virtual const char* what() const throw();
+};
+
+#endif /* COASTERERROR_H_ */
Index: modules/provider-coaster-c-client/src/Logger.cpp
===================================================================
--- modules/provider-coaster-c-client/src/Logger.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/Logger.cpp (revision 3460)
@@ -0,0 +1,131 @@
+/*
+ * Logger.cpp
+ *
+ * Created on: Aug 13, 2012
+ * Author: mike
+ */
+
+#include "Logger.h"
+#include <string.h>
+#include <sys/time.h>
+#include <time.h>
+
+Logger::Logger(ostream& pout) {
+ out = &pout;
+ level = NONE;
+ setFile("<unknown>");
+ flushed = true;
+}
+
+Logger::~Logger() {
+}
+
+Logger& Logger::operator<< (Level plevel) {
+ setLevel(plevel);
+ return *this;
+}
+
+void Logger::setLevel(Level plevel) {
+ level = plevel;
+ strLevel = levelToStr(level);
+}
+
+const char* Logger::levelToStr(Level level) {
+ switch (level) {
+ case NONE:
+ return "NONE ";
+ case ERROR:
+ return "ERROR";
+ case WARN:
+ return "WARN ";
+ case INFO:
+ return "INFO ";
+ case DEBUG:
+ return "DEBUG";
+ default:
+ return "?????";
+ }
+}
+
+Logger& Logger::operator<< (string str) {
+ header();
+ *out << str << '\n';
+ return *this;
+}
+
+Logger& Logger::operator<< (const string* str) {
+ header();
+ *out << *str << '\n';
+ return *this;
+}
+
+Logger& Logger::operator<< (const char* str) {
+ header();
+ *out << str << '\n';
+ return *this;
+}
+
+Logger& Logger::operator<< (ostream& ( *pf )(ostream&)) {
+ (*pf)(*this);
+ return *this;
+}
+
+Logger& Logger::setFile(const char* pfile) {
+ file = strrchr(pfile, '/');
+ if (file == NULL) {
+ file = pfile;
+ }
+ return *this;
+}
+
+Logger& Logger::flush() {
+ ostream::flush();
+ flushed = true;
+ return *this;
+}
+
+void Logger::log(Level level, const char* fileName, const char* msg) {
+ setLevel(level);
+ setFile(fileName);
+ header();
+ *out << msg << endl;
+}
+void Logger::log(Level level, const char* fileName, string msg) {
+ setLevel(level);
+ setFile(fileName);
+ header();
+ *out << msg << endl;
+}
+
+char* Logger::timeStamp() {
+ timeval tv;
+ tm *tm;
+ char fmt[TS_LEN + 10];
+
+ gettimeofday(&tv, NULL);
+ if((tm = localtime(&tv.tv_sec)) != NULL) {
+ strftime(fmt, sizeof(fmt), "%Y-%m-%d %H:%M:%S.%%03u%z", tm);
+ snprintf(ts, sizeof(ts), fmt, tv.tv_usec / 1000);
+ }
+
+ return ts;
+}
+
+void Logger::header() {
+ if (flushed) {
+ *out << timeStamp() << " " << strLevel << " " << file << " ";
+ flushed = false;
+ }
+}
+
+StdoutLogger::StdoutLogger(): Logger(cout) {
+}
+
+StdoutLogger::~StdoutLogger() {
+}
+
+Logger& Logger::singleton() {
+ return *Logger::instance;
+}
+
+Logger* Logger::instance = new StdoutLogger();
Index: modules/provider-coaster-c-client/src/JobStatusHandler.h
===================================================================
--- modules/provider-coaster-c-client/src/JobStatusHandler.h (revision 0)
+++ modules/provider-coaster-c-client/src/JobStatusHandler.h (revision 3460)
@@ -0,0 +1,21 @@
+/*
+ * JobStatusHandler.h
+ *
+ * Created on: Aug 31, 2012
+ * Author: mike
+ */
+
+#ifndef JOBSTATUSHANDLER_H_
+#define JOBSTATUSHANDLER_H_
+
+#include "Handler.h"
+#include "JobStatus.h"
+
+class JobStatusHandler: public Handler {
+ public:
+ JobStatusHandler();
+ virtual ~JobStatusHandler();
+ virtual void requestReceived();
+};
+
+#endif /* JOBSTATUSHANDLER_H_ */
Index: modules/provider-coaster-c-client/src/Handler.h
===================================================================
--- modules/provider-coaster-c-client/src/Handler.h (revision 0)
+++ modules/provider-coaster-c-client/src/Handler.h (revision 3460)
@@ -0,0 +1,32 @@
+/*
+ * handler.h
+ *
+ * Created on: Jun 9, 2012
+ * Author: mike
+ */
+
+#ifndef HANDLER_H_
+#define HANDLER_H_
+
+#include "CoasterChannel.h"
+#include "RequestReply.h"
+
+class CoasterChannel;
+
+class Handler: public RequestReply {
+ protected:
+ virtual void sendReply(string& reply);
+ virtual void sendReply(const char* reply);
+
+ public:
+ virtual void receiveCompleted(int flags);
+
+ virtual void errorReceived();
+ virtual void requestReceived();
+
+ virtual void send(CoasterChannel* channel);
+
+ virtual void dataSent(Buffer* buf);
+};
+
+#endif /* HANDLER_H_ */
Index: modules/provider-coaster-c-client/src/Command.h
===================================================================
--- modules/provider-coaster-c-client/src/Command.h (revision 0)
+++ modules/provider-coaster-c-client/src/Command.h (revision 3460)
@@ -0,0 +1,46 @@
+/*
+ * command.h
+ *
+ * Created on: Jun 9, 2012
+ * Author: mike
+ */
+
+#ifndef COMMAND_H_
+#define COMMAND_H_
+
+#include <list>
+#include <string>
+#include "RequestReply.h"
+#include "CoasterChannel.h"
+#include "Flags.h"
+#include "CommandCallback.h"
+
+using namespace std;
+
+class CoasterChannel;
+class CommandCallback;
+
+class Command: public RequestReply {
+ private:
+ const string* name;
+ CommandCallback* cb;
+ public:
+ Command(const string* pname);
+
+ const string* getName();
+
+ virtual void send(CoasterChannel* channel);
+ virtual void send(CoasterChannel* channel, CommandCallback* cb);
+
+ virtual void receiveCompleted(int flags);
+
+ virtual void errorReceived();
+ virtual void replyReceived();
+
+ virtual void dataSent(Buffer* buf);
+
+ friend ostream& operator<< (ostream& os, Command* cmd);
+};
+
+
+#endif /* COMMAND_H_ */
Index: modules/provider-coaster-c-client/src/ChannelCallback.cpp
===================================================================
--- modules/provider-coaster-c-client/src/ChannelCallback.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/ChannelCallback.cpp (revision 3460)
@@ -0,0 +1,14 @@
+/*
+ * ChannelCallback.cpp
+ *
+ * Created on: Aug 30, 2012
+ * Author: mike
+ */
+
+#include "ChannelCallback.h"
+
+ChannelCallback::ChannelCallback() {
+}
+
+ChannelCallback::~ChannelCallback() {
+}
Index: modules/provider-coaster-c-client/src/Lock.cpp
===================================================================
--- modules/provider-coaster-c-client/src/Lock.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/Lock.cpp (revision 3460)
@@ -0,0 +1,36 @@
+/*
+ * Lock.cpp
+ *
+ * Created on: Aug 28, 2012
+ * Author: mike
+ */
+
+#include "Lock.h"
+
+Lock::Lock() {
+ pthread_mutex_init(&l, NULL);
+}
+
+Lock::~Lock() {
+}
+
+void Lock::lock() {
+ pthread_mutex_lock(&l);
+}
+
+void Lock::unlock() {
+ pthread_mutex_unlock(&l);
+}
+
+pthread_mutex_t* Lock::getMutex() {
+ return &l;
+}
+
+Lock::Scoped::Scoped(Lock& plock) {
+ myLock = &plock;
+ myLock->lock();
+}
+
+Lock::Scoped::~Scoped() {
+ myLock->unlock();
+}
Index: modules/provider-coaster-c-client/src/CoasterChannel.cpp
===================================================================
--- modules/provider-coaster-c-client/src/CoasterChannel.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/CoasterChannel.cpp (revision 3460)
@@ -0,0 +1,320 @@
+/*
+ * coaster-channel.cpp
+ *
+ * Created on: Jun 9, 2012
+ * Author: mike
+ */
+
+#include "CoasterChannel.h"
+#include "CoasterError.h"
+#include "HeartBeatCommand.h"
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <sstream>
+
+using namespace std;
+
+int socksend(int fd, const char* buf, int len, int flags);
+
+class HeartBeatCommand;
+
+DataChunk::DataChunk() {
+ buf = NULL;
+ cb = NULL;
+ bufpos = 0;
+}
+
+DataChunk::DataChunk(Buffer* pbuf, ChannelCallback* pcb) {
+ buf = pbuf;
+ cb = pcb;
+ bufpos = 0;
+}
+
+void DataChunk::reset() {
+ bufpos = 0;
+}
+
+CoasterChannel::CoasterChannel(CoasterClient* pClient, CoasterLoop* pLoop, HandlerFactory* pHandlerFactory) {
+ sockFD = 0;
+ handlerFactory = pHandlerFactory;
+ tagSeq = rand() % 65536;
+ loop = pLoop;
+ client = pClient;
+
+ readState = READ_STATE_IDLE;
+
+ whdr.buf = new DynamicBuffer(HEADER_LENGTH);
+ rhdr.buf = new DynamicBuffer(HEADER_LENGTH);
+}
+
+CoasterChannel::~CoasterChannel() {
+ delete whdr.buf;
+ delete rhdr.buf;
+}
+
+ostream& operator<< (ostream& os, CoasterChannel* channel) {
+ os << "Channel[" << channel->getClient()->getURL() << "]";
+ return os;
+}
+
+
+void CoasterChannel::start() {
+ if (sockFD == 0) {
+ throw CoasterError("channel start() called but no socket set");
+ }
+}
+
+void CoasterChannel::shutdown() {
+
+}
+
+int CoasterChannel::getSockFD() {
+ return sockFD;
+}
+
+void CoasterChannel::setSockFD(int psockFD) {
+ sockFD = psockFD;
+}
+
+void CoasterChannel::read() {
+ switch(readState) {
+ case READ_STATE_IDLE:
+ break;
+ case READ_STATE_HDR:
+ if (read(&rhdr)) {
+ // full header read
+ msg.reset();
+ decodeHeader(&rtag, &rflags, &rlen);
+ msg.buf = new DynamicBuffer(rlen);
+ readState = READ_STATE_DATA;
+ }
+ else {
+ break;
+ }
+ case READ_STATE_DATA:
+ if (read(&msg)) {
+ // full message read
+ dispatchData();
+ rhdr.reset();
+ readState = READ_STATE_HDR;
+ }
+ break;
+ }
+}
+
+bool CoasterChannel::read(DataChunk* dc) {
+ int ret = recv(sockFD, dc->buf->getModifiableData(), (dc->buf->getLen() - dc->bufpos), MSG_DONTWAIT);
+ if (ret == -1) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ return false;
+ }
+ else {
+ throw CoasterError("Socket read error: %s", strerror(errno));
+ }
+ }
+ else {
+ dc->bufpos += ret;
+ if (dc->bufpos == dc->buf->getLen()) {
+ return true;
+ }
+ }
+}
+
+void CoasterChannel::dispatchData() {
+ if (rflags & FLAG_REPLY != 0) {
+ dispatchReply();
+ }
+ else {
+ dispatchRequest();
+ }
+}
+
+void CoasterChannel::dispatchReply() {
+ if (commands.count(rtag) == 0) {
+ throw new CoasterError("Received reply to unknown command (tag: %d)", rtag);
+ }
+ Command* cmd = commands[rtag];
+ if (rflags & FLAG_SIGNAL != 0) {
+ try {
+ cmd->signalReceived(msg.buf);
+ }
+ catch (exception &e) {
+ Logger::singleton() << endl;
+ LogWarn << endl;
+ LogWarn << "Command::signalReceived() threw exception: " << e.what() << endl;
+ }
+ catch (...) {
+ LogWarn << "Command::signalReceived() threw unknown exception" << endl;
+ }
+ }
+ else {
+ cmd->dataReceived(msg.buf, rflags);
+ if (rflags & FLAG_FINAL) {
+ unregisterCommand(cmd);
+ try {
+ cmd->receiveCompleted(rflags);
+ }
+ catch (exception &e) {
+ LogWarn << "Command::receiveCompleted() threw exception: " << e.what() << endl;
+ }
+ catch (...) {
+ LogWarn << "Command::receiveCompleted() threw unknown exception" << endl;
+ }
+ }
+ }
+}
+
+void CoasterChannel::dispatchRequest() {
+ if (handlers.count(rtag) == 0) {
+ // initial request
+ string* name = msg.buf->str();
+ Handler* h = handlerFactory->newInstance(name);
+ if (h == NULL) {
+ LogWarn << "Unknown handler: " << name << endl;
+ }
+ else {
+ registerHandler(rtag, h);
+ }
+ delete name;
+ }
+ else {
+ Handler* h = handlers[rtag];
+ if (rflags & FLAG_SIGNAL != 0) {
+ try {
+ h->signalReceived(msg.buf);
+ }
+ catch (exception &e) {
+ LogWarn << "Handler::signalReceived() threw exception: " << e.what() << endl;
+ }
+ catch (...) {
+ LogWarn << "Handler::signalReceived() threw unknown exception" << endl;
+ }
+ }
+ else {
+ h->dataReceived(msg.buf, rflags);
+ if (rflags & FLAG_FINAL) {
+ try{
+ h->receiveCompleted(rflags);
+ }
+ catch (exception &e) {
+ LogWarn << "Handler::receiveCompleted() threw exception: " << e.what() << endl;
+ }
+ catch (...) {
+ LogWarn << "Handler::receiveCompleted() threw unknown exception" << endl;
+ }
+ }
+ }
+ }
+}
+
+bool CoasterChannel::write() { Lock::Scoped l(writeLock);
+ DataChunk* dc = sendQueue.front();
+
+ Buffer* buf = dc->buf;
+
+ int ret = socksend(sockFD, buf->getData(), (buf->getLen() - dc->bufpos), MSG_DONTWAIT);
+ if (ret == -1) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ return false;
+ }
+ else {
+ throw CoasterError("Socket write error: %s", strerror(errno));
+ }
+ }
+ else {
+ dc->bufpos += ret;
+ if (dc->bufpos == buf->getLen()) {
+ sendQueue.pop_front();
+ if (dc->cb != NULL) {
+ try {
+ dc->cb->dataSent(buf);
+ }
+ catch (exception &e) {
+ LogWarn << "Callback threw exception: " << e.what() << endl;
+ }
+ catch (...) {
+ LogWarn << "Callback threw unknown exception" << endl;
+ }
+ }
+ }
+ return true;
+ }
+}
+
+void CoasterChannel::makeHeader(int tag, Buffer* buf, int flags) {
+ whdr.reset();
+ Buffer* hdr = whdr.buf;
+ hdr->putInt(0, tag);
+ hdr->putInt(4, flags);
+ hdr->putInt(8, buf->getLen());
+ hdr->putInt(12, tag ^ flags ^ buf->getLen());
+ hdr->putInt(16, 0);
+}
+
+void CoasterChannel::decodeHeader(int* tag, int* flags, int* len) {
+ Buffer* buf = rhdr.buf;
+ *tag = buf->getInt(0);
+ *flags = buf->getInt(4);
+ *len = buf->getInt(8);
+ int hcsum = buf->getInt(12);
+ int ccsum = *tag ^ *flags ^ *len;
+ if (hcsum != ccsum) {
+ throw CoasterError("Header checksum failed. Received checksum: %d, computed checksum: %d", hcsum, ccsum);
+ }
+}
+
+void CoasterChannel::registerCommand(Command* cmd) {
+ int tag = tagSeq++;
+ cmd->setTag(tag);
+ commands[tag] = cmd;
+}
+
+void CoasterChannel::unregisterCommand(Command* cmd) {
+ commands.erase(cmd->getTag());
+}
+
+void CoasterChannel::registerHandler(int tag, Handler* h) {
+ h->setTag(tag);
+ handlers[tag] = h;
+}
+
+void CoasterChannel::unregisterHandler(Handler* h) {
+ handlers.erase(h->getTag());
+}
+
+
+void CoasterChannel::send(int tag, Buffer* buf, int flags, ChannelCallback* cb) { Lock::Scoped l(writeLock);
+ makeHeader(tag, buf, flags);
+ sendQueue.push_back(&whdr);
+ sendQueue.push_back(new DataChunk(buf, cb));
+ loop->requestWrite(this);
+}
+
+CoasterClient* CoasterChannel::getClient() {
+ return client;
+}
+
+void CoasterChannel::checkHeartbeat() {
+ Command* cmd = new HeartBeatCommand();
+ cmd->send(this);
+}
+
+void CoasterChannel::errorReceived(Command* cmd, string* message, string* details) {
+ delete cmd;
+ LogWarn << "Heartbeat failed: " << message << endl;
+}
+
+void CoasterChannel::replyReceived(Command* cmd) {
+ delete cmd;
+}
+
+/*
+ * Without this, GCC gets confused by CoasterChannel::send.
+ */
+int socksend(int fd, const char* buf, int len, int flags) {
+ return send(fd, buf, len, flags);
+}
Index: modules/provider-coaster-c-client/src/CoasterLoop.cpp
===================================================================
--- modules/provider-coaster-c-client/src/CoasterLoop.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/CoasterLoop.cpp (revision 3460)
@@ -0,0 +1,239 @@
+/*
+ * coaster-loop.cpp
+ *
+ * Created on: Jun 9, 2012
+ * Author: mike
+ */
+
+#include "CoasterLoop.h"
+#include "CoasterError.h"
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+
+void* run(void* ptr);
+void checkSelectError(int ret);
+
+CoasterLoop::CoasterLoop() {
+ started = false;
+ done = false;
+ socketCount = 0;
+ FD_ZERO(&rfds);
+ FD_ZERO(&wfds);
+}
+
+void CoasterLoop::start() { Lock::Scoped l(lock);
+ if (started) {
+ return;
+ }
+
+ time(&lastHeartbeatCheck);
+
+ if (pipe2(wakePipe, O_NONBLOCK) != 0) {
+ throw CoasterError(string("Could not create pipe: ") + strerror(errno));
+ }
+ FD_SET(wakePipe[0], &rfds);
+
+ thread = pthread_create(&thread, NULL, run, this);
+
+ started = 1;
+}
+
+void CoasterLoop::stop() { Lock::Scoped l(lock);
+
+ if (!started) {
+ return;
+ }
+ done = 1;
+}
+
+void* run(void* ptr) {
+ struct timeval timeout;
+ CoasterLoop* loop = (CoasterLoop*) ptr;
+ fd_set myrfds, mywfds;
+ fd_set* rfds = loop->getReadFDs();
+ fd_set* wfds = loop->getWriteFDs();
+
+ while(1) {
+ { Lock::Scoped l(loop->lock);
+ if (loop->done) {
+ loop->started = false;
+ break;
+ }
+ loop->addSockets();
+ loop->removeSockets();
+ }
+
+ timeout.tv_sec = 0.1;
+ timeout.tv_usec = 0;
+
+ // fd sets are updated by select, so make new ones every time
+ memcpy(&myrfds, rfds, sizeof(myrfds));
+ int ret = select(loop->getMaxFD() + 1, &myrfds, NULL, NULL, &timeout);
+
+ checkSelectError(ret);
+
+ // can read or has data to write
+ // try to read from each socket
+ if (!loop->readSockets(&myrfds)) {
+ // no channel sockets had anything to read, so there is data to write
+ { Lock::Scoped l(loop->lock);
+ // synchronize when copying wfds since they are concurrently updated
+ // based on whether a channel has stuff to write or not
+ memcpy(&mywfds, wfds, sizeof(mywfds));
+ }
+
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 0;
+ // don't wait; just see if any sockets that need to be written to
+ // can be written to
+ int ret = select(loop->getMaxFD() + 1, NULL, &mywfds, NULL, &timeout);
+ checkSelectError(ret);
+ loop->writeSockets(&mywfds);
+ }
+ loop->checkHeartbeats();
+ }
+
+ return NULL;
+}
+
+bool CoasterLoop::readSockets(fd_set* fds) {
+ map<int, CoasterChannel*>::iterator it;
+
+ bool writePending = false;
+
+ for (it = channelMap.begin(); it != channelMap.end(); ++it) {
+ if (FD_ISSET(it->first, fds)) {
+ if (it->first == getWakePipeReadFD()) {
+ writePending = true;
+ }
+ else {
+ it->second->read();
+ }
+ }
+ }
+
+ return writePending;
+}
+
+void CoasterLoop::writeSockets(fd_set* fds) {
+ map<int, CoasterChannel*>::iterator it;
+
+ for (it = channelMap.begin(); it != channelMap.end(); ++it) {
+ if (FD_ISSET(it->first, fds)) {
+ if (it->second->write()) {
+ acknowledgeWake();
+ }
+ }
+ }
+}
+
+
+void checkSelectError(int ret) {
+ if (ret < 0) {
+ if (errno == EBADF) {
+ // at least one fd is invalid/has an error
+
+ }
+ else {
+ throw CoasterError(string("Error in select: ") + strerror(errno));
+ }
+ }
+}
+
+void CoasterLoop::addSockets() {
+ // must be called with lock held
+ list<CoasterChannel*>::iterator i;
+ for (i = addList.begin(); i != addList.end(); ++i) {
+ int sockFD = (*i)->getSockFD();
+ FD_SET(sockFD, &rfds);
+ channelMap[sockFD] = *i;
+ socketCount++;
+ }
+
+ updateMaxFD();
+
+ addList.clear();
+}
+
+void CoasterLoop::removeSockets() {
+ // must be called with lock held
+ list<CoasterChannel*>::iterator i;
+ for (i = removeList.begin(); i != removeList.end(); ++i) {
+ int sockFD = (*i)->getSockFD();
+ FD_CLR(sockFD, &rfds);
+ channelMap.erase(sockFD);
+ socketCount--;
+ }
+
+ updateMaxFD();
+
+ removeList.clear();
+}
+
+void CoasterLoop::addChannel(CoasterChannel* channel) { Lock::Scoped l(lock);
+ addList.push_back(channel);
+}
+
+void CoasterLoop::removeChannel(CoasterChannel* channel) { Lock::Scoped l(lock);
+ removeList.push_back(channel);
+}
+
+void CoasterLoop::awake() {
+ int result = write(wakePipe[1], "0", 1);
+}
+
+void CoasterLoop::acknowledgeWake() {
+ char buf[1];
+ int result = read(wakePipe[0], buf, 1);
+}
+
+fd_set* CoasterLoop::getReadFDs() {
+ return &rfds;
+}
+
+fd_set* CoasterLoop::getWriteFDs() {
+ return &wfds;
+}
+
+int CoasterLoop::getMaxFD() {
+ return maxFD;
+}
+
+void CoasterLoop::updateMaxFD() {
+ maxFD = getWakePipeReadFD();
+
+ map<int, CoasterChannel*>::iterator it;
+ for (it = channelMap.begin(); it != channelMap.end(); ++it) {
+ if (maxFD < it->first) {
+ maxFD = it->first;
+ }
+ }
+}
+
+int CoasterLoop::getWakePipeReadFD() {
+ return wakePipe[0];
+}
+
+void CoasterLoop::requestWrite(CoasterChannel* channel) { Lock::Scoped l(lock);
+ FD_SET(channel->getSockFD(), &wfds);
+ updateMaxFD();
+ awake();
+}
+
+void CoasterLoop::checkHeartbeats() {
+ time_t now;
+
+ time(&now);
+
+ if (now - lastHeartbeatCheck > HEARTBEAT_CHECK_INTERVAL) {
+ lastHeartbeatCheck = now;
+ { Lock::Scoped l(lock);
+ map<int, CoasterChannel*>::iterator it;
+ for (it = channelMap.begin(); it != channelMap.end(); ++it) {
+ it->second->checkHeartbeat();
+ }
+ }
+ }
+}
Index: modules/provider-coaster-c-client/src/ConditionVariable.cpp
===================================================================
--- modules/provider-coaster-c-client/src/ConditionVariable.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/ConditionVariable.cpp (revision 3460)
@@ -0,0 +1,28 @@
+/*
+ * ConditionVariable.cpp
+ *
+ * Created on: Sep 7, 2012
+ * Author: mike
+ */
+
+#include "ConditionVariable.h"
+
+ConditionVariable::ConditionVariable() {
+ pthread_cond_init(&cv, NULL);
+}
+
+ConditionVariable::~ConditionVariable() {
+ pthread_cond_destroy(&cv);
+}
+
+void ConditionVariable::wait(Lock& lock) {
+ pthread_cond_wait(&cv, lock.getMutex());
+}
+
+void ConditionVariable::signal() {
+ pthread_cond_signal(&cv);
+}
+
+void ConditionVariable::broadcast() {
+ pthread_cond_broadcast(&cv);
+}
Index: modules/provider-coaster-c-client/src/HeartBeatCommand.cpp
===================================================================
--- modules/provider-coaster-c-client/src/HeartBeatCommand.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/HeartBeatCommand.cpp (revision 3460)
@@ -0,0 +1,38 @@
+/*
+ * HeartBeatCommand.cpp
+ *
+ * Created on: Sep 5, 2012
+ * Author: mike
+ */
+
+#include "HeartBeatCommand.h"
+#include "Logger.h"
+#include <sstream>
+
+string HeartBeatCommand::NAME("HEARTBEAT");
+
+HeartBeatCommand::HeartBeatCommand(): Command(&NAME) {
+}
+
+HeartBeatCommand::~HeartBeatCommand() {
+}
+
+void HeartBeatCommand::send(CoasterChannel* channel, CommandCallback* cb) {
+ timeval now;
+
+ gettimeofday(&now, NULL);
+ sendtime = now.tv_sec * 1000 + now.tv_usec / 1000;
+ addOutData(new StaticBuffer(sendtime));
+
+ Command::send(channel, cb);
+}
+
+void HeartBeatCommand::dataSent(Buffer* buf) {
+ delete buf;
+}
+
+void HeartBeatCommand::replyReceived() {
+ long rectime = getInData()->at(0)->getLong(0);
+
+ LogInfo << "Latency for " << getChannel() << ": " << (rectime - sendtime) << endl;
+}
Index: modules/provider-coaster-c-client/src/StagingSetEntry.h
===================================================================
--- modules/provider-coaster-c-client/src/StagingSetEntry.h (revision 0)
+++ modules/provider-coaster-c-client/src/StagingSetEntry.h (revision 3460)
@@ -0,0 +1,30 @@
+/*
+ * StagingSetEntry.h
+ *
+ * Created on: Aug 11, 2012
+ * Author: mike
+ */
+
+#ifndef STAGINGSETENTRY_H_
+#define STAGINGSETENTRY_H_
+
+#include <string>
+
+using namespace std;
+
+enum StagingMode { ALWAYS = 1, IF_PRESENT = 2, ON_ERROR = 4, ON_SUCCESS = 8 };
+
+class StagingSetEntry {
+ private:
+ string source;
+ string destination;
+ StagingMode mode;
+ public:
+ StagingSetEntry(string source, string destination, StagingMode mode);
+ string getSource();
+ string getDestination();
+ StagingMode getMode();
+ virtual ~StagingSetEntry();
+};
+
+#endif /* STAGINGSETENTRY_H_ */
Index: modules/provider-coaster-c-client/src/CommandCallback.h
===================================================================
--- modules/provider-coaster-c-client/src/CommandCallback.h (revision 0)
+++ modules/provider-coaster-c-client/src/CommandCallback.h (revision 3460)
@@ -0,0 +1,25 @@
+/*
+ * CommandCallback.h
+ *
+ * Created on: Sep 7, 2012
+ * Author: mike
+ */
+
+#ifndef COMMANDCALLBACK_H_
+#define COMMANDCALLBACK_H_
+
+#include <string>
+#include "Command.h"
+
+class Command;
+
+using namespace std;
+
+class CommandCallback {
+ public:
+ virtual void errorReceived(Command* cmd, string* message, string* details) = 0;
+ virtual void replyReceived(Command* cmd) = 0;
+};
+
+
+#endif /* COMMANDCALLBACK_H_ */
Index: modules/provider-coaster-c-client/src/Flags.h
===================================================================
--- modules/provider-coaster-c-client/src/Flags.h (revision 0)
+++ modules/provider-coaster-c-client/src/Flags.h (revision 3460)
@@ -0,0 +1,16 @@
+/*
+ * Constants.h
+ *
+ * Created on: Aug 30, 2012
+ * Author: mike
+ */
+
+#ifndef CONSTANTS_H_
+#define CONSTANTS_H_
+
+#define FLAG_ERROR 0x04
+#define FLAG_REPLY 0x01
+#define FLAG_SIGNAL 0x10
+#define FLAG_FINAL 0x02
+
+#endif /* CONSTANTS_H_ */
Index: modules/provider-coaster-c-client/src/JobSubmitCommand.h
===================================================================
--- modules/provider-coaster-c-client/src/JobSubmitCommand.h (revision 0)
+++ modules/provider-coaster-c-client/src/JobSubmitCommand.h (revision 3460)
@@ -0,0 +1,26 @@
+#ifndef JOB_SUBMIT_COMMAND_H_
+#define JOB_SUBMIT_COMMAND_H_
+
+#include "Command.h"
+#include "CommandCallback.h"
+#include "Job.h"
+#include <vector>
+#include <string>
+#include "Buffer.h"
+
+using namespace std;
+
+class JobSubmitCommand: public Command {
+ private:
+ Job* job;
+
+ public:
+ static string NAME;
+ JobSubmitCommand(Job* job);
+ virtual void send(CoasterChannel* channel, CommandCallback* cb);
+ Job* getJob();
+ private:
+ void serialize();
+};
+
+#endif
Index: modules/provider-coaster-c-client/src/CoasterClient.h
===================================================================
--- modules/provider-coaster-c-client/src/CoasterClient.h (revision 0)
+++ modules/provider-coaster-c-client/src/CoasterClient.h (revision 3460)
@@ -0,0 +1,77 @@
+/*
+ * coaster-client.h
+ *
+ * Created on: Jun 9, 2012
+ * Author: mike
+ */
+
+#ifndef COASTER_CLIENT_H_
+#define COASTER_CLIENT_H_
+
+#include <string>
+#include "Lock.h"
+#include "ConditionVariable.h"
+#include "Command.h"
+#include "CoasterChannel.h"
+#include "CoasterLoop.h"
+#include "HandlerFactory.h"
+#include "Job.h"
+#include <list>
+#include <map>
+
+#include <netdb.h>
+
+using namespace std;
+
+class HandlerFactory;
+class CoasterLoop;
+class CoasterChannel;
+
+class ConnectionError: public exception {
+ private:
+ const char* message;
+ public:
+ ConnectionError(string msg);
+
+ virtual const char* what() const throw();
+};
+
+class CoasterClient: public CommandCallback {
+ private:
+ Lock lock;
+ ConditionVariable cv;
+ string URL;
+ CoasterChannel* channel;
+ bool started;
+
+ int sockFD;
+
+ int getPort();
+ string getHostName();
+ struct addrinfo* resolve(const char* hostName, int port);
+
+ CoasterLoop* loop;
+ HandlerFactory* handlerFactory;
+
+ map<const string*, Job*> jobs;
+ list<Job*> doneJobs;
+ public:
+ CoasterClient(string URL, CoasterLoop& loop);
+ void start();
+ void stop();
+
+ void submit(Job& job);
+ void waitForJob(Job& job);
+
+ list<Job*>* getAndPurgeDoneJobs();
+ void waitForJobs();
+
+ void updateJobStatus(string& jobId, JobStatus* status);
+
+ string& getURL();
+
+ void errorReceived(Command* cmd, string* message, string* details);
+ void replyReceived(Command* cmd);
+};
+
+#endif /* COASTER_CLIENT_H_ */
Index: modules/provider-coaster-c-client/src/HandlerFactory.cpp
===================================================================
--- modules/provider-coaster-c-client/src/HandlerFactory.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/HandlerFactory.cpp (revision 3460)
@@ -0,0 +1,38 @@
+/*
+ * HandlerFactory.cpp
+ *
+ * Created on: Aug 28, 2012
+ * Author: mike
+ */
+
+#include "HandlerFactory.h"
+
+HandlerFactory::HandlerFactory() {
+}
+
+HandlerFactory::~HandlerFactory() {
+}
+
+template<typename T> Handler * newHandler() { return new T; }
+
+template<typename T> void HandlerFactory::addHandler(string name) {
+ creators[name] = &newHandler<T>;
+}
+
+Handler* HandlerFactory::newInstance(string& name) {
+ if (creators.count(name) == 0) {
+ return NULL;
+ }
+ else {
+ return creators[name]();
+ }
+}
+
+Handler* HandlerFactory::newInstance(const string* name) {
+ if (creators.count(*name) == 0) {
+ return NULL;
+ }
+ else {
+ return creators[*name]();
+ }
+}
Index: modules/provider-coaster-c-client/src/RequestReply.h
===================================================================
--- modules/provider-coaster-c-client/src/RequestReply.h (revision 0)
+++ modules/provider-coaster-c-client/src/RequestReply.h (revision 3460)
@@ -0,0 +1,60 @@
+/*
+ * RequestReply.h
+ *
+ * Created on: Aug 30, 2012
+ * Author: mike
+ */
+
+#ifndef REQUESTREPLY_H_
+#define REQUESTREPLY_H_
+
+#include "ChannelCallback.h"
+#include "Buffer.h"
+#include "Flags.h"
+#include <vector>
+
+class CoasterChannel;
+
+using namespace std;
+
+class RequestReply: public ChannelCallback {
+ private:
+ CoasterChannel* channel;
+ vector<Buffer*> outData;
+ vector<Buffer*> inData;
+ vector<Buffer*>* errorData;
+
+ void clearBufferVector(vector<Buffer*>& v);
+
+ protected:
+ virtual void addOutData(Buffer*);
+ virtual void addInData(Buffer*);
+ virtual void addErrorData(Buffer*);
+
+ virtual vector<Buffer*>* getOutData();
+ virtual vector<Buffer*>* getErrorData();
+ virtual vector<Buffer*>* getInData();
+
+ int getInDataAsInt(int index);
+ long getInDataAsLong(int index);
+ void getInDataAsString(int index, string& dest);
+
+ string getErrorString();
+
+ int tag;
+ public:
+ RequestReply();
+ virtual ~RequestReply();
+
+ void setChannel(CoasterChannel* pchannel);
+ CoasterChannel* getChannel();
+
+ void setTag(int ptag);
+ int getTag();
+
+ virtual void dataReceived(Buffer*, int flags);
+ virtual void signalReceived(Buffer*);
+ virtual void receiveCompleted(int flags) = 0;
+};
+
+#endif /* REQUESTREPLY_H_ */
Index: modules/provider-coaster-c-client/src/ClientHandlerFactory.h
===================================================================
--- modules/provider-coaster-c-client/src/ClientHandlerFactory.h (revision 0)
+++ modules/provider-coaster-c-client/src/ClientHandlerFactory.h (revision 3460)
@@ -0,0 +1,19 @@
+/*
+ * ClientHandlerFactory.h
+ *
+ * Created on: Aug 31, 2012
+ * Author: mike
+ */
+
+#ifndef CLIENTHANDLERFACTORY_H_
+#define CLIENTHANDLERFACTORY_H_
+
+#include "HandlerFactory.h"
+
+class ClientHandlerFactory: public HandlerFactory {
+ public:
+ ClientHandlerFactory();
+ virtual ~ClientHandlerFactory();
+};
+
+#endif /* CLIENTHANDLERFACTORY_H_ */
Index: modules/provider-coaster-c-client/src/Buffer.cpp
===================================================================
--- modules/provider-coaster-c-client/src/Buffer.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/Buffer.cpp (revision 3460)
@@ -0,0 +1,161 @@
+/*
+ * Buffer.cpp
+ *
+ * Created on: Aug 30, 2012
+ * Author: mike
+ */
+
+#include "Buffer.h"
+#include <stdlib.h>
+
+Buffer::Buffer(int plen) {
+ len = plen;
+}
+
+int Buffer::getLen() const {
+ return len;
+}
+
+const char* Buffer::getData() {
+ return NULL;
+}
+
+char* Buffer::getModifiableData() {
+ throw logic_error("putInt called on static buffer");
+}
+
+void Buffer::setData(const char* pdata) {
+ throw logic_error("illegal operation: Buffer::setData()");
+}
+
+Buffer::~Buffer() {
+}
+
+string* Buffer::str() {
+ return new string(getData(), getLen());
+}
+
+int Buffer::getInt(int index) {
+ if (index + 4 > getLen()) {
+ throw out_of_range("getInt index out of range");
+ }
+ const char* buf = getData();
+ int value = 0;
+ index += 3;
+ for (int i = 0; i < 4; i++) {
+ value <<= 8;
+ value = value + (0x000000ff & buf[index--]);
+ }
+
+ return value;
+}
+
+long Buffer::getLong(int index) {
+ if (index + 8 > getLen()) {
+ throw out_of_range("getLong index out of range");
+ }
+ const char* buf = getData();
+ long value = 0;
+ index += 7;
+ for (int i = 0; i < 8; i++) {
+ value <<= 8;
+ value = value + (0x00000000000000ffL & buf[index--]);
+ }
+
+ return value;
+}
+
+void Buffer::putInt(int index, int value) {
+ if (index + 4 > getLen()) {
+ throw out_of_range("putInt index out of range");
+ }
+ char* buf = getModifiableData();
+ for (int i = 0; i < 4; i++) {
+ buf[index++] = value & 0x000000ff;
+ value >>= 8;
+ }
+}
+
+void Buffer::putLong(int index, long value) {
+ if (index + 8 > getLen()) {
+ throw out_of_range("putLong index out of range");
+ }
+ char* buf = getModifiableData();
+ for (int i = 0; i < 8; i++) {
+ buf[index++] = value & 0x00000000000000ffL;
+ value >>= 8;
+ }
+}
+
+Buffer* Buffer::wrap(int i) {
+ DynamicBuffer* b = new DynamicBuffer(4);
+ b->putInt(0, i);
+ return b;
+}
+
+Buffer* Buffer::wrap(long l) {
+ DynamicBuffer* b = new DynamicBuffer(8);
+ b->putLong(0, l);
+ return b;
+}
+
+Buffer* Buffer::wrap(const char* data, int len) {
+ StaticBuffer* b = new StaticBuffer(len);
+ b->setData(data);
+ return b;
+}
+
+Buffer* Buffer::wrap(string s) {
+ StaticBuffer* b = new StaticBuffer(s.length());
+ b->setData(s.data());
+ return b;
+}
+
+Buffer* Buffer::wrap(const string* s) {
+ StaticBuffer* b = new StaticBuffer(s->length());
+ b->setData(s->data());
+ return b;
+}
+
+ostream& operator<< (ostream& os, Buffer& buf) {
+ const char* data = buf.getData();
+ int len = buf.getLen();
+
+ for (int i = 0; i < len; i++) {
+ os.put(data[i]);
+ }
+
+ return os;
+}
+
+StaticBuffer::StaticBuffer(int plen): Buffer(plen) {
+}
+
+const char* StaticBuffer::getData() {
+ return data;
+}
+
+void StaticBuffer::setData(const char* pdata) {
+ data = pdata;
+}
+
+StaticBuffer::~StaticBuffer() {
+}
+
+DynamicBuffer::DynamicBuffer(int plen): Buffer(plen) {
+ data = (char *) malloc(len);
+}
+
+
+const char* DynamicBuffer::getData() {
+ return data;
+}
+
+char* DynamicBuffer::getModifiableData() {
+ return data;
+}
+
+DynamicBuffer::~DynamicBuffer() {
+ free(data);
+}
+
Index: modules/provider-coaster-c-client/src/Job.cpp
===================================================================
--- modules/provider-coaster-c-client/src/Job.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/Job.cpp (revision 3460)
@@ -0,0 +1,211 @@
+#include "Job.h"
+#include <sstream>
+
+using namespace std;
+
+static int seq = 0;
+
+Job::Job(string pexecutable) {
+ executable = pexecutable;
+ stringstream ss;
+ ss << "job-";
+ ss << seq++;
+ identity = ss.str();
+
+ arguments = NULL;
+ directory = NULL;
+ stdinLocation = NULL;
+ stdoutLocation = NULL;
+ stderrLocation = NULL;
+ jobManager = NULL;
+
+ env = NULL;
+ attributes = NULL;
+ stageIns = NULL;
+ stageOuts = NULL;
+ cleanups = NULL;
+
+ stdout = NULL;
+ stderr = NULL;
+
+ status = NULL;
+}
+
+string& Job::getIdentity() {
+ return identity;
+}
+
+vector<string*>* Job::getArguments() {
+ return arguments;
+}
+
+void Job::addArgument(string& arg) {
+ if (arguments == NULL) {
+ arguments = new vector<string*>;
+ }
+ arguments->push_back(new string(arg));
+}
+
+string& Job::getExecutable() {
+ return executable;
+}
+
+void Job::addArgument(const char* arg) {
+ addArgument(*(new string(arg)));
+}
+
+string* Job::getDirectory() {
+ return directory;
+}
+
+void Job::setDirectory(string& pdirectory) {
+ directory = &pdirectory;
+}
+
+string* Job::getStdinLocation() {
+ return stdinLocation;
+}
+
+void Job::setStdinLocation(string& loc) {
+ stdinLocation = &loc;
+}
+
+string* Job::getStdoutLocation() {
+ return stdoutLocation;
+}
+
+void Job::setStdoutLocation(string& loc) {
+ stdoutLocation = &loc;
+}
+
+string* Job::getStderrLocation() {
+ return stderrLocation;
+}
+
+void Job::setStderrLocation(string& loc) {
+ stderrLocation = &loc;
+}
+
+string* Job::getJobManager() {
+ return jobManager;
+}
+
+void Job::setJobManager(string& jm) {
+ jobManager = &jm;
+}
+
+map<string, string>* Job::getEnv() {
+ return env;
+}
+
+string* Job::getEnv(string name) {
+ if (env == NULL) {
+ return NULL;
+ }
+ else {
+ map<string, string>::iterator it;
+ it = env->find(name);
+ if (it == env->end()) {
+ return NULL;
+ }
+ else {
+ return &(it->second);
+ }
+ }
+}
+
+void Job::setEnv(string name, string value) {
+ if (env == NULL) {
+ env = new map<string, string>;
+ }
+ env->insert(pair<string, string>(name, value));
+}
+
+map<string, string>* Job::getAttributes() {
+ return attributes;
+}
+
+string* Job::getAttribute(string name) {
+ if (attributes == NULL) {
+ return NULL;
+ }
+ else {
+ map<string, string>::iterator it;
+ it = attributes->find(name);
+ if (it == attributes->end()) {
+ return NULL;
+ }
+ else {
+ return &(it->second);
+ }
+ }
+}
+
+void Job::setAttribute(string name, string value) {
+ if (attributes == NULL) {
+ attributes = new map<string, string>;
+ }
+ attributes->insert(pair<string, string>(name, value));
+}
+
+vector<StagingSetEntry>* Job::getStageIns() {
+ return stageIns;
+}
+
+void Job::addStageIn(string src, string dest, StagingMode mode) {
+ if (stageIns == NULL) {
+ stageIns = new vector<StagingSetEntry>;
+ }
+ stageIns->push_back(StagingSetEntry(src, dest, mode));
+}
+
+vector<StagingSetEntry>* Job::getStageOuts() {
+ return stageOuts;
+}
+
+void Job::addStageOut(string src, string dest, StagingMode mode) {
+ if (stageOuts == NULL) {
+ stageOuts = new vector<StagingSetEntry>;
+ }
+ stageOuts->push_back(StagingSetEntry(src, dest, mode));
+}
+
+vector<string>* Job::getCleanups() {
+ return cleanups;
+}
+
+void Job::addCleanup(string cleanup) {
+ if (cleanups == NULL) {
+ cleanups = new vector<string>;
+ }
+ cleanups->push_back(cleanup);
+}
+
+string* Job::getStderr() {
+ return stderr;
+}
+
+string* Job::getStdout() {
+ return stdout;
+}
+
+JobStatus* Job::getStatus() {
+ return status;
+}
+
+void Job::setStatus(JobStatus* newStatus) {
+ newStatus->setPreviousStatus(status);
+ status = newStatus;
+}
+
+Job::~Job() {
+ if (status != NULL) {
+ delete status;
+ }
+ if (arguments != NULL) {
+ for (int i = 0; i < arguments->size(); i++) {
+ delete arguments->at(i);
+ }
+ delete arguments;
+ }
+}
Index: modules/provider-coaster-c-client/src/CoasterError.cpp
===================================================================
--- modules/provider-coaster-c-client/src/CoasterError.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/CoasterError.cpp (revision 3460)
@@ -0,0 +1,31 @@
+/*
+ * CoasterError.cpp
+ *
+ * Created on: Aug 26, 2012
+ * Author: mike
+ */
+
+#include "CoasterError.h"
+#include <stdlib.h>
+
+CoasterError::CoasterError(string msg) {
+ message = msg.c_str();
+}
+
+CoasterError::CoasterError(const char* format, ...) {
+ va_list args;
+ char* buf = (char *) malloc(MAX_MSG_LEN + 1);
+
+ va_start(args, format);
+ vsnprintf(buf, MAX_MSG_LEN, format, args);
+ va_end(args);
+ message = buf;
+}
+
+CoasterError::CoasterError(const stringstream* ss) {
+ message = ss->str().c_str();
+}
+
+const char* CoasterError::what() const throw() {
+ return message;
+}
Index: modules/provider-coaster-c-client/src/JobStatusHandler.cpp
===================================================================
--- modules/provider-coaster-c-client/src/JobStatusHandler.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/JobStatusHandler.cpp (revision 3460)
@@ -0,0 +1,33 @@
+/*
+ * JobStatusHandler.cpp
+ *
+ * Created on: Aug 31, 2012
+ * Author: mike
+ */
+
+#include "JobStatusHandler.h"
+
+#include <sstream>
+
+JobStatusHandler::JobStatusHandler() {
+}
+
+JobStatusHandler::~JobStatusHandler() {
+}
+
+void JobStatusHandler::requestReceived() {
+ string jobId, msg;
+ getInDataAsString(0, jobId);
+ JobStatusCode statusCode = (JobStatusCode) getInDataAsInt(1);
+ int exitCode = getInDataAsInt(2);
+ getInDataAsString(3, msg);
+ long timestamp = getInDataAsLong(4);
+ if (statusCode == FAILED && msg.length() == 0) {
+ stringstream ss;
+ ss << "Job failed with an exit code of " << exitCode;
+ msg.assign(ss.str());
+ }
+ JobStatus* s = new JobStatus(statusCode, timestamp, &msg, NULL);
+
+ getChannel()->getClient()->updateJobStatus(jobId, s);
+}
Index: modules/provider-coaster-c-client/src/Handler.cpp
===================================================================
--- modules/provider-coaster-c-client/src/Handler.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/Handler.cpp (revision 3460)
@@ -0,0 +1,60 @@
+#include "Handler.h"
+
+#include "Logger.h"
+
+void Handler::receiveCompleted(int flags) {
+ if (flags & FLAG_ERROR != 0) {
+ errorReceived();
+ }
+ else {
+ requestReceived();
+ }
+}
+
+void Handler::errorReceived() {
+ vector<Buffer*>* errorData = getErrorData();
+ if (errorData == NULL) {
+ LogWarn << "Unspecified error receiving request." << endl;
+ }
+ else if (errorData->size() == 1) {
+ string* msg = errorData->at(0)->str();
+ LogWarn << "Error receiving request: " << msg << endl;
+ delete msg;
+ }
+ else {
+ string* msg = errorData->at(0)->str();
+ string* detail = errorData->at(1)->str();
+ LogWarn << "Error receiving request: " << msg << "\n" << detail << endl;
+ delete msg;
+ delete detail;
+ }
+}
+
+void Handler::requestReceived() {
+ sendReply("OK");
+}
+
+void Handler::sendReply(string& msg) {
+ addOutData(Buffer::wrap(msg));
+ send(getChannel());
+}
+
+void Handler::sendReply(const char* msg) {
+ addOutData(Buffer::wrap(msg));
+ send(getChannel());
+}
+
+void Handler::send(CoasterChannel* channel) {
+ vector<Buffer*>* od = getOutData();
+ vector<Buffer*>::iterator i;
+
+ for (i = od->begin(); i != od->end(); i++) {
+ channel->send(tag, *i, FLAG_REPLY + (i == --od->end() ? FLAG_FINAL : 0), this);
+ }
+ channel->unregisterHandler(this);
+}
+
+
+void Handler::dataSent(Buffer* buf) {
+ delete buf;
+}
Index: modules/provider-coaster-c-client/src/Command.cpp
===================================================================
--- modules/provider-coaster-c-client/src/Command.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/Command.cpp (revision 3460)
@@ -0,0 +1,76 @@
+#include "Command.h"
+
+#include "Logger.h"
+
+Command::Command(const string* pname) {
+ name = pname;
+}
+
+const string* Command::getName() {
+ return name;
+}
+
+void Command::send(CoasterChannel* channel) {
+ send(channel, NULL);
+}
+
+ostream& operator<< (ostream& os, Command* cmd) {
+ os << "Command[" << cmd->getName() << ", tag: " << cmd->getTag() << "]";
+ return os;
+}
+
+
+void Command::send(CoasterChannel* channel, CommandCallback* pcb) {
+ cb = pcb;
+ channel->registerCommand(this);
+
+ vector<Buffer*>* od = getOutData();
+ vector<Buffer*>::iterator i;
+
+ channel->send(tag, Buffer::wrap(name), od->empty() ? FLAG_FINAL : 0, this);
+
+ for (i = od->begin(); i != od->end(); i++) {
+ channel->send(tag, *i, i == --od->end() ? FLAG_FINAL : 0, this);
+ }
+}
+
+void Command::receiveCompleted(int flags) {
+ if (flags & FLAG_ERROR != 0) {
+ errorReceived();
+ }
+ else {
+ replyReceived();
+ }
+}
+
+
+void Command::errorReceived() {
+ vector<Buffer*>* errorData = getErrorData();
+ if (cb != NULL) {
+ if (errorData == NULL) {
+ cb->errorReceived(this, NULL, NULL);
+ }
+ else if (errorData->size() == 1) {
+ string* msg = errorData->at(0)->str();
+ cb->errorReceived(this, msg, NULL);
+ delete msg;
+ }
+ else {
+ string* msg = errorData->at(0)->str();
+ string* detail = errorData->at(1)->str();
+ cb->errorReceived(this, msg, detail);
+ delete msg;
+ delete detail;
+ }
+ }
+}
+
+void Command::replyReceived() {
+ if (cb != NULL) {
+ cb->replyReceived(this);
+ }
+}
+
+void Command::dataSent(Buffer* buf) {
+ delete buf;
+}
Index: modules/provider-coaster-c-client/src/JobStatus.h
===================================================================
--- modules/provider-coaster-c-client/src/JobStatus.h (revision 0)
+++ modules/provider-coaster-c-client/src/JobStatus.h (revision 3460)
@@ -0,0 +1,59 @@
+/*
+ * job-status.h
+ *
+ * Created on: Jun 9, 2012
+ * Author: mike
+ */
+
+#ifndef JOB_STATUS_H_
+#define JOB_STATUS_H_
+
+#include <time.h>
+#include <string>
+#include <iostream>
+
+using namespace std;
+
+enum JobStatusCode {
+ UNSUBMITTED = 0,
+ SUBMITTING = 8,
+ SUBMITTED = 1,
+ ACTIVE = 2,
+ SUSPENDED = 3,
+ RESUMED = 4,
+ FAILED = 5,
+ CANCELED = 6,
+ COMPLETED = 7,
+ STAGE_IN = 16,
+ STAGE_OUT = 17,
+ UNKNOWN = 9999
+};
+
+
+class JobStatus {
+ JobStatusCode statusCode;
+ time_t stime;
+ string* message;
+ string* exception;
+ JobStatus* prev;
+
+ public:
+ JobStatus(JobStatusCode statusCode, time_t time, const string* message, const string* exception);
+ JobStatus(JobStatusCode statusCode, const string* message, const string* exception);
+ JobStatus(JobStatusCode statusCode);
+ JobStatus();
+ virtual ~JobStatus();
+ JobStatusCode getStatusCode();
+ time_t getTime();
+ string* getMessage();
+ string* getException();
+ const JobStatus* getPreviousStatus();
+ void setPreviousStatus(JobStatus* prev);
+ static const char* statusCodeToStr(JobStatusCode code);
+ bool isTerminal();
+
+ friend ostream& operator<< (ostream& os, JobStatus& s);
+ friend ostream& operator<< (ostream& os, JobStatus* s);
+};
+
+#endif /* JOB_STATUS_H_ */
Index: modules/provider-coaster-c-client/src/Logger.h
===================================================================
--- modules/provider-coaster-c-client/src/Logger.h (revision 0)
+++ modules/provider-coaster-c-client/src/Logger.h (revision 3460)
@@ -0,0 +1,65 @@
+/*
+ * Logger.h
+ *
+ * Created on: Aug 13, 2012
+ * Author: mike
+ */
+
+#ifndef LOGGER_H_
+#define LOGGER_H_
+
+#define TS_LEN 28
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+using namespace std;
+
+class Logger: public ostream {
+ public:
+ enum Level { NONE = -1, DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3, FATAL = 4 };
+ static Logger* instance;
+ private:
+ ostream* out;
+ Level level;
+ const char* file;
+ const char* strLevel;
+ char ts[TS_LEN + 1];
+ bool flushed;
+
+ protected:
+ Logger(ostream& out);
+ void setLevel(Level level);
+ const char* levelToStr(Level level);
+ void header();
+ char* timeStamp();
+ public:
+ virtual ~Logger();
+ Logger& operator<< (Level level);
+ Logger& operator<< (string str);
+ Logger& operator<< (const string* str);
+ Logger& operator<< (const char* str);
+ Logger& operator<< (int i);
+ Logger& operator<< (long l);
+ Logger& operator<< (ostream& ( *pf )(ostream&));
+ Logger& setFile(const char* file);
+ Logger& flush();
+ void log(Level level, const char* fileName, const char* msg);
+ void log(Level level, const char* fileName, string msg);
+
+ static Logger& singleton();
+};
+
+class StdoutLogger: public Logger {
+ public:
+ StdoutLogger();
+ virtual ~StdoutLogger();
+};
+
+#define LogError Logger::singleton().setFile(__FILE__) << Logger::ERROR
+#define LogWarn Logger::singleton().setFile(__FILE__) << Logger::WARN
+#define LogInfo Logger::singleton().setFile(__FILE__) << Logger::INFO
+#define LogDebug Logger::singleton().setFile(__FILE__) << Logger::DEBUG
+
+#endif /* LOGGER_H_ */
Index: modules/provider-coaster-c-client/src/Makefile.am
===================================================================
--- modules/provider-coaster-c-client/src/Makefile.am (revision 0)
+++ modules/provider-coaster-c-client/src/Makefile.am (revision 3460)
@@ -0,0 +1,28 @@
+
+bin_PROGRAMS = CoasterClientTest
+CoasterClientTest_SOURCES = CoasterClientTest.cpp
+CoasterClientTest_LDADD = libcoasterclient.la
+
+lib_LTLIBRARIES = libcoasterclient.la
+
+libcoasterclient_la_SOURCES = Lock.h Lock.cpp \
+ ConditionVariable.h ConditionVariable.cpp \
+ CommandCallback.h \
+ Buffer.h Buffer.cpp \
+ SerUtil.h \
+ Logger.h Logger.cpp \
+ HandlerFactory.h HandlerFactory.cpp \
+ ChannelCallback.h ChannelCallback.cpp \
+ CoasterCannel.h CoasterChannel.cpp \
+ CoasterClient.h CoasterClient.cpp \
+ CoasterLoop.h CoasterLoop.cpp \
+ RequestReply.h RequestReply.cpp \
+ Command.h Command.cpp \
+ Handler.h Handler.cpp \
+ JobStatus.h JobStatus.cpp \
+ Job.h Job.cpp \
+ JobSubmitCommand.h JobSubmitCommand.cpp \
+ StagingSetEntry.h StagingSetEntry.cpp \
+ CoasterError.h CoasterError.cpp \
+ JobStatusHandler.h JobStatusHandler.cpp \
+ HeartBeatCommand.h HeartBeatCommand.cpp
Index: modules/provider-coaster-c-client/src/ChannelCallback.h
===================================================================
--- modules/provider-coaster-c-client/src/ChannelCallback.h (revision 0)
+++ modules/provider-coaster-c-client/src/ChannelCallback.h (revision 3460)
@@ -0,0 +1,20 @@
+/*
+ * ChannelCallback.h
+ *
+ * Created on: Aug 30, 2012
+ * Author: mike
+ */
+
+#ifndef CHANNELCALLBACK_H_
+#define CHANNELCALLBACK_H_
+
+#include "Buffer.h"
+
+class ChannelCallback {
+ public:
+ ChannelCallback();
+ virtual ~ChannelCallback();
+ virtual void dataSent(Buffer* buf) = 0;
+};
+
+#endif /* CHANNELCALLBACK_H_ */
Index: modules/provider-coaster-c-client/src/StagingSetEntry.cpp
===================================================================
--- modules/provider-coaster-c-client/src/StagingSetEntry.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/StagingSetEntry.cpp (revision 3460)
@@ -0,0 +1,29 @@
+/*
+ * StagingSetEntry.cpp
+ *
+ * Created on: Aug 11, 2012
+ * Author: mike
+ */
+
+#include "StagingSetEntry.h"
+
+StagingSetEntry::StagingSetEntry(string psource, string pdestination, StagingMode pmode) {
+ source = psource;
+ destination = pdestination;
+ mode = pmode;
+}
+
+string StagingSetEntry::getSource() {
+ return source;
+}
+
+string StagingSetEntry::getDestination() {
+ return destination;
+}
+
+StagingMode StagingSetEntry::getMode() {
+ return mode;
+}
+
+StagingSetEntry::~StagingSetEntry() {
+}
Index: modules/provider-coaster-c-client/src/JobSubmitCommand.cpp
===================================================================
--- modules/provider-coaster-c-client/src/JobSubmitCommand.cpp (revision 0)
+++ modules/provider-coaster-c-client/src/JobSubmitCommand.cpp (revision 3460)
@@ -0,0 +1,106 @@
+#include "JobSubmitCommand.h"
+#include <cstring>
+#include <sstream>
+
+using namespace std;
+
+char* copyStr(const char* str);
+void add(stringstream& ss, const char* key, string* value);
+void add(stringstream& ss, const char* key, string value);
+void add(stringstream& ss, const char* key, const char* value);
+
+string JobSubmitCommand::NAME("SUBMITJOB");
+
+JobSubmitCommand::JobSubmitCommand(Job* pjob): Command(&NAME) {
+ job = pjob;
+}
+
+void JobSubmitCommand::send(CoasterChannel* channel, CommandCallback* cb) {
+ serialize();
+ Command::send(channel, cb);
+}
+
+Job* JobSubmitCommand::getJob() {
+ return job;
+}
+
+void JobSubmitCommand::serialize() {
+ addOutData(Buffer::wrap(getName()));
+
+ stringstream ss;
+
+ add(ss, "identity", job->getIdentity());
+ add(ss, "executable", job->getExecutable());
+ add(ss, "directory", job->getDirectory());
+
+ add(ss, "stdin", job->getStdinLocation());
+ add(ss, "stdout", job->getStdoutLocation());
+ add(ss, "stderr", job->getStderrLocation());
+
+
+ vector<string*>* arguments = job->getArguments();
+ if (arguments != NULL) {
+ for (vector<string*>::iterator i = arguments->begin(); i != arguments->end(); ++i) {
+ add(ss, "arg", *i);
+ }
+ }
+
+ map<string, string>* env = job->getEnv();
+ if (env != NULL) {
+ for (map<string, string>::iterator i = env->begin(); i != env->end(); ++i) {
+ stringstream tmp;
+ tmp << i->first;
+ tmp << "=";
+ tmp << i->second;
+ add(ss, "env", tmp.str().c_str());
+ }
+ }
+
+ map<string, string>* attributes = job->getAttributes();
+ if (attributes != NULL) {
+ for (map<string, string>::iterator i = attributes->begin(); i != attributes->end(); ++i) {
+ stringstream tmp;
+ tmp << i->first;
+ tmp << "=";
+ tmp << i->second;
+ add(ss, "attr", tmp.str().c_str());
+ }
+ }
+
+ if (job->getJobManager() == NULL) {
+ add(ss, "jm", "fork");
+ }
+ else {
+ add(ss, "jm", job->getJobManager());
+ }
+
+ addOutData(Buffer::wrap(ss.str()));
+}
+
+void add(stringstream& ss, const char* key, string* value) {
+ if (value != NULL) {
+ add(ss, key, value->c_str());
+ }
+}
+
+void add(stringstream& ss, const char* key, string value) {
+ add(ss, key, value.c_str());
+}
+
+void add(stringstream& ss, const char* key, const char* value) {
+ if (value != NULL) {
+ ss << key << "=";
+ while (*value) {
+ char c = *value;
+ switch (c) {
+ case '\n':
+ c = 'n';
+ case '\\':
+ ss << '\\';
+ default:
+ ss << c;
+ }
+ value++;
+ }
+ }
+}
Index: modules/provider-coaster-c-client/src/Lock.h
===================================================================
--- modules/provider-coaster-c-client/src/Lock.h (revision 0)
+++ modules/provider-coaster-c-client/src/Lock.h (revision 3460)
@@ -0,0 +1,34 @@
+/*
+ * Lock.h
+ *
+ * Created on: Aug 28, 2012
+ * Author: mike
+ */
+
+#ifndef LOCK_H_
+#define LOCK_H_
+
+#include <pthread.h>
+
+class Lock {
+ private:
+ pthread_mutex_t l;
+ public:
+ Lock();
+ virtual ~Lock();
+
+ void lock();
+ void unlock();
+ pthread_mutex_t* getMutex();
+
+
+ class Scoped {
+ private:
+ Lock* myLock;
+ public:
+ Scoped(Lock& plock);
+ virtual ~Scoped();
+ };
+};
+
+#endif /* LOCK_H_ */
Index: modules/provider-coaster-c-client/.cproject
===================================================================
--- modules/provider-coaster-c-client/.cproject (revision 0)
+++ modules/provider-coaster-c-client/.cproject (revision 3460)
@@ -0,0 +1,688 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1741424405">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1741424405" moduleId="org.eclipse.cdt.core.settings" name="Build (GNU)">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.ptp.rdt.core.RemoteGCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${specs_file_path}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.so.debug.2120212018;cdt.managedbuild.config.gnu.so.debug.2120212018.;cdt.managedbuild.tool.gnu.c.compiler.so.debug.705570784;cdt.managedbuild.tool.gnu.c.compiler.input.83140249">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.ptp.rdt.core.RemoteGCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${specs_file_path}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.so.release.900885378;cdt.managedbuild.config.gnu.so.release.900885378.;cdt.managedbuild.tool.gnu.c.compiler.so.release.897273566;cdt.managedbuild.tool.gnu.c.compiler.input.1489389094">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="makefileGenerator">
+ <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ <profile id="org.eclipse.ptp.rdt.core.RemoteGCCStandardMakePerProjectProfile">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${specs_file_path}" command="gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1741424405" name="Build (GNU)" parent="org.eclipse.linuxtools.cdt.autotools.core.configuration.build">
+ <folderInfo id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1741424405." name="/" resourcePath="">
+ <toolChain id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1284732845" name="GNU Autotools Toolchain" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolChain">
+ <targetPlatform id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform.1492195252" isAbstract="false" name="GNU Autotools Target Platform" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform"/>
+ <builder id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder.293319211" keepEnvironmentInBuildfile="false" managedBuildOn="true" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder"/>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure.382117173" name="configure" superClass="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure">
+ <option id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name.1625301134" superClass="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name" value="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1741424405" valueType="string"/>
+ </tool>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.1994545804" name="autogen.sh" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen"/>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.1622970238" name="GCC C Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc">
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.774141483" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp.950725862" name="GCC C++ Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
+ <buildTargets>
+ <target name="all" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>all</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="am--refresh" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>am--refresh</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="check" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>check</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>clean</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="ctags" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>ctags</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="ctags-recursive" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>ctags-recursive</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="dist" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>dist</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="dist-all" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>dist-all</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="dist-bzip2" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>dist-bzip2</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="dist-gzip" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>dist-gzip</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="dist-lzip" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>dist-lzip</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="dist-lzma" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>dist-lzma</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="dist-shar" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>dist-shar</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="dist-tarZ" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>dist-tarZ</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="dist-xz" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>dist-xz</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="dist-zip" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>dist-zip</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="distcheck" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>distcheck</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="distclean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>distclean</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="distclean-tags" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>distclean-tags</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="distcleancheck" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>distcleancheck</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="distdir" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>distdir</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="distuninstallcheck" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>distuninstallcheck</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="dvi" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>dvi</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="html" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>html</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="info" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>info</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="install" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>install</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="install-data" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>install-data</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="install-dvi" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>install-dvi</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="install-exec" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>install-exec</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="install-html" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>install-html</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="install-info" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>install-info</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="install-man" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>install-man</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="install-pdf" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>install-pdf</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="install-ps" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>install-ps</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="install-strip" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>install-strip</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="installcheck" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>installcheck</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="installdirs" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>installdirs</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="maintainer-clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>maintainer-clean</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="Makefile" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>Makefile</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="mostlyclean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>mostlyclean</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="pdf" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>pdf</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="ps" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>ps</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="tags" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>tags</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="tags-recursive" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>tags-recursive</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ <target name="uninstall" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+ <buildCommand>make</buildCommand>
+ <buildArguments/>
+ <buildTarget>uninstall</buildTarget>
+ <stopOnError>true</stopOnError>
+ <useDefaultCommand>true</useDefaultCommand>
+ <runAllBuilders>false</runAllBuilders>
+ </target>
+ </buildTargets>
+ </storageModule>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="provider-coaster-c-client.org.eclipse.linuxtools.cdt.autotools.core.projectType.1749205663" name="GNU Autotools" projectType="org.eclipse.linuxtools.cdt.autotools.core.projectType"/>
+ </storageModule>
+</cproject>
Index: modules/provider-coaster-c-client/ChangeLog
===================================================================
Index: modules/provider-coaster-c-client/README
===================================================================
--- modules/provider-coaster-c-client/README (revision 0)
+++ modules/provider-coaster-c-client/README (revision 3460)
@@ -0,0 +1 @@
+It only compiles, so don't assume that it works!
\ No newline at end of file
Index: modules/provider-coaster-c-client/configure.ac
===================================================================
--- modules/provider-coaster-c-client/configure.ac (revision 0)
+++ modules/provider-coaster-c-client/configure.ac (revision 3460)
@@ -0,0 +1,39 @@
+AC_PREREQ([2.68])
+AC_INIT(coaster-c-client, 1.0)
+AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_SRCDIR(src/CoasterClient.cpp)
+#AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE
+
+LT_INIT
+AC_LIBTOOL_CXX
+
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_AWK
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
+
+# Checks for header files.
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
+
+# Libs
+AC_CHECK_LIB(pthread, pthread_create)
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_CHECK_FUNCS([gettimeofday memset select socket strerror strrchr])
+
+
+AC_OUTPUT(Makefile src/Makefile)
Index: modules/provider-coaster-c-client/INSTALL
===================================================================
--- modules/provider-coaster-c-client/INSTALL (revision 0)
+++ modules/provider-coaster-c-client/INSTALL (revision 3460)
@@ -0,0 +1,370 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
+Inc.
+
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
+
+Basic Installation
+==================
+
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package. Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+ The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package, generally using the just-built uninstalled binaries.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the `make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type `make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior `make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 7. Often, you can also type `make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide `make
+ distcheck', which can by used by developers to test that all other
+ targets like `make install' and `make uninstall' work correctly.
+ This target is generally not run by end users.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'. This
+is known as a "VPATH" build.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+ By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them. In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'. Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated. The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the `DESTDIR' variable. For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names. The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+ Some packages offer the ability to configure how verbose the
+execution of `make' will be. For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ HP-UX `make' updates targets which have the same time stamps as
+their prerequisites, which makes it generally unusable when shipped
+generated files such as `configure' are involved. Use GNU `make'
+instead.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS
+ KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+ Use DIR as the installation prefix. *note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
Index: modules/provider-coaster-c-client/.autotools
===================================================================
--- modules/provider-coaster-c-client/.autotools (revision 0)
+++ modules/provider-coaster-c-client/.autotools (revision 3460)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configurations>
+<configuration id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1741424405">
+<option id="configure" value="configure"/>
+<option id="configdir" value=""/>
+<option id="cache-file" value=""/>
+<option id="help" value="false"/>
+<option id="no-create" value="false"/>
+<option id="quiet" value="false"/>
+<option id="version" value="false"/>
+<option id="host" value=""/>
+<option id="build" value=""/>
+<option id="target" value=""/>
+<option id="prefix" value=""/>
+<option id="exec-prefix" value=""/>
+<option id="libdir" value=""/>
+<option id="bindir" value=""/>
+<option id="sbindir" value=""/>
+<option id="includedir" value=""/>
+<option id="datadir" value=""/>
+<option id="sysconfdir" value=""/>
+<option id="infodir" value=""/>
+<option id="mandir" value=""/>
+<option id="srcdir" value=""/>
+<option id="localstatedir" value=""/>
+<option id="sharedstatedir" value=""/>
+<option id="libexecdir" value=""/>
+<option id="oldincludedir" value=""/>
+<option id="program-prefix" value=""/>
+<option id="program-suffix" value=""/>
+<option id="program-transform-name" value=""/>
+<option id="enable-maintainer-mode" value="false"/>
+<option id="user" value=""/>
+<option id="autogen" value="autogen.sh"/>
+<option id="autogenOpts" value=""/>
+</configuration>
+</configurations>
Index: modules/provider-coaster-c-client/COPYING
===================================================================
--- modules/provider-coaster-c-client/COPYING (revision 0)
+++ modules/provider-coaster-c-client/COPYING (revision 3460)
@@ -0,0 +1 @@
+<Place your desired license here.>
\ No newline at end of file
Index: modules/provider-coaster-c-client/Makefile.am
===================================================================
--- modules/provider-coaster-c-client/Makefile.am (revision 0)
+++ modules/provider-coaster-c-client/Makefile.am (revision 3460)
@@ -0,0 +1,6 @@
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = src
+EXTRA_DIST = autogen.sh
+LIBS="-pthread $LIBS"
+CXXFLAGS="$CFLAGS -pthread"
+
Index: modules/provider-coaster-c-client/autogen.sh
===================================================================
--- modules/provider-coaster-c-client/autogen.sh (revision 0)
+++ modules/provider-coaster-c-client/autogen.sh (revision 3460)
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+run() {
+ checkerror
+ LAST="$@"
+ echo "$@"
+ "$@"
+}
+
+checkerror() {
+ if [ "$?" != "0" ]; then
+ echo "$LAST failed"
+ exit q
+ fi
+}
+
+#autoreconf --force --install -I config -I . -I m4
+run libtoolize -i -f -c -q
+run aclocal
+run automake --gnu --add-missing
+run autoconf
+checkerror
+echo "Done"
Property changes on: modules/provider-coaster-c-client/autogen.sh
___________________________________________________________________
Added: svn:executable
+ *
Index: modules/provider-coaster-c-client/NEWS
===================================================================
More information about the Swift-commit
mailing list