From 5987ac2fff26eacb0e91ce78f85bf1ebde3dd149 Mon Sep 17 00:00:00 2001 From: Johannes Lode Date: Mon, 21 Jan 2019 16:11:40 +0100 Subject: [PATCH 1/7] Changes in rltime interface for relative adjustments. To avoid time calculation errors by mixing absolute time values with relative time value in the same class, the interface was changed for the application of relative amounts of time against absolute points in time. Added interface for simple formatting options of time differences. --- rllib/lib/rleibnetip.cpp | 7 +- rllib/lib/rlhistorylogger.cpp | 14 +- rllib/lib/rlhistorylogger.h | 3 +- rllib/lib/rltime.cpp | 594 ++++++++++++++++++++-------------- rllib/lib/rltime.h | 64 +++- 5 files changed, 421 insertions(+), 261 deletions(-) diff --git a/rllib/lib/rleibnetip.cpp b/rllib/lib/rleibnetip.cpp index 82546373..ba2e0601 100644 --- a/rllib/lib/rleibnetip.cpp +++ b/rllib/lib/rleibnetip.cpp @@ -58,7 +58,8 @@ static void *eib_reader(void *arg) // thread THREAD_PARAM *p = (THREAD_PARAM *) arg; rlEIBnetIP *eib = (rlEIBnetIP *) p->user; rlEIBnetIP::PDU pdu; - rlTime now, last, diff; + rlTime now, last; + double diff; int ret, len; int recseq = 0; int expected_recseq = 0; @@ -136,7 +137,7 @@ static void *eib_reader(void *arg) // thread } } diff = now - last; - if(eib->isConnected() && eib->channelid != -1 && diff.second > 50) + if(eib->isConnected() && eib->channelid != -1 && diff > 50) { // send heartbeat if(eib->debug) ::printf("send heartbeat\n"); pdu.headersize = EIB_HEADERSIZE; @@ -789,7 +790,7 @@ int rlEIBnetIP::getText(const char *name, char *text, int maxlen) int rlEIBnetIP::setText(const char *name, const char *text) { - if(name == NULL || text == NULL) return rlEIBnetIP::EIBERROR; + if(name == NULL || text == NULL) return rlEIBnetIP::EIBERROR; char buf[16]; int length = strlen(text); unsigned int a1,a2,a3,daddr; diff --git a/rllib/lib/rlhistorylogger.cpp b/rllib/lib/rlhistorylogger.cpp index b69528b5..1ca50fa8 100644 --- a/rllib/lib/rlhistorylogger.cpp +++ b/rllib/lib/rlhistorylogger.cpp @@ -26,13 +26,7 @@ rlHistoryLogger::rlHistoryLogger(const char *csvName, int maxHoursPerFile, int m max_hours_per_file = maxHoursPerFile; if(max_hours_per_file <= 0) max_hours_per_file = 1; val = max_hours_per_file; - time_diff.hour = val % 24; - val = val / 24; - time_diff.day = val % 31; // we are on the save side if we assume a month with 31 days - val = val / 31; - time_diff.month = val % 12; - val = val / 12; - time_diff.year = val; + time_diff = val * 3600; max_lines_in_memory = maxLinesInMemory; if(max_lines_in_memory <= 0) max_lines_in_memory = 1; current_file = -1; @@ -164,16 +158,18 @@ int rlHistoryLogger::openFile() current_file = i_oldest; sprintf(csv_file_name,"%s%d.csv",csv_name,i_oldest); fout = fopen(csv_file_name,"w"); + file_start_time.getLocalTime(); } else { // open next file for writing current_file++; - if(current_file >= 10) current_file = 0; + if(current_file >= 10) + current_file = 0; sprintf(csv_file_name,"%s%d.csv",csv_name,current_file); fout = fopen(csv_file_name,"w"); + file_start_time.getLocalTime(); } - file_start_time.getLocalTime(); return 0; } diff --git a/rllib/lib/rlhistorylogger.h b/rllib/lib/rlhistorylogger.h index f7a37439..18e47659 100644 --- a/rllib/lib/rlhistorylogger.h +++ b/rllib/lib/rlhistorylogger.h @@ -47,7 +47,8 @@ class rlHistoryLogger int pushLineToFile(const char *line); int openFile(); rlHistoryLogLine *first_line,*current_line; - rlTime time,file_start_time,time_diff; + rlTime time,file_start_time; + time_t time_diff; FILE *fout; int max_hours_per_file, max_lines_in_memory, current_file; char *csv_name, *csv_file_name; diff --git a/rllib/lib/rltime.cpp b/rllib/lib/rltime.cpp index 1855b33e..9c214a83 100644 --- a/rllib/lib/rltime.cpp +++ b/rllib/lib/rltime.cpp @@ -1,4 +1,3 @@ - /*************************************************************************** rltime.cpp - description ------------------- @@ -19,6 +18,8 @@ #include #include #include +#include +#include #ifdef RLUNIX #include @@ -58,8 +59,74 @@ VAX_BIN_TIME; #ifdef RLWIN32 #include #include + +// gmtime_r can be defined by mingw +#ifndef gmtime_r +static struct tm* gmtime_r(const time_t* t, struct tm* r) +{ + // gmtime is threadsafe in windows because it uses TLS + struct tm *theTm = gmtime(t); + if (theTm) { + *r = *theTm; + return r; + } else { + return 0; + } +} +#endif // gmtime_r + +// gmtime_r can be defined by mingw +#ifndef localtime_r +static struct tm* localtime_r(const time_t* t, struct tm* r) +{ + // localtime is threadsafe in windows because it uses TLS + struct tm *theTm = localtime(t); + if (theTm) { + *r = *theTm; + return r; + } else { + return 0; + } +} +#endif // localtime_r + #endif +void rlTime::normalizeAsDate() +{ + if (year) + { + // read members + tm t; + memset(&t, 0, sizeof(t)); + t.tm_year = year - 1900; + t.tm_mon = month - 1; + t.tm_mday = day; + t.tm_hour = hour; + t.tm_min = minute; + t.tm_sec = second; + + // normalize milliseconds + while (millisecond > 1000) + { + ++t.tm_sec; + millisecond -= 1000; + } + + // normalize time structure + auto ep = timegm(&t); + gmtime_r(&ep, &t); + + // set members + year = 1900 + t.tm_year; + month = 1 + t.tm_mon; + day = t.tm_mday; + hour = t.tm_hour; + minute = t.tm_min; + second = t.tm_sec; + } +} + rlTime::rlTime(int Year, int Month, int Day, int Hour, int Minute, int Second, int Millisecond) { year = Year; @@ -69,6 +136,8 @@ rlTime::rlTime(int Year, int Month, int Day, int Hour, int Minute, int Second, i minute = Minute; second = Second; millisecond = Millisecond; + + normalizeAsDate(); } rlTime::~rlTime() @@ -85,6 +154,7 @@ void rlTime::setTimeFromString(const char *time_string) second = 0; millisecond = 0; sscanf(time_string,"%d-%d-%d %d:%d:%d %d",&year,&month,&day, &hour,&minute,&second, &millisecond); + normalizeAsDate(); } void rlTime::setTimeFromIsoString(const char *iso_time_string) @@ -97,6 +167,7 @@ void rlTime::setTimeFromIsoString(const char *iso_time_string) second = 0; millisecond = 0; sscanf(iso_time_string,"%d-%d-%dT%d:%d:%d.%d",&year,&month,&day, &hour,&minute,&second, &millisecond); + normalizeAsDate(); } const char *rlTime::getTimeString() @@ -116,24 +187,21 @@ void rlTime::getLocalTime() #ifdef RLUNIX time_t t; struct tm *tms; + struct tm tmsbuf; struct timeval tv; struct timezone tz; time(&t); - tms = localtime(&t); + tms = localtime_r(&t, &tmsbuf); gettimeofday(&tv, &tz); - /* adjust year and month */ - tms->tm_year += 1900; - tms->tm_mon += 1; - millisecond = (int)tv.tv_usec / 1000; second = (int)tms->tm_sec; minute = (int)tms->tm_min; hour = (int)tms->tm_hour; day = (int)tms->tm_mday; - month = (int)tms->tm_mon; - year = (int)tms->tm_year; + month = (int)tms->tm_mon + 1; + year = (int)tms->tm_year + 1900; #endif #ifdef __VMS @@ -165,25 +233,22 @@ int rlTime::getFileModificationTime(const char *filename) { struct stat statbuf; struct tm *tms; + struct tm tmsbuf; #ifdef RLUNIX if(lstat(filename,&statbuf)) return -1; #else if(stat(filename,&statbuf)) return -1; #endif - tms = localtime(&statbuf.st_mtime); - - /* adjust year and month */ - tms->tm_year += 1900; - tms->tm_mon += 1; + tms = localtime_r(&statbuf.st_mtime, &tmsbuf); millisecond = 0; second = (int)tms->tm_sec; minute = (int)tms->tm_min; hour = (int)tms->tm_hour; day = (int)tms->tm_mday; - month = (int)tms->tm_mon; - year = (int)tms->tm_year; + month = (int)tms->tm_mon + 1; + year = (int)tms->tm_year + 1900; return 0; } @@ -258,196 +323,123 @@ void rlTime::setLocalTime() #endif } -rlTime& rlTime::operator+=(rlTime &time) -{ - rlTime t; - t = *this + time; - *this = t; - return *this; -} - -rlTime& rlTime::operator-=(rlTime &time) +rlTime& rlTime::operator+=(time_t seconds) { - rlTime t; - t = *this - time; - *this = t; - return *this; -} + if (0 > seconds) + return this->operator -=(-seconds); -rlTime rlTime::operator+(rlTime &time) -{ - int maxmonth,y,m; - rlTime t; - - t.year = year + time.year; - t.month = month + time.month; - t.day = day + time.day; - t.hour = hour + time.hour; - t.minute = minute + time.minute; - t.second = second + time.second; - t.millisecond = millisecond + time.millisecond; - - y = t.year; - if(t.month > 12 || (t.month==12 && t.day==31 && t.hour>=24)) y++; - m = t.month; - if(t.month > 12 || (t.month==12 && t.day==31 && t.hour>=24)) m = 1; - - switch(m % 12) + auto d = std::div(seconds, time_t(60)); + second += d.rem; + if (d.quot) { - case 1: // january - maxmonth = 31; - break; - case 2: // february - maxmonth = 28; - // Annus bisextilis (calendario Gregoriano) - if(y%4==0) + d = std::div(d.quot, time_t(60)); + minute += d.rem; + if (d.quot) + { + d = std::div(d.quot, time_t(24)); + hour += d.rem; + if (d.quot) { - maxmonth = 29; - int hth = y % 100; - int special = y % 400; // 1900-+-2100-2200-2300-+-2500-2600-2700 - if(hth == 0 && special != 0) maxmonth = 28; - } - break; - case 3: // march - maxmonth = 31; - break; - case 4: // april - maxmonth = 30; - break; - case 5: // may - maxmonth = 31; - break; - case 6: // june - maxmonth = 30; - break; - case 7: // july - maxmonth = 31; - break; - case 8: // august - maxmonth = 31; - break; - case 9: // september - maxmonth = 30; - break; - case 10: // october - maxmonth = 31; - break; - case 11: // november - maxmonth = 30; - break; - case 12: // december - maxmonth = 31; - break; - default: - maxmonth = 31; - break; + d = std::div(d.quot, time_t(31)); + day += d.rem; + if (d.quot) + { + d = std::div(d.quot, time_t(12)); + month += d.rem; + year += d.quot; + } + } + } } - if(t.millisecond >= 1000) { t.second++; t.millisecond -= 1000; } - if(t.second >= 60) { t.minute++; t.second -= 60; } - if(t.minute >= 60) { t.hour++, t.minute -= 60; } - if(t.hour >= 24) { t.day++; t.hour -= 24; } - if(t.day > maxmonth) { t.month++; t.day -= maxmonth; } - if(t.month > 12) { t.year++; t.month -= 12; } - return t; + this->normalizeAsDate(); + + return *this; } -rlTime rlTime::operator-(rlTime &time) +rlTime& rlTime::operator-=(time_t seconds) { - int maxmonth,y,m; - rlTime t; - - y = 0; - t.year = year - time.year; - t.month = month - time.month; - t.day = day - time.day; - t.hour = hour - time.hour; - t.minute = minute - time.minute; - t.second = second - time.second; - t.millisecond = millisecond - time.millisecond; - - if(t.millisecond < 0) { t.second--; t.millisecond += 1000; } - if(t.second < 0) { t.minute--; t.second += 60; } - if(t.minute < 0) { t.hour--, t.minute += 60; } - if(t.hour < 0) { t.day--; t.hour += 24; } - - if(t.day < 0) + if (0 > seconds) + return this->operator +=(-seconds); + + auto d = std::div(seconds, time_t(60)); + second -= d.rem; + if (second < 0) { - t.month--; - y = t.year; - m = t.month; - if(m <= 0) { m += 12; y--; } - switch(m % 12) + ++d.quot; + second += 60; + } + if (d.quot) + { + d = std::div(d.quot, time_t(60)); + minute -= d.rem; + if (minute < 0) + { + ++d.quot; + minute += 60; + } + if (d.quot) { - case 1: // january - maxmonth = 31; - break; - case 2: // february - maxmonth = 28; - // Annus bisextilis (calendario Gregoriano) - if(y%4==0) + d = std::div(d.quot, time_t(24)); + hour -= d.rem; + if (hour < 0) + { + ++d.quot; + hour += 24; + } + if (d.quot) + { + d = std::div(d.quot, time_t(31)); + day -= d.rem; + if (day < 0) { - maxmonth = 29; - int hth = y % 100; - int special = y % 400; // 1900-+-2100-2200-2300-+-2500-2600-2700 - if(hth == 0 && special != 0) maxmonth = 28; - } - break; - case 3: // march - maxmonth = 31; - break; - case 4: // april - maxmonth = 30; - break; - case 5: // may - maxmonth = 31; - break; - case 6: // june - maxmonth = 30; - break; - case 7: // july - maxmonth = 31; - break; - case 8: // august - maxmonth = 31; - break; - case 9: // september - maxmonth = 30; - break; - case 10: // october - maxmonth = 31; - break; - case 11: // november - maxmonth = 30; - break; - case 12: // december - maxmonth = 31; - break; - default: - maxmonth = 31; - break; + ++d.quot; + day += 31; + } + if (d.quot) + { + d = std::div(d.quot, time_t(12)); + month -= d.rem; + if (month < 0) + { + ++d.quot; + month += 12; + } + year -= d.quot; + } + } } - t.day += maxmonth; } - if(y >= 0) - { - //printf("after christ was born. thus everything is ok.\n"); - } - else - { - //printf("before christ was born. now also ok\n"); - { t.month++; t.day -= 30; } - if(t.day < 30) { t.day++; t.hour -= 24; } - if(t.hour < 0 ) { t.hour++; t.minute -= 60; } - if(t.minute < 0 ) { t.minute++; t.second -= 60; } - if(t.second < 0 ) { t.second++; t.millisecond -= 1000; } - } + this->normalizeAsDate(); + + return *this; +} + +rlTime rlTime::operator+(time_t seconds) const +{ + rlTime t(*this); + + t += seconds; + + return t; +} + +rlTime rlTime::operator-(time_t seconds) const +{ + rlTime t(*this); + + t -= seconds; return t; } -int rlTime::operator==(rlTime &time) +double rlTime::operator-(const rlTime &time) const +{ + return this->secondsSinceEpoche() - time.secondsSinceEpoche(); +} + +int rlTime::operator==(const rlTime &time) const { if(year != time.year) return 0; if(month != time.month) return 0; @@ -460,71 +452,108 @@ int rlTime::operator==(rlTime &time) return 1; } -int rlTime::operator<(rlTime &time) +int rlTime::operator<=(const rlTime &time) const { - rlTime diff,t1; - - t1.year = year; - t1.month = month; - t1.day = day; - t1.hour = hour; - t1.minute = minute; - t1.second = second; - t1.millisecond = millisecond; - //printf("=(const rlTime &time) const { if((*this) == time) return 1; - if((*this) < time) return 1; + if((*this) > time) return 1; return 0; } -int rlTime::operator>(rlTime &time) +int rlTime::operator<(const rlTime &time) const { - rlTime diff,t1; - - t1.year = year; - t1.month = month; - t1.day = day; - t1.hour = hour; - t1.minute = minute; - t1.second = second; - t1.millisecond = millisecond; - //printf(">t1=%s\n",t1.getTimeString()); - //printf(">time=%s\n",time.getTimeString()); - diff = time - t1; - //printf(">diff=%s\n",diff.getTimeString()); - if(diff.year < 0) return 1; - if(diff.month < 0) return 1; - if(diff.day < 0) return 1; - if(diff.hour < 0) return 1; - if(diff.minute < 0) return 1; - if(diff.second < 0) return 1; - if(diff.millisecond < 0) return 1; + if (this->year < time.year) + return 1; + else if (this->year == time.year) + { + if (this->month < time.month) + return 1; + else if (this->month == time.month) + { + if (this->day < time.day) + return 1; + else if (this->day == time.day) + { + if (this->hour < time.hour) + return 1; + else if (this->hour == time.hour) + { + if (this->minute < time.minute) + return 1; + else if (this->minute == time.minute) + { + if (this->second < time.second) + return 1; + else if (this->second == time.second) + { + if (this->millisecond < time.millisecond) + return 1; + } + } + } + } + } + } + return 0; } -int rlTime::operator>=(rlTime &time) +int rlTime::operator>(const rlTime &time) const { - if((*this) == time) return 1; - if((*this) > time) return 1; + if (this->year > time.year) + return 1; + else if (this->year == time.year) + { + if (this->month > time.month) + return 1; + else if (this->month == time.month) + { + if (this->day > time.day) + return 1; + else if (this->day == time.day) + { + if (this->hour > time.hour) + return 1; + else if (this->hour == time.hour) + { + if (this->minute > time.minute) + return 1; + else if (this->minute == time.minute) + { + if (this->second > time.second) + return 1; + else if (this->second == time.second) + { + if (this->millisecond > time.millisecond) + return 1; + } + } + } + } + } + } + return 0; } -double rlTime::secondsSinceEpoche() +time_t rlTime::timegm(struct tm* tm_) +{ + auto t = mktime(tm_); + struct tm ltm; + struct tm gtm; + auto lt = localtime_r(&t, <m); + auto gt = gmtime_r(&t, >m); + auto diff = mktime(lt) - mktime(gt); + return t + diff; +} + +double rlTime::secondsSinceEpoche() const { struct tm begin; struct tm test; @@ -534,10 +563,11 @@ double rlTime::secondsSinceEpoche() begin.tm_year = 70; begin.tm_mon = 0; - begin.tm_mday = 1; + begin.tm_mday = 2; // see below begin.tm_hour = 0; begin.tm_min = 0; begin.tm_sec = 0; + begin.tm_isdst = 0; test.tm_year = year - 1900; test.tm_mon = month - 1; @@ -545,10 +575,100 @@ double rlTime::secondsSinceEpoche() test.tm_hour = hour; test.tm_min = minute; test.tm_sec = second; + test.tm_isdst = -1; - time_t t0 = mktime(&begin); - time_t t1 = mktime(&test); + time_t t0 = timegm(&begin) - 86400; // a weak workaround: on several platform (especially Windows 7 in Europe Timezones) mktime() is not capable of converting 19070-01-01T00:00:00 into seconds, because they try to convert it into UTC instead of localtime + time_t t1 = mktime(&test); // this might be error prone, see above return difftime(t1,t0) + (((double) millisecond) / 1000); } +const char* rlTime::formatTimeDiff(double tdiff, enum FormatLargestUnit fmt, unsigned bufferLength, char* buffer) +{ + if (0 < bufferLength) + { + if (not buffer) + buffer = new char[bufferLength]; + + bool isNegative = (tdiff < 0); + tdiff = fabs(tdiff); + int milliseconds = ((int) (tdiff * 1000)) % 1000; + time_t seconds = (time_t) tdiff; + lldiv_t minutes, hours, days, weeks; + + minutes = lldiv(seconds, 60); + + const char* fmtString = "%s%d:%02d.%03d"; + switch (fmt) + { + case MinutesSecondsFraction: + fmtString = "%s%d:%02d.%03d"; + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), minutes.quot, minutes.rem, milliseconds); + break; + case HoursMinutesSecondsFraction: + fmtString = "%s%d:%02d:%02d.%03d"; + hours = lldiv(minutes.quot, 60); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), hours.quot, hours.rem, minutes.rem, milliseconds); + break; + case DaysHoursMinutesSecondsFraction: + fmtString = "%s%d:%02d:%02d:%02d.%03d"; + hours = lldiv(minutes.quot, 60); + days = lldiv(hours.quot, 24); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), days.quot, days.rem, hours.rem, minutes.rem, milliseconds); + break; + case WeeksDaysHoursMinutesSecondsFraction: + fmtString = "%s%d:%d:%02d:%02d:%02d.%03d"; + hours = lldiv(minutes.quot, 60); + days = lldiv(hours.quot, 24); + weeks = lldiv(days.quot, 7); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), weeks.quot, weeks.rem, days.rem, hours.rem, minutes.rem, milliseconds); + break; + case MinutesSeconds: + fmtString = "%s%d:%02d"; + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), minutes.quot, minutes.rem); + break; + case HoursMinutesSeconds: + fmtString = "%s%d:%02d:%02d"; + hours = lldiv(minutes.quot, 60); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), hours.quot, hours.rem, minutes.rem); + break; + case DaysHoursMinutesSeconds: + fmtString = "%s%d:%02d:%02d:%02d"; + hours = lldiv(minutes.quot, 60); + days = lldiv(hours.quot, 24); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), days.quot, days.rem, hours.rem, minutes.rem); + break; + case WeeksDaysHoursMinutesSeconds: + fmtString = "%s%d:%d:%02d:%02d:%02d"; + hours = lldiv(minutes.quot, 60); + days = lldiv(hours.quot, 24); + weeks = lldiv(days.quot, 7); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), weeks.quot, weeks.rem, days.rem, hours.rem, minutes.rem); + break; + } +} + + return buffer; +} + +const char* rlTime::formatTimeDiff(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit fmt, unsigned bufferLength, char* buffer) +{ + return formatTimeDiff(t2 - t1, fmt, bufferLength, buffer); +} + +std::string rlTime::formatTimeDiffString(double tdiff, enum FormatLargestUnit fmt) +{ + char strBuffer[32]; + + const char* result = formatTimeDiff(tdiff, fmt, sizeof(strBuffer), strBuffer); + + std::string diffStr(result); + + return diffStr; +} + +std::string rlTime::formatTimeDiffString(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit fmt) +{ + return formatTimeDiffString(t2 - t1, fmt); +} + diff --git a/rllib/lib/rltime.h b/rllib/lib/rltime.h index 97d1583e..0b32b55e 100644 --- a/rllib/lib/rltime.h +++ b/rllib/lib/rltime.h @@ -18,14 +18,17 @@ #define _RL_TIME_H_ #include "rldefine.h" +#include +#include /*!
-class for handling time.
+class for handling absolute points in time. It supports also simple formatting of time differences.
 
*/ class rlTime { public: rlTime(int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0); + rlTime(double) = delete; virtual ~rlTime(); const char *getTimeString(); const char *getIsoTimeString(); @@ -38,16 +41,21 @@ class rlTime void setTimeFromString(const char *time_string); void setTimeFromIsoString(const char *iso_time_string); void setLocalTime(); - double secondsSinceEpoche(); - rlTime& operator+= (rlTime &time); - rlTime& operator-= (rlTime &time); - rlTime operator+ (rlTime &time); - rlTime operator- (rlTime &time); - int operator== (rlTime &time); - int operator< (rlTime &time); - int operator<= (rlTime &time); - int operator> (rlTime &time); - int operator>= (rlTime &time); + double secondsSinceEpoche() const; + + rlTime& operator+= (time_t seconds); ///< adjust absolute time by number of seconds + rlTime& operator-= (time_t seconds); ///< adjust absolute time by number of seconds + rlTime operator+ (time_t seconds) const; ///< make new object with absolute time adjusted by number of seconds + rlTime operator- (time_t seconds) const; ///< make new object with absolute time adjusted by number of seconds + + double operator- (const rlTime &time) const; ///< difference of two points in time in seconds.milliseconds + + int operator== (const rlTime &time) const; + int operator< (const rlTime &time) const; + int operator<= (const rlTime &time) const; + int operator> (const rlTime &time) const; + int operator>= (const rlTime &time) const; + int year; int month; int day; @@ -55,6 +63,40 @@ class rlTime int minute; int second; int millisecond; + + enum FormatLargestUnit + { + MinutesSecondsFraction = 0, ///< "0:00.000", needs at least 9 bytes buffer + HoursMinutesSecondsFraction, ///< "0:00:00.000", needs at least 12 bytes buffer + DaysHoursMinutesSecondsFraction, ///< "0:00:00:00.000", needs at least 15 bytes buffer + WeeksDaysHoursMinutesSecondsFraction, ///< "0:0:00:00:00.000", needs at least 17 bytes buffer + MinutesSeconds, ///< "0:00", needs at least 5 bytes buffer + HoursMinutesSeconds, ///< "0:00:00", needs at least 8 bytes buffer + DaysHoursMinutesSeconds, ///< "0:00:00:00", needs at least 11 bytes buffer + WeeksDaysHoursMinutesSeconds, ///< "0:0:00:00:00", needs at least 13 bytes buffer + }; + + ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, caller provides buffer, or, NULL pointer, buffer must be deleted (delete[]) + static + const char* formatTimeDiff(double, enum FormatLargestUnit = HoursMinutesSecondsFraction, unsigned bufferLength = 32, char* buffer = 0); + + ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, caller provides buffer, or buffer must be deleted (delete[]) + static + const char* formatTimeDiff(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit = HoursMinutesSecondsFraction, unsigned bufferLength = 32, char* buffer = 0); + + ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, returned object manages string memory + static + std::string formatTimeDiffString(double, enum FormatLargestUnit = HoursMinutesSecondsFraction); + + ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, returned object manages string memory + static + std::string formatTimeDiffString(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit = HoursMinutesSecondsFraction); + + static + time_t timegm(struct tm* tm_); + + void normalizeAsDate(); + private: char time_string[32]; // 2001-11-23 12:52:60 056 char iso_time_string[32]; // 2001-11-23T12:52:60.056 From f192f44c71fddee67bdebcec01c3094b954c95de Mon Sep 17 00:00:00 2001 From: Johannes Lode Date: Mon, 21 Jan 2019 16:26:05 +0100 Subject: [PATCH 2/7] Some comments for documentation added. --- rllib/lib/rltime.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rllib/lib/rltime.h b/rllib/lib/rltime.h index 0b32b55e..d8abc265 100644 --- a/rllib/lib/rltime.h +++ b/rllib/lib/rltime.h @@ -93,9 +93,9 @@ class rlTime std::string formatTimeDiffString(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit = HoursMinutesSecondsFraction); static - time_t timegm(struct tm* tm_); + time_t timegm(struct tm* tm_); ///< emulates the POSIX function, which is i.e. under Windows not available - void normalizeAsDate(); + void normalizeAsDate(); ///< normalizes odd constructions of time and date, such 2014-03-36 is normalized to 2014-04-05, simelar oddities for the time are corrected. private: char time_string[32]; // 2001-11-23 12:52:60 056 From e35d6bdc7cdb1f9559aacce48da6607ec1881e21 Mon Sep 17 00:00:00 2001 From: Johannes Lode Date: Mon, 28 Jan 2019 17:06:26 +0100 Subject: [PATCH 3/7] Work in progress. Intermediate commit for transfer to another workstation. --- rllib/lib/rldefine.h | 6 +- rllib/lib/rltime.cpp | 16 +- rllib/lib/rltime.h | 8 +- rllib/lib/rltimeex.cpp | 952 +++++++++++++++++++++++++++++++++++++ rllib/lib/rltimeex.h | 130 +++++ rllib/lib/testrltimeex.cpp | 50 ++ rllib/lib/testrltimeex.sh | 3 + 7 files changed, 1159 insertions(+), 6 deletions(-) create mode 100644 rllib/lib/rltimeex.cpp create mode 100644 rllib/lib/rltimeex.h create mode 100644 rllib/lib/testrltimeex.cpp create mode 100644 rllib/lib/testrltimeex.sh diff --git a/rllib/lib/rldefine.h b/rllib/lib/rldefine.h index c8b16ee9..3cf37ab2 100644 --- a/rllib/lib/rldefine.h +++ b/rllib/lib/rldefine.h @@ -86,6 +86,10 @@ The header that is included in every file of rllib. #define BIT30 256*256*256*64 #define BIT31 256*256*256*128 -#define RLCRLF "\r\n" +#define RLCRLF "\r\n" + +#if __cplusplus >= 201103 +#define RLCPP11 +#endif #endif diff --git a/rllib/lib/rltime.cpp b/rllib/lib/rltime.cpp index 9c214a83..4cb4cbe4 100644 --- a/rllib/lib/rltime.cpp +++ b/rllib/lib/rltime.cpp @@ -195,13 +195,17 @@ void rlTime::getLocalTime() tms = localtime_r(&t, &tmsbuf); gettimeofday(&tv, &tz); + /* adjust year and month */ + tms->tm_year += 1900; + tms->tm_mon += 1; + millisecond = (int)tv.tv_usec / 1000; second = (int)tms->tm_sec; minute = (int)tms->tm_min; hour = (int)tms->tm_hour; day = (int)tms->tm_mday; - month = (int)tms->tm_mon + 1; - year = (int)tms->tm_year + 1900; + month = (int)tms->tm_mon; + year = (int)tms->tm_year; #endif #ifdef __VMS @@ -242,13 +246,17 @@ int rlTime::getFileModificationTime(const char *filename) #endif tms = localtime_r(&statbuf.st_mtime, &tmsbuf); + /* adjust year and month */ + tms->tm_year += 1900; + tms->tm_mon += 1; + millisecond = 0; second = (int)tms->tm_sec; minute = (int)tms->tm_min; hour = (int)tms->tm_hour; day = (int)tms->tm_mday; - month = (int)tms->tm_mon + 1; - year = (int)tms->tm_year + 1900; + month = (int)tms->tm_mon; + year = (int)tms->tm_year; return 0; } diff --git a/rllib/lib/rltime.h b/rllib/lib/rltime.h index d8abc265..4b209458 100644 --- a/rllib/lib/rltime.h +++ b/rllib/lib/rltime.h @@ -28,7 +28,9 @@ class rlTime { public: rlTime(int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0); - rlTime(double) = delete; +#ifdef RLCPP11 + rlTime(double&) = delete; +#endif virtual ~rlTime(); const char *getTimeString(); const char *getIsoTimeString(); @@ -100,5 +102,9 @@ class rlTime private: char time_string[32]; // 2001-11-23 12:52:60 056 char iso_time_string[32]; // 2001-11-23T12:52:60.056 + +#ifndef RLCPP11 + explicit rlTime(double&); // intentionally no implementation, as this shall not be explicit or implicit used +#endif }; #endif diff --git a/rllib/lib/rltimeex.cpp b/rllib/lib/rltimeex.cpp new file mode 100644 index 00000000..4554d114 --- /dev/null +++ b/rllib/lib/rltimeex.cpp @@ -0,0 +1,952 @@ + +/*************************************************************************** + rltime.cpp - description + ------------------- + begin : Tue Jan 02 2001 + copyright : (C) 2001 by R. Lehrig + email : lehrig@t-online.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as * + * published by the Free Software Foundation * + * * + ***************************************************************************/ +#include "rltimeex.h" +#include +#include +#include +#include +#include +#include + +#ifdef RLUNIX +#include +#include +#include +#endif + +#ifdef __VMS +#include +#include +#include +#include +#include +#include +#include +#include +#include +typedef struct +{ + short year; + short month; + short day; + short hour; + short min; + short sec; + short hth; +} +TDS; +typedef struct +{ + long word_1; + long word_2; +} +VAX_BIN_TIME; +#endif + +#ifdef RLWIN32 +#include +#include + +// gmtime_r can be defined by mingw +#ifndef gmtime_r +static struct tm* gmtime_r(const time_t* t, struct tm* r) +{ + // gmtime is threadsafe in windows because it uses TLS + struct tm *theTm = gmtime(t); + if (theTm) { + *r = *theTm; + return r; + } else { + return 0; + } +} +#endif // gmtime_r + +// gmtime_r can be defined by mingw +#ifndef localtime_r +static struct tm* localtime_r(const time_t* t, struct tm* r) +{ + // localtime is threadsafe in windows because it uses TLS + struct tm *theTm = localtime(t); + if (theTm) { + *r = *theTm; + return r; + } else { + return 0; + } +} +#endif // localtime_r + +#endif + +void rlTimeEx::normalizeAsDate() +{ + if (year) + { + // read members + tm t; + memset(&t, 0, sizeof(t)); + t.tm_year = year - 1900; + t.tm_mon = month - 1; + t.tm_mday = day; + t.tm_hour = hour; + t.tm_min = minute; + t.tm_sec = second; + + // normalize milliseconds + while (millisecond > 1000) + { + ++t.tm_sec; + millisecond -= 1000; + } + + // normalize time structure + auto ep = timegm(&t); + gmtime_r(&ep, &t); + + // set members + year = 1900 + t.tm_year; + month = 1 + t.tm_mon; + day = t.tm_mday; + hour = t.tm_hour; + minute = t.tm_min; + second = t.tm_sec; + } +} + +rlTimeEx::rlTimeEx(int Year, int Month, int Day, int Hour, int Minute, int Second, int Millisecond) +{ + year = Year; + month = Month; + day = Day; + hour = Hour; + minute = Minute; + second = Second; + millisecond = Millisecond; + + normalizeAsDate(); +} + +rlTimeEx::~rlTimeEx() +{ +} + +void rlTimeEx::setTimeFromString(const char *time_string) +{ + year = 0; + month = 0; + day = 0; + hour = 0; + minute = 0; + second = 0; + millisecond = 0; + sscanf(time_string,"%d-%d-%d %d:%d:%d %d",&year,&month,&day, &hour,&minute,&second, &millisecond); + normalizeAsDate(); +} + +void rlTimeEx::setTimeFromIsoString(const char *iso_time_string) +{ + year = 0; + month = 0; + day = 0; + hour = 0; + minute = 0; + second = 0; + millisecond = 0; + sscanf(iso_time_string,"%d-%d-%dT%d:%d:%d.%d",&year,&month,&day, &hour,&minute,&second, &millisecond); + normalizeAsDate(); +} + +/*!
+ * seconds := delta time
+ * milliseconds within the fraction
+ * calculating with 1 month <=> 30.5 days
+ 
*/ +void rlTimeEx::setTimeFromSeconds(double seconds) +{ // we assume that the average month has 30.5 days + double mod = fmod(seconds*1000, 1000); + millisecond = (int) mod; + + mod = fmod(seconds, 60); + second = (int) mod; + + seconds /= 60; + mod = fmod(seconds, 60); + minute = (int) mod; + + seconds /= 60; + mod = fmod(seconds, 24); + hour = (int) mod; + + seconds /= 24; + mod = fmod(seconds, 30.5); + day = (int) mod; + + seconds /= 30.5; + mod = fmod(seconds, 12); + month = (int) mod; + + seconds /= 12; + year = (int) seconds; +} + + +const char *rlTimeEx::getTimeString() +{ + sprintf(time_string,"%04d-%02d-%02d %02d:%02d:%02d %03d",year, month, day, hour, minute, second, millisecond); + return time_string; +} + +const char *rlTimeEx::getIsoTimeString() +{ + sprintf(iso_time_string,"%04d-%02d-%02dT%02d:%02d:%02d.%03d",year, month, day, hour, minute, second, millisecond); + return iso_time_string; +} + +/*!
+ * Returns the datetime as a string. The format parameter determines the format of the result string.
+ *
+ * These expressions may be used for the date:
+ * Expression	Output
+ * d	the day as number without a leading zero (1 to 31)
+ * dd	the day as number with a leading zero (01 to 31)
+ * M	the month as number without a leading zero (1-12)
+ * MM	the month as number with a leading zero (01-12)
+ * MMM	the abbreviated localized month name (e.g. 'Jan' to 'Dec').
+ * yy	the year as two digit number (00-99)
+ * yyyy	the year as four digit number
+ *
+ * These expressions may be used for the time:
+ * Expression	Output
+ * h	the hour without a leading zero (1 to 12 if AM/PM display)
+ * hh	the hour with a leading zero (01 to 12 if AM/PM display)
+ * H	the hour without a leading zero (0 to 23, even with AM/PM display)
+ * HH	the hour with a leading zero (00 to 23, even with AM/PM display)
+ * m	the minute without a leading zero (0 to 59)
+ * mm	the minute with a leading zero (00 to 59)
+ * s	the whole second without a leading zero (0 to 59)
+ * ss	the whole second with a leading zero where applicable (00 to 59)
+ * z	the fractional part of the second, to go after a decimal point, without trailing zeroes (0 to 999).
+ * zzz	the fractional part of the second, to millisecond precision, including trailing zeroes where applicable (000 to 999).
+ * AP or A	use AM/PM display. A/AP will be replaced by either "AM" or "PM".
+ * ap or a	use am/pm display. a/ap will be replaced by either "am" or "pm".
+ *
+ * All other input characters will be copyed
+ *
+ * Example format strings (assumed that the rlTime is 21 May 2001 14:13:09.120):
+ * Format	Result
+ * dd.MM.yyyy	    21.05.2001
+ * ddd MMMM d yy	Tue May 21 01
+ * hh:mm:ss.zzz	  14:13:09.120
+ * hh:mm:ss.z	    14:13:09.12
+ * h:m:s ap	      2:13:9 pm
+ 
*/ +const char *rlTimeEx::toString(const char *format) +{ + // See: + // https://doc.qt.io/qt-5/qdatetime.html#toString + // + int ind = 0; + char buf[16]; + char *dest = time_string; + while(*format != '\0') + { + if (strncmp(format,"dd",2) == 0) + { + sprintf(buf,"%02d",day); + strcpy(dest,buf); + dest += strlen(buf); + format += 2; + } + else if(strncmp(format,"d",1) == 0) + { + sprintf(buf,"%d",day); + strcpy(dest,buf); + dest += strlen(buf); + format += 1; + } + else if(strncmp(format,"MMM",3) == 0) + { + buf[0] = '\0'; + if(month == 1) strcpy(buf,"Jan"); + if(month == 2) strcpy(buf,"Feb"); + if(month == 3) strcpy(buf,"Mar"); + if(month == 4) strcpy(buf,"Apr"); + if(month == 5) strcpy(buf,"May"); + if(month == 6) strcpy(buf,"Jun"); + if(month == 7) strcpy(buf,"Jul"); + if(month == 8) strcpy(buf,"Aug"); + if(month == 9) strcpy(buf,"Sep"); + if(month == 10) strcpy(buf,"Oct"); + if(month == 11) strcpy(buf,"Nov"); + if(month == 12) strcpy(buf,"Dec"); + strcpy(dest,buf); + dest += strlen(buf); + format += 3; + } + else if(strncmp(format,"MM",2) == 0) + { + sprintf(buf,"%02d",month); + strcpy(dest,buf); + dest += strlen(buf); + format += 2; + } + else if(strncmp(format,"M",1) == 0) + { + sprintf(buf,"%d",month); + strcpy(dest,buf); + dest += strlen(buf); + format += 1; + } + else if(strncmp(format,"yyyy",4) == 0) + { + sprintf(buf,"%4d",year); + strcpy(dest,buf); + dest += strlen(buf); + format += 4; + } + else if(strncmp(format,"yy",2) == 0) + { + sprintf(buf,"%4d",year); + strcpy(dest,&buf[2]); + dest += strlen(&buf[2]); + format += 2; + } + else if(strncmp(format,"hh",2) == 0) + { + if (hour > 12) sprintf(buf,"%02d", hour - 12); + else if(hour == 0) sprintf(buf,"%02d", 12); + else sprintf(buf,"%02d", hour); + strcpy(dest,buf); + dest += strlen(buf); + format += 2; + } + else if(strncmp(format,"h",1) == 0) + { + if (hour > 12) sprintf(buf,"%2d", hour - 12); + else if(hour == 0) sprintf(buf,"%2d", 12); + else sprintf(buf,"%2d", hour); + strcpy(dest,buf); + dest += strlen(buf); + format += 1; + } + else if(strncmp(format,"HH",2) == 0) + { + sprintf(buf,"%02d",hour); + strcpy(dest,buf); + dest += strlen(buf); + format += 2; + } + else if(strncmp(format,"H",1) == 0) + { + sprintf(buf,"%d",hour); + strcpy(dest,buf); + dest += strlen(buf); + format += 1; + } + else if(strncmp(format,"mm",2) == 0) + { + sprintf(buf,"%02d",minute); + strcpy(dest,buf); + dest += strlen(buf); + format += 2; + } + else if(strncmp(format,"m",1) == 0) + { + sprintf(buf,"%d",minute); + strcpy(dest,buf); + dest += strlen(buf); + format += 1; + } + else if(strncmp(format,"ss",2) == 0) + { + sprintf(buf,"%02d",second); + strcpy(dest,buf); + dest += strlen(buf); + format += 2; + } + else if(strncmp(format,"s",1) == 0) + { + sprintf(buf,"%d",second); + strcpy(dest,buf); + dest += strlen(buf); + format += 1; + } + else if(strncmp(format,"zzz",3) == 0) + { + sprintf(buf,"%03d",millisecond); + strcpy(dest,buf); + dest += strlen(buf); + format += 3; + } + else if(strncmp(format,"z",1) == 0) + { + sprintf(buf,"%d",millisecond); + strcpy(dest,buf); + dest += strlen(buf); + format += 1; + } + else if(strncmp(format,"AP",2) == 0) + { + if (hour == 0) strcpy(dest,"PM"); + else if(hour < 13) strcpy(dest,"AM"); + else strcpy(dest,"PM"); + dest += strlen("AM"); + format += 2; + } + else if(strncmp(format,"ap",2) == 0) + { + if (hour == 0) strcpy(dest,"pm"); + else if(hour < 13) strcpy(dest,"am"); + else strcpy(dest,"pm"); + dest += strlen("am"); + format += 2; + } + else if(strncmp(format,"A",1) == 0) + { + if (hour == 0) strcpy(dest,"PM"); + else if(hour < 13) strcpy(dest,"AM"); + else strcpy(dest,"PM"); + dest += strlen("AM"); + format += 1; + } + else if(strncmp(format,"a",1) == 0) + { + if (hour == 0) strcpy(dest,"pm"); + else if(hour < 13) strcpy(dest,"am"); + else strcpy(dest,"pm"); + dest += strlen("am"); + format += 1; + } + else + { + *dest++ = *format++; + } + if(dest - time_string + 6 > sizeof(time_string)) break; + } + *dest = '\0'; + return time_string; +} + +void rlTimeEx::getLocalTime() +{ +#ifdef RLUNIX + time_t t; + struct tm *tms; + struct tm tmsbuf; + struct timeval tv; + struct timezone tz; + + time(&t); + tms = localtime_r(&t, &tmsbuf); + gettimeofday(&tv, &tz); + + /* adjust year and month */ + tms->tm_year += 1900; + tms->tm_mon += 1; + + millisecond = (int)tv.tv_usec / 1000; + second = (int)tms->tm_sec; + minute = (int)tms->tm_min; + hour = (int)tms->tm_hour; + day = (int)tms->tm_mday; + month = (int)tms->tm_mon; + year = (int)tms->tm_year; +#endif + +#ifdef __VMS + TDS tds; + sys$numtim(&tds, 0); + millisecond = (int)tds.hth * 10; + second = (int)tds.sec; + minute = (int)tds.min; + hour = (int)tds.hour; + day = (int)tds.day; + month = (int)tds.month; + year = (int)tds.year; +#endif + +#ifdef RLWIN32 + SYSTEMTIME st; + GetLocalTime(&st); + millisecond = st.wMilliseconds; + second = st.wSecond; + minute = st.wMinute; + hour = st.wHour; + day = st.wDay; + month = st.wMonth; + year = st.wYear; +#endif +} + +int rlTimeEx::getFileModificationTime(const char *filename) +{ + struct stat statbuf; + struct tm *tms; + struct tm tmsbuf; + +#ifdef RLUNIX + if(lstat(filename,&statbuf)) return -1; +#else + if(stat(filename,&statbuf)) return -1; +#endif + tms = localtime_r(&statbuf.st_mtime, &tmsbuf); + + /* adjust year and month */ + tms->tm_year += 1900; + tms->tm_mon += 1; + + millisecond = 0; + second = (int)tms->tm_sec; + minute = (int)tms->tm_min; + hour = (int)tms->tm_hour; + day = (int)tms->tm_mday; + month = (int)tms->tm_mon; + year = (int)tms->tm_year; + + return 0; +} + +void rlTimeEx::setLocalTime() +{ +#ifdef RLUNIX + struct timeval tv; + struct tm t; + + t.tm_mday = day; + t.tm_mon = month - 1; + t.tm_year = year - 1900; + t.tm_hour = hour; + t.tm_min = minute; + t.tm_sec = second; + tv.tv_sec = mktime(&t); + tv.tv_usec = 1000 * millisecond; + settimeofday(&tv,NULL); +#endif + +#ifdef __VMS + VAX_BIN_TIME vbt; + struct dsc$descriptor_s d_time; + char smonth[12][4],buf[64]; + + // Initialize month array + memset (smonth , 0, sizeof(smonth)); + memcpy (smonth [0], "JAN", 3); + memcpy (smonth [1], "FEB", 3); + memcpy (smonth [2], "MAR", 3); + memcpy (smonth [3], "APR", 3); + memcpy (smonth [4], "MAY", 3); + memcpy (smonth [5], "JUN", 3); + memcpy (smonth [6], "JUL", 3); + memcpy (smonth [7], "AUG", 3); + memcpy (smonth [8], "SEP", 3); + memcpy (smonth [9], "OCT", 3); + memcpy (smonth [10], "NOV", 3); + memcpy (smonth [11], "DEC", 3); + // Create time buffer + sprintf(buf, "%02d-%3.3s-%04d %02d:%02d:%02d.%02d", + day, + smonth[month-1], + year, + hour, + minute, + second, + millisecond / 10); + + // Fill string descriptor + d_time.dsc$w_length = strlen(buf); + d_time.dsc$b_dtype = DSC$K_DTYPE_T; + d_time.dsc$b_class = DSC$K_CLASS_S; + d_time.dsc$a_pointer = buf; + // Convert time buf to VAX bin time + sys$bintim(&d_time, &vbt); + // Set the system time + sys$setime(&vbt); +#endif + +#ifdef RLWIN32 + SYSTEMTIME st; + st.wDay = day; + st.wMonth = month; + st.wYear = year; + st.wHour = hour; + st.wMinute = minute; + st.wSecond = second; + st.wMilliseconds = millisecond; + SetSystemTime(&st); +#endif +} + +rlTime& rlTimeEx::operator+=(time_t seconds) +{ + if (0 > seconds) + return this->operator -=(-seconds); + + auto d = std::div(seconds, time_t(60)); + second += d.rem; + if (d.quot) +{ + d = std::div(d.quot, time_t(60)); + minute += d.rem; + if (d.quot) +{ + d = std::div(d.quot, time_t(24)); + hour += d.rem; + if (d.quot) + { + d = std::div(d.quot, time_t(31)); + day += d.rem; + if (d.quot) + { + d = std::div(d.quot, time_t(12)); + month += d.rem; + year += d.quot; + } + } + } + } + + this->normalizeAsDate(); + + return *this; +} + +rlTime& rlTimeEx::operator-=(time_t seconds) +{ + if (0 > seconds) + return this->operator +=(-seconds); + + auto d = std::div(seconds, time_t(60)); + second -= d.rem; + if (second < 0) + { + ++d.quot; + second += 60; + } + if (d.quot) + { + d = std::div(d.quot, time_t(60)); + minute -= d.rem; + if (minute < 0) + { + ++d.quot; + minute += 60; + } + if (d.quot) + { + d = std::div(d.quot, time_t(24)); + hour -= d.rem; + if (hour < 0) + { + ++d.quot; + hour += 24; + } + if (d.quot) + { + d = std::div(d.quot, time_t(31)); + day -= d.rem; + if (day < 0) + { + ++d.quot; + day += 31; + } + if (d.quot) + { + d = std::div(d.quot, time_t(12)); + month -= d.rem; + if (month < 0) + { + ++d.quot; + month += 12; + } + year -= d.quot; + } + } + } + } + + this->normalizeAsDate(); + + return *this; +} + +rlTime rlTimeEx::operator+(time_t seconds) const +{ + rlTime t(*this); + + t += seconds; + + return t; +} + +rlTime rlTimeEx::operator-(time_t seconds) const +{ + rlTime t(*this); + + t -= seconds; + + return t; +} + +double rlTimeEx::operator-(const rlTime &time) const +{ + return this->secondsSinceEpoche() - time.secondsSinceEpoche(); +} + +int rlTimeEx::operator==(const rlTimeEx &time) const +{ + if(year != time.year) return 0; + if(month != time.month) return 0; + if(day != time.day) return 0; + if(hour != time.hour) return 0; + if(minute != time.minute) return 0; + if(second != time.second) return 0; + if(millisecond != time.millisecond) return 0; + + return 1; +} + +int rlTimeEx::operator<=(const rlTimeEx &time) const +{ + if((*this) == time) return 1; + if((*this) < time) return 1; + return 0; +} + +int rlTimeEx::operator>=(const rlTimeEx &time) const +{ + if((*this) == time) return 1; + if((*this) > time) return 1; + return 0; +} + +int rlTimeEx::operator<(const rlTime &time) const +{ + if (this->year < time.year) + return 1; + else if (this->year == time.year) + { + if (this->month < time.month) + return 1; + else if (this->month == time.month) + { + if (this->day < time.day) + return 1; + else if (this->day == time.day) + { + if (this->hour < time.hour) + return 1; + else if (this->hour == time.hour) + { + if (this->minute < time.minute) + return 1; + else if (this->minute == time.minute) + { + if (this->second < time.second) + return 1; + else if (this->second == time.second) +{ + if (this->millisecond < time.millisecond) + return 1; + } + } + } + } + } + } + + return 0; +} + +int rlTimeEx::operator>(const rlTime &time) const +{ + if (this->year > time.year) + return 1; + else if (this->year == time.year) + { + if (this->month > time.month) + return 1; + else if (this->month == time.month) + { + if (this->day > time.day) + return 1; + else if (this->day == time.day) + { + if (this->hour > time.hour) + return 1; + else if (this->hour == time.hour) + { + if (this->minute > time.minute) + return 1; + else if (this->minute == time.minute) + { + if (this->second > time.second) + return 1; + else if (this->second == time.second) +{ + if (this->millisecond > time.millisecond) + return 1; + } + } + } + } + } + } + + return 0; +} + +time_t rlTimeEx::timegm(struct tm* tm_) +{ + auto t = mktime(tm_); + struct tm ltm; + struct tm gtm; + auto lt = localtime_r(&t, <m); + auto gt = gmtime_r(&t, >m); + auto diff = mktime(lt) - mktime(gt); + return t + diff; +} + +double rlTimeEx::secondsSinceEpoche() const +{ + struct tm begin; + struct tm test; + + memset(&begin,0,sizeof(tm)); + memset(&test,0,sizeof(tm)); + + begin.tm_year = 70; + begin.tm_mon = 0; + begin.tm_mday = 2; // see below + begin.tm_hour = 0; + begin.tm_min = 0; + begin.tm_sec = 0; + begin.tm_isdst = 0; + + test.tm_year = year - 1900; + test.tm_mon = month - 1; + test.tm_mday = day; + test.tm_hour = hour; + test.tm_min = minute; + test.tm_sec = second; + test.tm_isdst = -1; + + time_t t0 = timegm(&begin) - 86400; // a weak workaround: on several platform (especially Windows 7 in Europe Timezones) mktime() is not capable of converting 19070-01-01T00:00:00 into seconds, because they try to convert it into UTC instead of localtime + time_t t1 = mktime(&test); // this might be error prone, see above + + return difftime(t1,t0) + (((double) millisecond) / 1000); +} + + +/** + * seconds := delta time + * milliseconds within the fraction + */ +double rlTimeEx::seconds() const +{ + double ret = (((double) millisecond) / 1000) + second + minute*60 + hour*60*60 + month*60*60*30.5 + year*60*60*30.5*12; + return ret; +} + +const char* rlTimeEx::formatTimeDiff(double tdiff, enum FormatLargestUnit fmt, unsigned bufferLength, char* buffer) +{ + if (0 < bufferLength) + { + if (not buffer) + buffer = new char[bufferLength]; + + bool isNegative = (tdiff < 0); + tdiff = fabs(tdiff); + int milliseconds = ((int) (tdiff * 1000)) % 1000; + time_t seconds = (time_t) tdiff; + lldiv_t minutes, hours, days, weeks; + + minutes = lldiv(seconds, 60); + + const char* fmtString = "%s%d:%02d.%03d"; + switch (fmt) + { + case MinutesSecondsFraction: + fmtString = "%s%d:%02d.%03d"; + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), minutes.quot, minutes.rem, milliseconds); + break; + case HoursMinutesSecondsFraction: + fmtString = "%s%d:%02d:%02d.%03d"; + hours = lldiv(minutes.quot, 60); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), hours.quot, hours.rem, minutes.rem, milliseconds); + break; + case DaysHoursMinutesSecondsFraction: + fmtString = "%s%d:%02d:%02d:%02d.%03d"; + hours = lldiv(minutes.quot, 60); + days = lldiv(hours.quot, 24); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), days.quot, days.rem, hours.rem, minutes.rem, milliseconds); + break; + case WeeksDaysHoursMinutesSecondsFraction: + fmtString = "%s%d:%d:%02d:%02d:%02d.%03d"; + hours = lldiv(minutes.quot, 60); + days = lldiv(hours.quot, 24); + weeks = lldiv(days.quot, 7); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), weeks.quot, weeks.rem, days.rem, hours.rem, minutes.rem, milliseconds); + break; + case MinutesSeconds: + fmtString = "%s%d:%02d"; + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), minutes.quot, minutes.rem); + break; + case HoursMinutesSeconds: + fmtString = "%s%d:%02d:%02d"; + hours = lldiv(minutes.quot, 60); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), hours.quot, hours.rem, minutes.rem); + break; + case DaysHoursMinutesSeconds: + fmtString = "%s%d:%02d:%02d:%02d"; + hours = lldiv(minutes.quot, 60); + days = lldiv(hours.quot, 24); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), days.quot, days.rem, hours.rem, minutes.rem); + break; + case WeeksDaysHoursMinutesSeconds: + fmtString = "%s%d:%d:%02d:%02d:%02d"; + hours = lldiv(minutes.quot, 60); + days = lldiv(hours.quot, 24); + weeks = lldiv(days.quot, 7); + snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), weeks.quot, weeks.rem, days.rem, hours.rem, minutes.rem); + break; + } +} + + return buffer; +} + +const char* rlTimeEx::formatTimeDiff(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit fmt, unsigned bufferLength, char* buffer) +{ + return formatTimeDiff(t2 - t1, fmt, bufferLength, buffer); +} + +std::string rlTimeEx::formatTimeDiffString(double tdiff, enum FormatLargestUnit fmt) +{ + char strBuffer[32]; + + const char* result = formatTimeDiff(tdiff, fmt, sizeof(strBuffer), strBuffer); + + std::string diffStr(result); + + return diffStr; +} + +std::string rlTimeEx::formatTimeDiffString(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit fmt) +{ + return formatTimeDiffString(t2 - t1, fmt); +} diff --git a/rllib/lib/rltimeex.h b/rllib/lib/rltimeex.h new file mode 100644 index 00000000..4217d275 --- /dev/null +++ b/rllib/lib/rltimeex.h @@ -0,0 +1,130 @@ +/*************************************************************************** + rltimeex.h - description + ------------------- + begin : Tue Jan 02 2001 + copyright : (C) 2001 by R. Lehrig + email : lehrig@t-online.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as * + * published by the Free Software Foundation * + * * + ***************************************************************************/ +#ifndef _RL_TIME_EX_H_ +#define _RL_TIME_EX_H_ + +#include "rldefine.h" +#include +#include +#include + +/*!
+class for handling time.
+
*/ +class rlTimeEx +{ +public: + // local time type, on some platforms there is no 2038 safe definition available which we can avoid this way + typedef int64_t time_t; ///< for applying relative adjustments to the time, it's a redefintion on most modern platform, but anyway + typedef double ftime_t; ///< for applying relative adjustments in fractions of a second + + rlTimeEx(int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0); +#ifdef RLCPP11 + rlTimeEx(double&) = delete; +#endif + virtual ~rlTimeEx(); + const char *getTimeString(); + const char *getIsoTimeString(); + const char *toString(const char *format); + void getLocalTime(); + int getFileModificationTime(const char *filename); + + /*!
+  format: sscanf(time_string,"%d-%d-%d %d:%d:%d %d",&year,&month,&day, &hour,&minute,&second, &millisecond);
+  
*/ + void setTimeFromString(const char *time_string); + void setTimeFromIsoString(const char *iso_time_string); + void setTimeFromSeconds(double const &seconds); // we assume 30.5 days per month + + void setLocalTime(); + double secondsSinceEpoche() const; + double seconds() const; // we assume 30.5 days per month + + rlTimeEx& operator+= (rlTimeEx &time); + rlTimeEx& operator-= (rlTimeEx &time); + rlTimeEx operator+ (rlTimeEx &time) const; + rlTimeEx operator- (rlTimeEx &time) const; + + rlTimeEx& operator+= (double const &seconds); // we assume 30.5 days per month + rlTimeEx& operator-= (double const &seconds); // we assume 30.5 days per month + rlTimeEx operator+ (double const &seconds) const; // we assume 30.5 days per month + rlTimeEx operator- (double const &seconds) const; // we assume 30.5 days per month + rlTimeEx& operator+= (time_t seconds); ///< adjust absolute time by number of seconds + rlTimeEx& operator-= (time_t seconds); ///< adjust absolute time by number of seconds + rlTimeEx operator+ (time_t seconds) const; ///< make new object with absolute time adjusted by number of seconds + rlTimeEx operator- (time_t seconds) const; ///< make new object with absolute time adjusted by number of seconds + + rlTimeEx& operator += (const ftime_t& seconds); // we assume 30.5 days per month + rlTimeEx& operator -= (const ftime_t& seconds); // we assume 30.5 days per month + rlTimeEx operator + (const ftime_t& seconds) const; // we assume 30.5 days per month + rlTimeEx operator - (const ftime_t& seconds) const; // we assume 30.5 days per month + + int operator== (const rlTimeEx &time) const; + int operator< (const rlTimeEx &time) const; + int operator<= (const rlTimeEx &time) const; + int operator> (const rlTimeEx &time) const; + int operator>= (const rlTimeEx &time) const; + + int year; + int month; + int day; + int hour; + int minute; + int second; + int millisecond; + + enum FormatLargestUnit + { + MinutesSecondsFraction = 0, ///< "0:00.000", needs at least 9 bytes buffer + HoursMinutesSecondsFraction, ///< "0:00:00.000", needs at least 12 bytes buffer + DaysHoursMinutesSecondsFraction, ///< "0:00:00:00.000", needs at least 15 bytes buffer + WeeksDaysHoursMinutesSecondsFraction, ///< "0:0:00:00:00.000", needs at least 17 bytes buffer + MinutesSeconds, ///< "0:00", needs at least 5 bytes buffer + HoursMinutesSeconds, ///< "0:00:00", needs at least 8 bytes buffer + DaysHoursMinutesSeconds, ///< "0:00:00:00", needs at least 11 bytes buffer + WeeksDaysHoursMinutesSeconds, ///< "0:0:00:00:00", needs at least 13 bytes buffer + }; + + ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, caller provides buffer, or, NULL pointer, buffer must be deleted (delete[]) + static + const char* formatTimeDiff(double, enum FormatLargestUnit = HoursMinutesSecondsFraction, unsigned bufferLength = 32, char* buffer = 0); + + ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, caller provides buffer, or buffer must be deleted (delete[]) + static + const char* formatTimeDiff(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit = HoursMinutesSecondsFraction, unsigned bufferLength = 32, char* buffer = 0); + + ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, returned object manages string memory + static + std::string formatTimeDiffString(double, enum FormatLargestUnit = HoursMinutesSecondsFraction); + + ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, returned object manages string memory + static + std::string formatTimeDiffString(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit = HoursMinutesSecondsFraction); + + static + time_t timegm(struct tm* tm_); ///< emulates the POSIX function, which is i.e. under Windows not available + + void normalizeAsDate(); ///< normalizes odd constructions of time and date, such 2014-03-36 is normalized to 2014-04-05, simelar oddities for the time are corrected. + +private: + char time_string[32*2]; // 2001-11-23 12:52:60 056 + char iso_time_string[32]; // 2001-11-23T12:52:60.056 + +#ifndef RLCPP11 + explicit rlTimeEx(double&); // intentionally no implementation, as this shall not be explicit or implicit used +#endif +}; +#endif diff --git a/rllib/lib/testrltimeex.cpp b/rllib/lib/testrltimeex.cpp new file mode 100644 index 00000000..e1dd04b1 --- /dev/null +++ b/rllib/lib/testrltimeex.cpp @@ -0,0 +1,50 @@ +#include +#include "unistd.h" +#include "rltimeex.h" + +int main() +{ + rlTimeEx now, start, diff, t; + + now.getLocalTime(); + start = now; + /* + while(1) + { + now.getLocalTime(); + diff = now - start; + double ddiff = diff.seconds(); + printf("start=%s now=%s diff=%s seconds=%f\n", start.getIsoTimeString(), now.getIsoTimeString(), diff.getIsoTimeString(), (float) ddiff); + + t.setTimeFromSeconds(ddiff); + printf("ddiff=%lf t=%s seconds()=%f\n", ddiff, t.getIsoTimeString(), t.seconds()); + sleep(1); + } + */ + + /* + double diffsec = 61; + printf("start=%s diffsec=%lf\n", start.getIsoTimeString(), diffsec); + start -= diffsec; + printf("start=%s diffsec=%lf\n", start.getIsoTimeString(), diffsec); + */ + + /* + double diffsec = 61; + printf("start=%s diffsec=%lf\n", start.getIsoTimeString(), diffsec); + now = start - diffsec; + printf(" now=%s diffsec=%lf\n", now.getIsoTimeString(), diffsec); + + printf("toString dd-MMM-yyyy %s\n", now.toString("dd-MMM-yyyy hh:mm:ss zzz")); + printf("toString dd-MM-yyyy %s\n", now.toString("dd-MM-yyyy hh:mm:ss zzz")); + printf("toString d-M-yy %s\n", now.toString("d-M-yy h:m:s z AP")); + */ + + while(1) + { + printf("now=%s\n", now.getIsoTimeString()); + now += 1.01; + sleep(1); + } + return 0; +} diff --git a/rllib/lib/testrltimeex.sh b/rllib/lib/testrltimeex.sh new file mode 100644 index 00000000..98f45a02 --- /dev/null +++ b/rllib/lib/testrltimeex.sh @@ -0,0 +1,3 @@ +#!/bin/bash +g++ -o testrltimeex testrltimeex.cpp rltimeex.cpp -lrllib -I . +./testrltimeex From f783912f9ed2af564635233ace99e53618ec2b4c Mon Sep 17 00:00:00 2001 From: Johannes Lode Date: Thu, 31 Jan 2019 19:20:22 +0100 Subject: [PATCH 4/7] Handling of absolute and relative times distinguished by flag. Meanwhile added a proxy interface, so the traditional interface of operating with two operands of rlTimeEx is available. One small exception is there of returning double for the difference of two rlTimeEx object by default and returning rlTimeEx objects only on request by casting the second operand to RelativeTime(rltime_object). --- rllib/lib/rltimeex.cpp | 1247 ++++++++++++++++++++++++---------------- rllib/lib/rltimeex.h | 166 +++++- 2 files changed, 890 insertions(+), 523 deletions(-) diff --git a/rllib/lib/rltimeex.cpp b/rllib/lib/rltimeex.cpp index 4554d114..ee0fbade 100644 --- a/rllib/lib/rltimeex.cpp +++ b/rllib/lib/rltimeex.cpp @@ -1,10 +1,9 @@ - /*************************************************************************** - rltime.cpp - description - ------------------- - begin : Tue Jan 02 2001 - copyright : (C) 2001 by R. Lehrig - email : lehrig@t-online.de + rltime.cpp - description + ------------------- + begin : Tue Jan 02 2001 + copyright : (C) 2001 by R. Lehrig + email : lehrig@t-online.de ***************************************************************************/ /*************************************************************************** @@ -20,7 +19,8 @@ #include #include #include -#include +#include +#include #ifdef RLUNIX #include @@ -60,115 +60,222 @@ VAX_BIN_TIME; #ifdef RLWIN32 #include #include - -// gmtime_r can be defined by mingw -#ifndef gmtime_r -static struct tm* gmtime_r(const time_t* t, struct tm* r) -{ - // gmtime is threadsafe in windows because it uses TLS - struct tm *theTm = gmtime(t); - if (theTm) { - *r = *theTm; - return r; - } else { - return 0; - } -} -#endif // gmtime_r - -// gmtime_r can be defined by mingw -#ifndef localtime_r -static struct tm* localtime_r(const time_t* t, struct tm* r) -{ - // localtime is threadsafe in windows because it uses TLS - struct tm *theTm = localtime(t); - if (theTm) { - *r = *theTm; - return r; - } else { - return 0; - } -} -#endif // localtime_r - + +// gmtime_r can be defined by mingw +#ifndef gmtime_r +static struct tm* gmtime_r(const time_t* t, struct tm* r) +{ + // gmtime is threadsafe in windows because it uses TLS + struct tm *theTm = gmtime(t); + if (theTm) + { + *r = *theTm; + return r; + } + else + { + return 0; + } +} +#endif // gmtime_r + +// gmtime_r can be defined by mingw +#ifndef localtime_r +static struct tm* localtime_r(const time_t* t, struct tm* r) +{ + // localtime is threadsafe in windows because it uses TLS + struct tm *theTm = localtime(t); + if (theTm) + { + *r = *theTm; + return r; + } + else + { + return 0; + } +} +#endif // localtime_r + #endif -void rlTimeEx::normalizeAsDate() -{ - if (year) - { - // read members - tm t; - memset(&t, 0, sizeof(t)); - t.tm_year = year - 1900; - t.tm_mon = month - 1; - t.tm_mday = day; - t.tm_hour = hour; - t.tm_min = minute; - t.tm_sec = second; - - // normalize milliseconds - while (millisecond > 1000) - { - ++t.tm_sec; - millisecond -= 1000; - } - - // normalize time structure - auto ep = timegm(&t); - gmtime_r(&ep, &t); - - // set members - year = 1900 + t.tm_year; - month = 1 + t.tm_mon; - day = t.tm_mday; - hour = t.tm_hour; - minute = t.tm_min; - second = t.tm_sec; - } -} - -rlTimeEx::rlTimeEx(int Year, int Month, int Day, int Hour, int Minute, int Second, int Millisecond) +void rlTimeEx::normalizeAsRelativeTime() { - year = Year; - month = Month; - day = Day; - hour = Hour; - minute = Minute; - second = Second; - millisecond = Millisecond; - - normalizeAsDate(); + assert(objectHoldsRelativeTime && "object must represent relative time, otherwise normalization as relative time is not defined"); + + // accumulate years and months into days, assuming 30.5 days per month and 365.25 days per year + if (year != 0) + { + day += year * 365 + (year / 4); + year = 0; + } + + if (month != 0) + { + day += month * 30 + (month / 2); + month = 0; + } + + if ( + (1000 <= std::abs(millisecond)) or + (60 <= std::abs(second)) or + (60 <= std::abs(minute)) or + (24 <= std::abs(hour)) + ) + { + time_t linear_value = second + (minute * 60) + (hour * 60 * 60) + (day * 24 * 60 * 60); + + // normalize milliseconds + std::lldiv_t d = std::lldiv(millisecond, 1000); + millisecond = d.rem; + while (0 > millisecond) + { + millisecond += 1000; + --d.quot; + } + + // adjust linear value + linear_value += d.quot; + + // normalize milliseconds to negative, if linear value is negative + if (0 > linear_value) + { + if (0 < millisecond) + { + millisecond -= 1000; + ++linear_value; + } + } + + // decompose linear value + if (linear_value) + { + d = std::lldiv(linear_value, 60); + second = d.rem; + if (d.quot) + { + d = std::lldiv(d.quot, 60); + minute = d.rem; + if (d.quot) + { + d = std::lldiv(d.quot, 24); + hour = d.rem; + day = d.quot; + } + } + } + } } -rlTimeEx::~rlTimeEx() +void rlTimeEx::normalizeAsDate() +{ + assert( + not objectHoldsRelativeTime + && "object must represent absolute time and date, otherwise normalization as time and date is not defined"); + assert(year >= 1970); + + if (year) + { + // read members + tm t; + memset(&t, 0, sizeof(t)); + t.tm_year = year - 1900; + t.tm_mon = month - 1; + t.tm_mday = day; + t.tm_hour = hour; + t.tm_min = minute; + t.tm_sec = second; + + // normalize milliseconds + while (millisecond > 1000) + { + ++t.tm_sec; + millisecond -= 1000; + } + + // normalize time structure + auto ep = timegm(&t); + gmtime_r(&ep, &t); + + // set members + year = 1900 + t.tm_year; + month = 1 + t.tm_mon; + day = t.tm_mday; + hour = t.tm_hour; + minute = t.tm_min; + second = t.tm_sec; + } +} + +rlTimeEx::rlTimeEx(int Year, int Month, int Day, int Hour, int Minute, int Second, int Millisecond) { + year = Year; + month = Month; + day = Day; + hour = Hour; + minute = Minute; + second = Second; + millisecond = Millisecond; + + if (1970 <= year) + { + objectHoldsRelativeTime = false; + normalizeAsDate(); + } + else + { + objectHoldsRelativeTime = true; + normalizeAsRelativeTime(); + } } -void rlTimeEx::setTimeFromString(const char *time_string) +rlTimeEx::~rlTimeEx() +{} + +/*** + * Read an absolute point in time from time_string. + * + * This method expects a time formatted as in return from getTimeString(), + * following the template "YYYY-MM-DD hh:mm:ss ms". + * @param time_string + */ +rlTimeEx& rlTimeEx::setTimeFromString(const char *time_string) { - year = 0; - month = 0; - day = 0; - hour = 0; - minute = 0; - second = 0; + year = 0; + month = 0; + day = 0; + hour = 0; + minute = 0; + second = 0; millisecond = 0; - sscanf(time_string,"%d-%d-%d %d:%d:%d %d",&year,&month,&day, &hour,&minute,&second, &millisecond); - normalizeAsDate(); + objectHoldsRelativeTime = false; + sscanf(time_string, "%d-%d-%d %d:%d:%d %d", &year, &month, &day, &hour, &minute, &second, &millisecond); + normalizeAsDate(); + + return *this; } -void rlTimeEx::setTimeFromIsoString(const char *iso_time_string) +/*** + * Read an absolute point in time from time_string. + * + * This method expects a time formatted as in return from getIsoTimeString(), + * following the template "YYYY-MM-DDThh:mm:ss.xxx". + * @param time_string + */ +rlTimeEx& rlTimeEx::setTimeFromIsoString(const char *iso_time_string) { - year = 0; - month = 0; - day = 0; - hour = 0; - minute = 0; - second = 0; + year = 0; + month = 0; + day = 0; + hour = 0; + minute = 0; + second = 0; millisecond = 0; - sscanf(iso_time_string,"%d-%d-%dT%d:%d:%d.%d",&year,&month,&day, &hour,&minute,&second, &millisecond); - normalizeAsDate(); + objectHoldsRelativeTime = false; + sscanf(iso_time_string, "%d-%d-%dT%d:%d:%d.%d", &year, &month, &day, &hour, &minute, &second, &millisecond); + normalizeAsDate(); + + return *this; } /*!
@@ -176,44 +283,52 @@ void rlTimeEx::setTimeFromIsoString(const char *iso_time_string)
  * milliseconds within the fraction
  * calculating with 1 month <=> 30.5 days
  
*/ -void rlTimeEx::setTimeFromSeconds(double seconds) +rlTimeEx& rlTimeEx::setTimeFromSeconds(double seconds) { // we assume that the average month has 30.5 days - double mod = fmod(seconds*1000, 1000); + double mod = fmod(seconds * 1000, 1000.); millisecond = (int) mod; - mod = fmod(seconds, 60); + mod = fmod(seconds, 60.); second = (int) mod; seconds /= 60; - mod = fmod(seconds, 60); + mod = fmod(seconds, 60.); minute = (int) mod; seconds /= 60; - mod = fmod(seconds, 24); + mod = fmod(seconds, 24.); hour = (int) mod; seconds /= 24; - mod = fmod(seconds, 30.5); - day = (int) mod; + day = int(seconds); - seconds /= 30.5; - mod = fmod(seconds, 12); - month = (int) mod; +// mod = fmod(seconds, 30.5); +// day = (int) mod; +// +// seconds /= 30.5; +// mod = fmod(seconds, 12); +// month = (int) mod; +// +// seconds /= 12; +// year = (int) seconds; - seconds /= 12; - year = (int) seconds; -} + objectHoldsRelativeTime = true; + normalizeAsRelativeTime(); + return *this; +} const char *rlTimeEx::getTimeString() { - sprintf(time_string,"%04d-%02d-%02d %02d:%02d:%02d %03d",year, month, day, hour, minute, second, millisecond); + assert(not objectHoldsRelativeTime && "object mus hold an absolute time and date"); + sprintf(time_string, "%04d-%02d-%02d %02d:%02d:%02d %03d", year, month, day, hour, minute, second, millisecond); return time_string; } const char *rlTimeEx::getIsoTimeString() { - sprintf(iso_time_string,"%04d-%02d-%02dT%02d:%02d:%02d.%03d",year, month, day, hour, minute, second, millisecond); + assert(not objectHoldsRelativeTime && "object mus hold an absolute time and date"); + sprintf(iso_time_string, "%04d-%02d-%02dT%02d:%02d:%02d.%03d", year, month, day, hour, minute, second, millisecond); return iso_time_string; } @@ -221,65 +336,64 @@ const char *rlTimeEx::getIsoTimeString() * Returns the datetime as a string. The format parameter determines the format of the result string. * * These expressions may be used for the date: - * Expression Output - * d the day as number without a leading zero (1 to 31) - * dd the day as number with a leading zero (01 to 31) - * M the month as number without a leading zero (1-12) - * MM the month as number with a leading zero (01-12) - * MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). - * yy the year as two digit number (00-99) - * yyyy the year as four digit number + * Expression Output + * d the day as number without a leading zero (1 to 31) + * dd the day as number with a leading zero (01 to 31) + * M the month as number without a leading zero (1-12) + * MM the month as number with a leading zero (01-12) + * MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). + * yy the year as two digit number (00-99) + * yyyy the year as four digit number * * These expressions may be used for the time: - * Expression Output - * h the hour without a leading zero (1 to 12 if AM/PM display) - * hh the hour with a leading zero (01 to 12 if AM/PM display) - * H the hour without a leading zero (0 to 23, even with AM/PM display) - * HH the hour with a leading zero (00 to 23, even with AM/PM display) - * m the minute without a leading zero (0 to 59) - * mm the minute with a leading zero (00 to 59) - * s the whole second without a leading zero (0 to 59) - * ss the whole second with a leading zero where applicable (00 to 59) - * z the fractional part of the second, to go after a decimal point, without trailing zeroes (0 to 999). - * zzz the fractional part of the second, to millisecond precision, including trailing zeroes where applicable (000 to 999). - * AP or A use AM/PM display. A/AP will be replaced by either "AM" or "PM". - * ap or a use am/pm display. a/ap will be replaced by either "am" or "pm". + * Expression Output + * h the hour without a leading zero (1 to 12 if AM/PM display) + * hh the hour with a leading zero (01 to 12 if AM/PM display) + * H the hour without a leading zero (0 to 23, even with AM/PM display) + * HH the hour with a leading zero (00 to 23, even with AM/PM display) + * m the minute without a leading zero (0 to 59) + * mm the minute with a leading zero (00 to 59) + * s the whole second without a leading zero (0 to 59) + * ss the whole second with a leading zero where applicable (00 to 59) + * z the fractional part of the second, to go after a decimal point, without trailing zeroes (0 to 999). + * zzz the fractional part of the second, to millisecond precision, including trailing zeroes where applicable (000 to 999). + * AP or A use AM/PM display. A/AP will be replaced by either "AM" or "PM". + * ap or a use am/pm display. a/ap will be replaced by either "am" or "pm". * * All other input characters will be copyed * - * Example format strings (assumed that the rlTime is 21 May 2001 14:13:09.120): - * Format Result - * dd.MM.yyyy 21.05.2001 - * ddd MMMM d yy Tue May 21 01 - * hh:mm:ss.zzz 14:13:09.120 - * hh:mm:ss.z 14:13:09.12 - * h:m:s ap 2:13:9 pm + * Example format strings (assumed that the rlTimeEx is 21 May 2001 14:13:09.120): + * Format Result + * dd.MM.yyyy 21.05.2001 + * ddd MMMM d yy Tue May 21 01 + * hh:mm:ss.zzz 14:13:09.120 + * hh:mm:ss.z 14:13:09.12 + * h:m:s ap 2:13:9 pm */ const char *rlTimeEx::toString(const char *format) { // See: // https://doc.qt.io/qt-5/qdatetime.html#toString // - int ind = 0; char buf[16]; char *dest = time_string; - while(*format != '\0') + while (*format != '\0') { - if (strncmp(format,"dd",2) == 0) + if (strncmp(format, "dd", 2) == 0) { - sprintf(buf,"%02d",day); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%02d", day); + strcpy(dest, buf); + dest += strlen(buf); format += 2; } - else if(strncmp(format,"d",1) == 0) + else if (strncmp(format, "d", 1) == 0) { - sprintf(buf,"%d",day); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%d", day); + strcpy(dest, buf); + dest += strlen(buf); format += 1; } - else if(strncmp(format,"MMM",3) == 0) + else if (strncmp(format, "MMM", 3) == 0) { buf[0] = '\0'; if(month == 1) strcpy(buf,"Jan"); @@ -294,213 +408,238 @@ const char *rlTimeEx::toString(const char *format) if(month == 10) strcpy(buf,"Oct"); if(month == 11) strcpy(buf,"Nov"); if(month == 12) strcpy(buf,"Dec"); - strcpy(dest,buf); - dest += strlen(buf); + strcpy(dest, buf); + dest += strlen(buf); format += 3; } - else if(strncmp(format,"MM",2) == 0) + else if (strncmp(format, "MM", 2) == 0) { - sprintf(buf,"%02d",month); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%02d", month); + strcpy(dest, buf); + dest += strlen(buf); format += 2; } - else if(strncmp(format,"M",1) == 0) + else if (strncmp(format, "M", 1) == 0) { - sprintf(buf,"%d",month); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%d", month); + strcpy(dest, buf); + dest += strlen(buf); format += 1; } - else if(strncmp(format,"yyyy",4) == 0) + else if (strncmp(format, "yyyy", 4) == 0) { - sprintf(buf,"%4d",year); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%4d", year); + strcpy(dest, buf); + dest += strlen(buf); format += 4; } - else if(strncmp(format,"yy",2) == 0) + else if (strncmp(format, "yy", 2) == 0) { - sprintf(buf,"%4d",year); - strcpy(dest,&buf[2]); - dest += strlen(&buf[2]); + sprintf(buf, "%4d", year); + strcpy(dest, &buf[2]); + dest += strlen(&buf[2]); format += 2; } - else if(strncmp(format,"hh",2) == 0) + else if (strncmp(format, "hh", 2) == 0) { - if (hour > 12) sprintf(buf,"%02d", hour - 12); - else if(hour == 0) sprintf(buf,"%02d", 12); - else sprintf(buf,"%02d", hour); - strcpy(dest,buf); - dest += strlen(buf); + if (hour > 12) + sprintf(buf, "%02d", hour - 12); + else if (hour == 0) + sprintf(buf, "%02d", 12); + else + sprintf(buf, "%02d", hour); + strcpy(dest, buf); + dest += strlen(buf); format += 2; } - else if(strncmp(format,"h",1) == 0) + else if (strncmp(format, "h", 1) == 0) { - if (hour > 12) sprintf(buf,"%2d", hour - 12); - else if(hour == 0) sprintf(buf,"%2d", 12); - else sprintf(buf,"%2d", hour); - strcpy(dest,buf); - dest += strlen(buf); + if (hour > 12) + sprintf(buf, "%2d", hour - 12); + else if (hour == 0) + sprintf(buf, "%2d", 12); + else + sprintf(buf, "%2d", hour); + strcpy(dest, buf); + dest += strlen(buf); format += 1; } - else if(strncmp(format,"HH",2) == 0) + else if (strncmp(format, "HH", 2) == 0) { - sprintf(buf,"%02d",hour); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%02d", hour); + strcpy(dest, buf); + dest += strlen(buf); format += 2; } - else if(strncmp(format,"H",1) == 0) + else if (strncmp(format, "H", 1) == 0) { - sprintf(buf,"%d",hour); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%d", hour); + strcpy(dest, buf); + dest += strlen(buf); format += 1; } - else if(strncmp(format,"mm",2) == 0) + else if (strncmp(format, "mm", 2) == 0) { - sprintf(buf,"%02d",minute); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%02d", minute); + strcpy(dest, buf); + dest += strlen(buf); format += 2; } - else if(strncmp(format,"m",1) == 0) + else if (strncmp(format, "m", 1) == 0) { - sprintf(buf,"%d",minute); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%d", minute); + strcpy(dest, buf); + dest += strlen(buf); format += 1; } - else if(strncmp(format,"ss",2) == 0) + else if (strncmp(format, "ss", 2) == 0) { - sprintf(buf,"%02d",second); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%02d", second); + strcpy(dest, buf); + dest += strlen(buf); format += 2; } - else if(strncmp(format,"s",1) == 0) + else if (strncmp(format, "s", 1) == 0) { - sprintf(buf,"%d",second); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%d", second); + strcpy(dest, buf); + dest += strlen(buf); format += 1; } - else if(strncmp(format,"zzz",3) == 0) + else if (strncmp(format, "zzz", 3) == 0) { - sprintf(buf,"%03d",millisecond); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%03d", millisecond); + strcpy(dest, buf); + dest += strlen(buf); format += 3; } - else if(strncmp(format,"z",1) == 0) + else if (strncmp(format, "z", 1) == 0) { - sprintf(buf,"%d",millisecond); - strcpy(dest,buf); - dest += strlen(buf); + sprintf(buf, "%d", millisecond); + strcpy(dest, buf); + dest += strlen(buf); format += 1; } - else if(strncmp(format,"AP",2) == 0) + else if (strncmp(format, "AP", 2) == 0) { - if (hour == 0) strcpy(dest,"PM"); - else if(hour < 13) strcpy(dest,"AM"); - else strcpy(dest,"PM"); - dest += strlen("AM"); + if (hour == 0) + strcpy(dest, "PM"); + else if (hour < 13) + strcpy(dest, "AM"); + else + strcpy(dest, "PM"); + dest += strlen("AM"); format += 2; } - else if(strncmp(format,"ap",2) == 0) + else if (strncmp(format, "ap", 2) == 0) { - if (hour == 0) strcpy(dest,"pm"); - else if(hour < 13) strcpy(dest,"am"); - else strcpy(dest,"pm"); - dest += strlen("am"); + if (hour == 0) + strcpy(dest, "pm"); + else if (hour < 13) + strcpy(dest, "am"); + else + strcpy(dest, "pm"); + dest += strlen("am"); format += 2; } - else if(strncmp(format,"A",1) == 0) + else if (strncmp(format, "A", 1) == 0) { - if (hour == 0) strcpy(dest,"PM"); - else if(hour < 13) strcpy(dest,"AM"); - else strcpy(dest,"PM"); - dest += strlen("AM"); + if (hour == 0) + strcpy(dest, "PM"); + else if (hour < 13) + strcpy(dest, "AM"); + else + strcpy(dest, "PM"); + dest += strlen("AM"); format += 1; } - else if(strncmp(format,"a",1) == 0) + else if (strncmp(format, "a", 1) == 0) { - if (hour == 0) strcpy(dest,"pm"); - else if(hour < 13) strcpy(dest,"am"); - else strcpy(dest,"pm"); - dest += strlen("am"); + if (hour == 0) + strcpy(dest, "pm"); + else if (hour < 13) + strcpy(dest, "am"); + else + strcpy(dest, "pm"); + dest += strlen("am"); format += 1; } else { *dest++ = *format++; } - if(dest - time_string + 6 > sizeof(time_string)) break; + + if (unsigned(dest - time_string + 6) > sizeof(time_string)) + break; } *dest = '\0'; return time_string; } -void rlTimeEx::getLocalTime() +rlTimeEx& rlTimeEx::getLocalTime() { #ifdef RLUNIX time_t t; - struct tm *tms; - struct tm tmsbuf; - struct timeval tv; + struct tm *tms; + struct tm tmsbuf; + struct timeval tv; struct timezone tz; time(&t); - tms = localtime_r(&t, &tmsbuf); + tms = localtime_r(&t, &tmsbuf); gettimeofday(&tv, &tz); /* adjust year and month */ tms->tm_year += 1900; tms->tm_mon += 1; - millisecond = (int)tv.tv_usec / 1000; - second = (int)tms->tm_sec; - minute = (int)tms->tm_min; - hour = (int)tms->tm_hour; - day = (int)tms->tm_mday; + millisecond = (int) tv.tv_usec / 1000; + second = (int) tms->tm_sec; + minute = (int) tms->tm_min; + hour = (int) tms->tm_hour; + day = (int) tms->tm_mday; month = (int)tms->tm_mon; year = (int)tms->tm_year; #endif #ifdef __VMS - TDS tds; + TDS tds; sys$numtim(&tds, 0); - millisecond = (int)tds.hth * 10; - second = (int)tds.sec; - minute = (int)tds.min; - hour = (int)tds.hour; - day = (int)tds.day; - month = (int)tds.month; - year = (int)tds.year; + millisecond = (int)tds.hth * 10; + second = (int)tds.sec; + minute = (int)tds.min; + hour = (int)tds.hour; + day = (int)tds.day; + month = (int)tds.month; + year = (int)tds.year; #endif #ifdef RLWIN32 SYSTEMTIME st; GetLocalTime(&st); - millisecond = st.wMilliseconds; - second = st.wSecond; - minute = st.wMinute; - hour = st.wHour; - day = st.wDay; - month = st.wMonth; - year = st.wYear; + millisecond = st.wMilliseconds; + second = st.wSecond; + minute = st.wMinute; + hour = st.wHour; + day = st.wDay; + month = st.wMonth; + year = st.wYear; #endif + + objectHoldsRelativeTime = false; + + return *this; } int rlTimeEx::getFileModificationTime(const char *filename) { struct stat statbuf; struct tm *tms; - struct tm tmsbuf; + struct tm tmsbuf; #ifdef RLUNIX - if(lstat(filename,&statbuf)) return -1; + if (lstat(filename, &statbuf)) + return -1; #else if(stat(filename,&statbuf)) return -1; #endif @@ -511,66 +650,69 @@ int rlTimeEx::getFileModificationTime(const char *filename) tms->tm_mon += 1; millisecond = 0; - second = (int)tms->tm_sec; - minute = (int)tms->tm_min; - hour = (int)tms->tm_hour; - day = (int)tms->tm_mday; - month = (int)tms->tm_mon; - year = (int)tms->tm_year; + second = (int) tms->tm_sec; + minute = (int) tms->tm_min; + hour = (int) tms->tm_hour; + day = (int) tms->tm_mday; + month = (int) tms->tm_mon; + year = (int) tms->tm_year; + objectHoldsRelativeTime = false; return 0; } void rlTimeEx::setLocalTime() { + assert(not this->objectHoldsRelativeTime && "cannot set local time/clock from relative time object"); + #ifdef RLUNIX struct timeval tv; struct tm t; - t.tm_mday = day; - t.tm_mon = month - 1; - t.tm_year = year - 1900; - t.tm_hour = hour; - t.tm_min = minute; - t.tm_sec = second; - tv.tv_sec = mktime(&t); + t.tm_mday = day; + t.tm_mon = month - 1; + t.tm_year = year - 1900; + t.tm_hour = hour; + t.tm_min = minute; + t.tm_sec = second; + tv.tv_sec = mktime(&t); tv.tv_usec = 1000 * millisecond; - settimeofday(&tv,NULL); + settimeofday(&tv, NULL); #endif #ifdef __VMS VAX_BIN_TIME vbt; - struct dsc$descriptor_s d_time; + struct dsc$descriptor_s d_time; char smonth[12][4],buf[64]; // Initialize month array - memset (smonth , 0, sizeof(smonth)); - memcpy (smonth [0], "JAN", 3); - memcpy (smonth [1], "FEB", 3); - memcpy (smonth [2], "MAR", 3); - memcpy (smonth [3], "APR", 3); - memcpy (smonth [4], "MAY", 3); - memcpy (smonth [5], "JUN", 3); - memcpy (smonth [6], "JUL", 3); - memcpy (smonth [7], "AUG", 3); - memcpy (smonth [8], "SEP", 3); - memcpy (smonth [9], "OCT", 3); + memset (smonth , 0, sizeof(smonth)); + memcpy (smonth [0], "JAN", 3); + memcpy (smonth [1], "FEB", 3); + memcpy (smonth [2], "MAR", 3); + memcpy (smonth [3], "APR", 3); + memcpy (smonth [4], "MAY", 3); + memcpy (smonth [5], "JUN", 3); + memcpy (smonth [6], "JUL", 3); + memcpy (smonth [7], "AUG", 3); + memcpy (smonth [8], "SEP", 3); + memcpy (smonth [9], "OCT", 3); memcpy (smonth [10], "NOV", 3); memcpy (smonth [11], "DEC", 3); // Create time buffer sprintf(buf, "%02d-%3.3s-%04d %02d:%02d:%02d.%02d", - day, - smonth[month-1], - year, - hour, - minute, - second, - millisecond / 10); + day, + smonth[month-1], + year, + hour, + minute, + second, + millisecond / 10); // Fill string descriptor - d_time.dsc$w_length = strlen(buf); - d_time.dsc$b_dtype = DSC$K_DTYPE_T; - d_time.dsc$b_class = DSC$K_CLASS_S; + d_time.dsc$w_length = strlen(buf); + d_time.dsc$b_dtype = DSC$K_DTYPE_T; + d_time.dsc$b_class = DSC$K_CLASS_S; d_time.dsc$a_pointer = buf; // Convert time buf to VAX bin time sys$bintim(&d_time, &vbt); @@ -580,135 +722,245 @@ void rlTimeEx::setLocalTime() #ifdef RLWIN32 SYSTEMTIME st; - st.wDay = day; - st.wMonth = month; - st.wYear = year; - st.wHour = hour; - st.wMinute = minute; - st.wSecond = second; + st.wDay = day; + st.wMonth = month; + st.wYear = year; + st.wHour = hour; + st.wMinute = minute; + st.wSecond = second; st.wMilliseconds = millisecond; SetSystemTime(&st); #endif + + objectHoldsRelativeTime = false; } -rlTime& rlTimeEx::operator+=(time_t seconds) +rlTimeEx& rlTimeEx::operator+=(time_t seconds) { - if (0 > seconds) - return this->operator -=(-seconds); + if (0 > seconds) + return this->operator -=(-seconds); - auto d = std::div(seconds, time_t(60)); - second += d.rem; - if (d.quot) -{ - d = std::div(d.quot, time_t(60)); - minute += d.rem; - if (d.quot) -{ - d = std::div(d.quot, time_t(24)); - hour += d.rem; - if (d.quot) + std::lldiv_t d = std::lldiv(seconds, time_t(60)); + second += d.rem; + if (d.quot) { - d = std::div(d.quot, time_t(31)); - day += d.rem; - if (d.quot) + d = std::lldiv(d.quot, time_t(60)); + minute += d.rem; + if (d.quot) + { + d = std::lldiv(d.quot, time_t(24)); + hour += d.rem; + if (d.quot) { - d = std::div(d.quot, time_t(12)); - month += d.rem; - year += d.quot; - } - } + if (not objectHoldsRelativeTime) + { + d = std::lldiv(d.quot, time_t(31)); + day += d.rem; + if (d.quot) + { + d = std::lldiv(d.quot, time_t(12)); + month += d.rem; + year += d.quot; + } + } + else // do not split remaining days down to months and years, as this is not linear + { + day += d.quot; + } } + } } - this->normalizeAsDate(); - - return *this; + // now normalize the values, as this is not done above + if (not objectHoldsRelativeTime) + normalizeAsDate(); + else + normalizeAsRelativeTime(); + + return *this; } -rlTime& rlTimeEx::operator-=(time_t seconds) +rlTimeEx& rlTimeEx::operator-=(time_t seconds) { - if (0 > seconds) - return this->operator +=(-seconds); + if (0 > seconds) + return this->operator +=(-seconds); - auto d = std::div(seconds, time_t(60)); - second -= d.rem; - if (second < 0) + std::lldiv_t d = std::lldiv(seconds, time_t(60)); + second -= d.rem; + if (second < 0) { - ++d.quot; - second += 60; - } - if (d.quot) + ++d.quot; + second += 60; + } + if (d.quot) { - d = std::div(d.quot, time_t(60)); - minute -= d.rem; - if (minute < 0) - { - ++d.quot; - minute += 60; - } - if (d.quot) - { - d = std::div(d.quot, time_t(24)); - hour -= d.rem; - if (hour < 0) - { - ++d.quot; - hour += 24; - } - if (d.quot) - { - d = std::div(d.quot, time_t(31)); - day -= d.rem; - if (day < 0) - { - ++d.quot; - day += 31; - } - if (d.quot) - { - d = std::div(d.quot, time_t(12)); - month -= d.rem; - if (month < 0) + d = std::lldiv(d.quot, time_t(60)); + minute -= d.rem; + if (minute < 0) + { + ++d.quot; + minute += 60; + } + if (d.quot) + { + d = std::lldiv(d.quot, time_t(24)); + hour -= d.rem; + if (hour < 0) + { + ++d.quot; + hour += 24; + } + if (d.quot) + { + if (not objectHoldsRelativeTime) + { + d = std::lldiv(d.quot, time_t(31)); + day -= d.rem; + if (day < 0) + { + ++d.quot; + day += 31; + } + if (d.quot) { - ++d.quot; - month += 12; - } - year -= d.quot; - } - } + d = std::lldiv(d.quot, time_t(12)); + month -= d.rem; + if (month < 0) + { + ++d.quot; + month += 12; + } + year -= d.quot; + } + } + else // do not split remaining days down to months and years, as this is not linear + { + day -= d.quot; + } + } } } - this->normalizeAsDate(); + // now normalize the values, as this is not done above + if (not objectHoldsRelativeTime) + normalizeAsDate(); + else + normalizeAsRelativeTime(); return *this; } -rlTime rlTimeEx::operator+(time_t seconds) const +rlTimeEx rlTimeEx::operator+(time_t seconds) const + { + rlTimeEx t(*this); + + t += seconds; + + return t; +} + +rlTimeEx rlTimeEx::operator-(time_t seconds) const + { + rlTimeEx t(*this); + + t -= seconds; + + return t; +} + +rlTimeEx& rlTimeEx::operator +=(const ftime_t& seconds) { - rlTime t(*this); - - t += seconds; - - return t; + int ms = fmod(round(seconds * 1000.), 1000.); + time_t sec = time_t(seconds); + + millisecond += ms; + *this += sec; + + return *this; } -rlTime rlTimeEx::operator-(time_t seconds) const +rlTimeEx& rlTimeEx::operator -=(const ftime_t& seconds) { - rlTime t(*this); - - t -= seconds; - + int ms = fmod(round(seconds * 1000.), 1000.); + time_t sec = time_t(seconds); + + millisecond -= ms; + *this -= sec; + + return *this; +} + +rlTimeEx rlTimeEx::operator +(const ftime_t& seconds) const + { + rlTimeEx t(*this); + + t += seconds; + return t; } -double rlTimeEx::operator-(const rlTime &time) const +rlTimeEx rlTimeEx::operator -(const ftime_t& seconds) const + { + rlTimeEx t(*this); + + t -= seconds; + + return t; +} + +rlTimeEx& rlTimeEx::operator+=(const RelativeTime &t) { - return this->secondsSinceEpoche() - time.secondsSinceEpoche(); + time_t linear_value = t.m_myParent_.second + (t.m_myParent_.minute * 60) + (t.m_myParent_.hour * 60 * 60) + (t.m_myParent_.day * 24 * 60 * 60); + this->millisecond += t.m_myParent_.millisecond; + *this += linear_value; + + return *this; } -int rlTimeEx::operator==(const rlTimeEx &time) const +rlTimeEx& rlTimeEx::operator-=(const RelativeTime &t) { + time_t linear_value = t.m_myParent_.second + (t.m_myParent_.minute * 60) + (t.m_myParent_.hour * 60 * 60) + (t.m_myParent_.day * 24 * 60 * 60); + this->millisecond -= t.m_myParent_.millisecond; + *this -= linear_value; + + return *this; +} + +rlTimeEx rlTimeEx::operator+(const RelativeTime &time) const + { + rlTimeEx t(*this); + + t += time; + + return t; +} + +rlTimeEx rlTimeEx::operator-(const RelativeTime &time) const + { + rlTimeEx t(*this); + + t -= time; + + return t; +} + +double rlTimeEx::operator-(const rlTimeEx &time) const + { + if (this->objectHoldsRelativeTime and time.objectHoldsRelativeTime) + return (this->seconds() - time.seconds()); + else if (not this->objectHoldsRelativeTime and time.objectHoldsRelativeTime) + return this->secondsSinceEpoche() - time.seconds(); + else if (not this->objectHoldsRelativeTime and not time.objectHoldsRelativeTime) + return (this->secondsSinceEpoche() - time.secondsSinceEpoche()); + else + { + assert(not time.objectHoldsRelativeTime && "you cannot run the difference between relative and absolute time this way (relative minus absolute)"); + return std::numeric_limits::quiet_NaN();; // just to make code inspection tools happy, in case assert() is defined empty + } +} + +int rlTimeEx::operator==(const rlTimeEx &time) const + { if(year != time.year) return 0; if(month != time.month) return 0; if(day != time.day) return 0; @@ -721,148 +973,149 @@ int rlTimeEx::operator==(const rlTimeEx &time) const } int rlTimeEx::operator<=(const rlTimeEx &time) const -{ + { if((*this) == time) return 1; if((*this) < time) return 1; return 0; } int rlTimeEx::operator>=(const rlTimeEx &time) const -{ + { if((*this) == time) return 1; if((*this) > time) return 1; return 0; } -int rlTimeEx::operator<(const rlTime &time) const -{ - if (this->year < time.year) - return 1; - else if (this->year == time.year) - { - if (this->month < time.month) - return 1; - else if (this->month == time.month) - { - if (this->day < time.day) - return 1; - else if (this->day == time.day) - { - if (this->hour < time.hour) - return 1; - else if (this->hour == time.hour) - { - if (this->minute < time.minute) - return 1; - else if (this->minute == time.minute) - { - if (this->second < time.second) - return 1; - else if (this->second == time.second) -{ - if (this->millisecond < time.millisecond) - return 1; - } - } - } - } - } - } +int rlTimeEx::operator<(const rlTimeEx &time) const + { + if (this->year < time.year) + return 1; + else if (this->year == time.year) + { + if (this->month < time.month) + return 1; + else if (this->month == time.month) + { + if (this->day < time.day) + return 1; + else if (this->day == time.day) + { + if (this->hour < time.hour) + return 1; + else if (this->hour == time.hour) + { + if (this->minute < time.minute) + return 1; + else if (this->minute == time.minute) + { + if (this->second < time.second) + return 1; + else if (this->second == time.second) + { + if (this->millisecond < time.millisecond) + return 1; + } + } + } + } + } + } return 0; } -int rlTimeEx::operator>(const rlTime &time) const -{ - if (this->year > time.year) - return 1; - else if (this->year == time.year) - { - if (this->month > time.month) - return 1; - else if (this->month == time.month) - { - if (this->day > time.day) - return 1; - else if (this->day == time.day) - { - if (this->hour > time.hour) - return 1; - else if (this->hour == time.hour) - { - if (this->minute > time.minute) - return 1; - else if (this->minute == time.minute) - { - if (this->second > time.second) - return 1; - else if (this->second == time.second) -{ - if (this->millisecond > time.millisecond) - return 1; - } - } - } - } - } - } - +int rlTimeEx::operator>(const rlTimeEx &time) const + { + if (this->year > time.year) + return 1; + else if (this->year == time.year) + { + if (this->month > time.month) + return 1; + else if (this->month == time.month) + { + if (this->day > time.day) + return 1; + else if (this->day == time.day) + { + if (this->hour > time.hour) + return 1; + else if (this->hour == time.hour) + { + if (this->minute > time.minute) + return 1; + else if (this->minute == time.minute) + { + if (this->second > time.second) + return 1; + else if (this->second == time.second) + { + if (this->millisecond > time.millisecond) + return 1; + } + } + } + } + } + } + return 0; } -time_t rlTimeEx::timegm(struct tm* tm_) -{ - auto t = mktime(tm_); - struct tm ltm; - struct tm gtm; - auto lt = localtime_r(&t, <m); - auto gt = gmtime_r(&t, >m); - auto diff = mktime(lt) - mktime(gt); - return t + diff; -} - -double rlTimeEx::secondsSinceEpoche() const +time_t rlTimeEx::timegm(struct tm* tm_) +{ + auto t = mktime(tm_); + struct tm ltm; + struct tm gtm; + auto lt = localtime_r(&t, <m); + auto gt = gmtime_r(&t, >m); + auto diff = mktime(lt) - mktime(gt); + return t + diff; +} + +double rlTimeEx::secondsSinceEpoche() const { struct tm begin; struct tm test; - memset(&begin,0,sizeof(tm)); - memset(&test,0,sizeof(tm)); + memset(&begin, 0, sizeof(tm)); + memset(&test, 0, sizeof(tm)); begin.tm_year = 70; - begin.tm_mon = 0; - begin.tm_mday = 2; // see below + begin.tm_mon = 0; + begin.tm_mday = 2; // see below begin.tm_hour = 0; - begin.tm_min = 0; - begin.tm_sec = 0; - begin.tm_isdst = 0; + begin.tm_min = 0; + begin.tm_sec = 0; + begin.tm_isdst = 0; test.tm_year = year - 1900; - test.tm_mon = month - 1; + test.tm_mon = month - 1; test.tm_mday = day; test.tm_hour = hour; - test.tm_min = minute; - test.tm_sec = second; - test.tm_isdst = -1; + test.tm_min = minute; + test.tm_sec = second; + test.tm_isdst = -1; - time_t t0 = timegm(&begin) - 86400; // a weak workaround: on several platform (especially Windows 7 in Europe Timezones) mktime() is not capable of converting 19070-01-01T00:00:00 into seconds, because they try to convert it into UTC instead of localtime - time_t t1 = mktime(&test); // this might be error prone, see above + time_t t0 = timegm(&begin) - 86400; // a weak workaround: on several platform (especially Windows 7 in Europe Timezones) mktime() is not capable of converting 19070-01-01T00:00:00 into seconds, because they try to convert it into UTC instead of localtime + time_t t1 = mktime(&test); // this might be error prone, see above - return difftime(t1,t0) + (((double) millisecond) / 1000); + return difftime(t1, t0) + (((double) millisecond) / 1000); } - /** * seconds := delta time * milliseconds within the fraction */ double rlTimeEx::seconds() const { - double ret = (((double) millisecond) / 1000) + second + minute*60 + hour*60*60 + month*60*60*30.5 + year*60*60*30.5*12; + double ret = (((double) millisecond) / 1000); + ret += second + minute * 60 + hour * 60 * 60 + day * 24 * 60 * 60; + ret += month*60*60*30.5 + year*60*60*30.5*12; return ret; } -const char* rlTimeEx::formatTimeDiff(double tdiff, enum FormatLargestUnit fmt, unsigned bufferLength, char* buffer) +const char* rlTimeEx::formatTimeDiff(ftime_t tdiff, enum FormatLargestUnit fmt, unsigned bufferLength, char* buffer) { if (0 < bufferLength) { @@ -925,12 +1178,12 @@ const char* rlTimeEx::formatTimeDiff(double tdiff, enum FormatLargestUnit fmt, u snprintf(buffer, bufferLength, fmtString, (isNegative ? "-" : ""), weeks.quot, weeks.rem, days.rem, hours.rem, minutes.rem); break; } -} + } return buffer; } -const char* rlTimeEx::formatTimeDiff(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit fmt, unsigned bufferLength, char* buffer) +const char* rlTimeEx::formatTimeDiff(const rlTimeEx& t1, const rlTimeEx& t2, enum FormatLargestUnit fmt, unsigned bufferLength, char* buffer) { return formatTimeDiff(t2 - t1, fmt, bufferLength, buffer); } @@ -946,7 +1199,7 @@ std::string rlTimeEx::formatTimeDiffString(double tdiff, enum FormatLargestUnit return diffStr; } -std::string rlTimeEx::formatTimeDiffString(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit fmt) +std::string rlTimeEx::formatTimeDiffString(const rlTimeEx& t1, const rlTimeEx& t2, enum FormatLargestUnit fmt) { return formatTimeDiffString(t2 - t1, fmt); } diff --git a/rllib/lib/rltimeex.h b/rllib/lib/rltimeex.h index 4217d275..4d48123e 100644 --- a/rllib/lib/rltimeex.h +++ b/rllib/lib/rltimeex.h @@ -20,9 +20,24 @@ #include #include #include +#include + +#ifdef RLCPP11 +#include +#endif /*!
-class for handling time.
+class for handling time. It supports also simple formatting of time differences.
+
+If the year is smaller than 1970 a relative time is assumed in contrast to an absolute point in time for
+years greater than 1970.
+
+For good clarity of what you want express, avoid years and months for relative times and express relative
+times as days, hours etc.
+
+Relative times are normalized in a fashion that, as of its nonlinear nature of months length and year length,
+finally the most rough granularity component for relative times is expressed in days. This way are assumptions of
+month length and year length are taken out of calculations as early as possible.
 
*/ class rlTimeEx { @@ -31,6 +46,9 @@ class rlTimeEx typedef int64_t time_t; ///< for applying relative adjustments to the time, it's a redefintion on most modern platform, but anyway typedef double ftime_t; ///< for applying relative adjustments in fractions of a second + struct RelativeTime; ///< a proxy type for adding relative time to absolutes + + explicit rlTimeEx(int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0); #ifdef RLCPP11 rlTimeEx(double&) = delete; @@ -39,38 +57,61 @@ class rlTimeEx const char *getTimeString(); const char *getIsoTimeString(); const char *toString(const char *format); - void getLocalTime(); + rlTimeEx& getLocalTime(); int getFileModificationTime(const char *filename); /*!
   format: sscanf(time_string,"%d-%d-%d %d:%d:%d %d",&year,&month,&day, &hour,&minute,&second, &millisecond);
   
*/ - void setTimeFromString(const char *time_string); - void setTimeFromIsoString(const char *iso_time_string); - void setTimeFromSeconds(double const &seconds); // we assume 30.5 days per month + rlTimeEx& setTimeFromString(const char *time_string); + rlTimeEx& setTimeFromIsoString(const char *iso_time_string); + rlTimeEx& setTimeFromSeconds(double seconds); // we assume 30.5 days per month void setLocalTime(); double secondsSinceEpoche() const; - double seconds() const; // we assume 30.5 days per month + double seconds() const; + + // implicitly converted rlTimeEx objects for doing relative adjustments to objects + rlTimeEx& operator+= (const RelativeTime &time); + rlTimeEx& operator-= (const RelativeTime &time); + rlTimeEx operator+ (const RelativeTime &time) const; + rlTimeEx operator- (const RelativeTime &time) const; // one must cast explicitly to get an rlTimeEx object back, i.e. t2 - RelativeTime(t1); - rlTimeEx& operator+= (rlTimeEx &time); - rlTimeEx& operator-= (rlTimeEx &time); - rlTimeEx operator+ (rlTimeEx &time) const; - rlTimeEx operator- (rlTimeEx &time) const; + // integral time spans, pre C++11 compiler users must convert argument value explicitly to time_t by time_t(seconds) + rlTimeEx& operator+= (time_t seconds); ///< adjust absolute time by number of seconds + rlTimeEx& operator-= (time_t seconds); ///< adjust absolute time by number of seconds + rlTimeEx operator+ (time_t seconds) const; ///< make new object with absolute time adjusted by number of seconds + rlTimeEx operator- (time_t seconds) const; ///< make new object with absolute time adjusted by number of seconds - rlTimeEx& operator+= (double const &seconds); // we assume 30.5 days per month - rlTimeEx& operator-= (double const &seconds); // we assume 30.5 days per month - rlTimeEx operator+ (double const &seconds) const; // we assume 30.5 days per month - rlTimeEx operator- (double const &seconds) const; // we assume 30.5 days per month - rlTimeEx& operator+= (time_t seconds); ///< adjust absolute time by number of seconds - rlTimeEx& operator-= (time_t seconds); ///< adjust absolute time by number of seconds - rlTimeEx operator+ (time_t seconds) const; ///< make new object with absolute time adjusted by number of seconds - rlTimeEx operator- (time_t seconds) const; ///< make new object with absolute time adjusted by number of seconds + // floating point time spans with millisecond resolution, pre C++11 compiler users must convert argument value to ftime_t by ftime_t(seconds) + rlTimeEx& operator += (const ftime_t& seconds); + rlTimeEx& operator -= (const ftime_t& seconds); + rlTimeEx operator + (const ftime_t& seconds) const; + rlTimeEx operator - (const ftime_t& seconds) const; - rlTimeEx& operator += (const ftime_t& seconds); // we assume 30.5 days per month - rlTimeEx& operator -= (const ftime_t& seconds); // we assume 30.5 days per month - rlTimeEx operator + (const ftime_t& seconds) const; // we assume 30.5 days per month - rlTimeEx operator - (const ftime_t& seconds) const; // we assume 30.5 days per month +#ifdef RLCPP11 + // some templates to catch all other integer type arguments and convert them to time_t + template::value, argType>::type* = nullptr> + rlTimeEx& operator+= (argType seconds); ///< adjust absolute time by number of seconds + template::value, argType>::type* = nullptr> + rlTimeEx& operator-= (argType seconds); ///< adjust absolute time by number of seconds + template::value, argType>::type* = nullptr> + rlTimeEx operator+ (argType seconds) const; ///< make new object with absolute time adjusted by number of seconds + template::value, argType>::type* = nullptr> + rlTimeEx operator- (argType seconds) const; ///< make new object with absolute time adjusted by number of seconds + + // some templates to catch all other floating point type arguments and convert them to ftime_t + template::value, argType>::type* = nullptr> + rlTimeEx& operator+= (argType seconds); ///< adjust absolute time by number of seconds + template::value, argType>::type* = nullptr> + rlTimeEx& operator-= (argType seconds); ///< adjust absolute time by number of seconds + template::value, argType>::type* = nullptr> + rlTimeEx operator+ (argType seconds) const; ///< make new object with absolute time adjusted by number of seconds + template::value, argType>::type* = nullptr> + rlTimeEx operator- (argType seconds) const; ///< make new object with absolute time adjusted by number of seconds +#endif + + double operator- (const rlTimeEx &time) const; ///< difference of two points in time in seconds.milliseconds int operator== (const rlTimeEx &time) const; int operator< (const rlTimeEx &time) const; @@ -100,31 +141,104 @@ class rlTimeEx ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, caller provides buffer, or, NULL pointer, buffer must be deleted (delete[]) static - const char* formatTimeDiff(double, enum FormatLargestUnit = HoursMinutesSecondsFraction, unsigned bufferLength = 32, char* buffer = 0); + const char* formatTimeDiff(ftime_t, enum FormatLargestUnit = HoursMinutesSecondsFraction, unsigned bufferLength = 32, char* buffer = 0); ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, caller provides buffer, or buffer must be deleted (delete[]) static - const char* formatTimeDiff(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit = HoursMinutesSecondsFraction, unsigned bufferLength = 32, char* buffer = 0); + const char* formatTimeDiff(const rlTimeEx& t1, const rlTimeEx& t2, enum FormatLargestUnit = HoursMinutesSecondsFraction, unsigned bufferLength = 32, char* buffer = 0); ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, returned object manages string memory static - std::string formatTimeDiffString(double, enum FormatLargestUnit = HoursMinutesSecondsFraction); + std::string formatTimeDiffString(ftime_t, enum FormatLargestUnit = HoursMinutesSecondsFraction); ///< Caller chooses formatting template, default is Hours:Minutes:Seconds.Milliseconds, returned object manages string memory static - std::string formatTimeDiffString(const rlTime& t1, const rlTime& t2, enum FormatLargestUnit = HoursMinutesSecondsFraction); + std::string formatTimeDiffString(const rlTimeEx& t1, const rlTimeEx& t2, enum FormatLargestUnit = HoursMinutesSecondsFraction); static time_t timegm(struct tm* tm_); ///< emulates the POSIX function, which is i.e. under Windows not available void normalizeAsDate(); ///< normalizes odd constructions of time and date, such 2014-03-36 is normalized to 2014-04-05, simelar oddities for the time are corrected. + void normalizeAsRelativeTime(); // we assume 30.5 days per month and 365.25 days per year and accumulate months and years in the days component + + struct RelativeTime // inline implmentation of the proxy type for adding relative time to absolutes + { + inline + RelativeTime(const rlTimeEx& rlt) + : m_myParent_(rlt) + { + assert(rlt.objectHoldsRelativeTime); + } + + inline + operator double() const + { + return m_myParent_.seconds(); + } + + const rlTimeEx& m_myParent_; + }; private: char time_string[32*2]; // 2001-11-23 12:52:60 056 char iso_time_string[32]; // 2001-11-23T12:52:60.056 + bool objectHoldsRelativeTime:1; + #ifndef RLCPP11 explicit rlTimeEx(double&); // intentionally no implementation, as this shall not be explicit or implicit used #endif }; + +#ifdef RLCPP11 +// implementation of the template declarations and overloads above +template::value, argType>::type* = nullptr> +rlTimeEx& rlTimeEx::operator+= (argType seconds) +{ + return this->operator +=(time_t(seconds)); +} + +template::value, argType>::type* = nullptr> +rlTimeEx& rlTimeEx::operator-= (argType seconds) +{ + return this->operator -=(time_t(seconds)); +} + +template::value, argType>::type* = nullptr> +rlTimeEx rlTimeEx::operator+ (argType seconds) const +{ + return this->operator +(time_t(seconds)); +} + +template::value, argType>::type* = nullptr> +rlTimeEx rlTimeEx::operator- (argType seconds) const +{ + return this->operator -(time_t(seconds)); +} + +template::value, argType>::type* = nullptr> +rlTimeEx& rlTimeEx::operator+= (argType seconds) +{ + return this->operator +=(ftime_t(seconds)); +} + +template::value, argType>::type* = nullptr> +rlTimeEx& rlTimeEx::operator-= (argType seconds) +{ + return this->operator -=(ftime_t(seconds)); +} + +template::value, argType>::type* = nullptr> +rlTimeEx rlTimeEx::operator+ (argType seconds) const +{ + return this->operator +(ftime_t(seconds)); +} + +template::value, argType>::type* = nullptr> +rlTimeEx rlTimeEx::operator- (argType seconds) const +{ + return this->operator -(ftime_t(seconds)); +} +#endif + #endif From da84b654c14bb5f24cd22e7688237e8908df7dc2 Mon Sep 17 00:00:00 2001 From: Johannes Lode Date: Sun, 3 Feb 2019 13:08:46 +0100 Subject: [PATCH 5/7] Consistent signature for rltranslate(). --- .gitignore | 3 + .../language_binding_rllib_wrap_lua.cxx | 6236 ++++++++++------- .../language_binding_wrap_lua.cxx | 3516 +++++++--- language_bindings/lua/pvapplua/main.cpp | 6 - language_bindings/lua/pvslua/main.cpp | 6 - rllib/lib/rlinifile.h | 2 +- 6 files changed, 6027 insertions(+), 3742 deletions(-) diff --git a/.gitignore b/.gitignore index 8015f2f3..3cf1c657 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,6 @@ win-mingw/bin/fake_qmake.exe win-mingw/bin/rlsvgcat.exe language_bindings/lua/pvslua/pvslua language_bindings/lua/pvslua/pvapplua +/.cproject +/.project +/.settings/ diff --git a/language_bindings/language_binding_rllib_wrap_lua.cxx b/language_bindings/language_binding_rllib_wrap_lua.cxx index 7f0e01e7..31340fcb 100644 --- a/language_bindings/language_binding_rllib_wrap_lua.cxx +++ b/language_bindings/language_binding_rllib_wrap_lua.cxx @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 3.0.12 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -8,7 +8,11 @@ * interface file instead. * ----------------------------------------------------------------------------- */ + +#ifndef SWIGLUA #define SWIGLUA +#endif + #define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA #define SWIG_LUA_MODULE_GLOBAL @@ -103,9 +107,11 @@ template T SwigValueInit() { #endif /* exporting methods */ -#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif # endif #endif @@ -144,6 +150,19 @@ template T SwigValueInit() { # define _SCL_SECURE_NO_DEPRECATE #endif +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif /* ----------------------------------------------------------------------------- * swigrun.swg @@ -551,14 +570,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *iter = start; do { if (iter->size) { - register size_t l = 0; - register size_t r = iter->size - 1; + size_t l = 0; + size_t r = iter->size - 1; do { /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - register size_t i = (l + r) >> 1; + size_t i = (l + r) >> 1; const char *iname = iter->types[i]->name; if (iname) { - register int compare = strcmp(name, iname); + int compare = strcmp(name, iname); if (compare == 0) { return iter->types[i]; } else if (compare < 0) { @@ -602,7 +621,7 @@ SWIG_TypeQueryModule(swig_module_info *start, of the str field (the human readable name) */ swig_module_info *iter = start; do { - register size_t i = 0; + size_t i = 0; for (; i < iter->size; ++i) { if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) return iter->types[i]; @@ -621,10 +640,10 @@ SWIG_TypeQueryModule(swig_module_info *start, SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz) { static const char hex[17] = "0123456789abcdef"; - register const unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; for (; u != eu; ++u) { - register unsigned char uu = *u; + unsigned char uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } @@ -636,22 +655,22 @@ SWIG_PackData(char *c, void *ptr, size_t sz) { */ SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - register unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; for (; u != eu; ++u) { - register char d = *(c++); - register unsigned char uu; + char d = *(c++); + unsigned char uu; if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); + uu = (unsigned char)((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); + uu = (unsigned char)((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); + uu |= (unsigned char)(d - '0'); else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); + uu |= (unsigned char)(d - ('a'-10)); else return (char *) 0; *u = uu; @@ -747,23 +766,110 @@ extern "C" { # error SWIG_LUA_TARGET not defined #endif +#if defined(SWIG_LUA_ELUA_EMULATE) + +struct swig_elua_entry; + +typedef struct swig_elua_key { + int type; + union { + const char* strkey; + lua_Number numkey; + } key; +} swig_elua_key; + +typedef struct swig_elua_val { + int type; + union { + lua_Number number; + const struct swig_elua_entry *table; + const char *string; + lua_CFunction function; + struct { + char member; + long lvalue; + void *pvalue; + swig_type_info **ptype; + } userdata; + } value; +} swig_elua_val; + +typedef struct swig_elua_entry { + swig_elua_key key; + swig_elua_val value; +} swig_elua_entry; + +#define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} } +#define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} } +#define LNILKEY {LUA_TNIL, {.strkey = 0} } + +#define LNUMVAL(x) {LUA_TNUMBER, {.number = x} } +#define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} } +#define LROVAL(x) {LUA_TTABLE, {.table = x} } +#define LNILVAL {LUA_TNIL, {.string = 0} } +#define LSTRVAL(x) {LUA_TSTRING, {.string = x} } + +#define LUA_REG_TYPE swig_elua_entry + +#define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable" + +#define lua_pushrotable(L,p)\ + lua_newtable(L);\ + assert(p);\ + SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p)); + +#define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ + LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } } + +#define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\ + LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } } +#endif + #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) # define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C) # define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C) # define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C) # define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C) + /* Those two types of constants are not supported in elua */ + +#ifndef SWIG_LUA_CONSTTAB_POINTER +#warning eLua does not support pointers as constants. By default, nil will be used as value +#define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL +#endif + +#ifndef SWIG_LUA_CONSTTAB_BINARY +#warning eLua does not support pointers to member as constants. By default, nil will be used as value +#define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL +#endif #else /* SWIG_LUA_FLAVOR_LUA */ # define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0 # define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0 # define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0 # define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0 +# define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ + SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D +# define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\ + SWIG_LUA_BINARY, (char *)B, S, 0, (void *)C, &D #endif +#ifndef SWIG_LUA_ELUA_EMULATE #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) # define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING} # define LSTRVAL LRO_STRVAL #endif +#endif /* SWIG_LUA_ELUA_EMULATE*/ + +#ifndef SWIG_LUA_ELUA_EMULATE +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) + +#ifndef MIN_OPT_LEVEL +#define MIN_OPT_LEVEL 2 +#endif +#include "lrodefs.h" +#include "lrotable.h" +#endif +#endif /* SWIG_LUA_ELUA_EMULATE*/ /* ----------------------------------------------------------------------------- * compatibility defines * ----------------------------------------------------------------------------- */ @@ -790,6 +896,23 @@ extern "C" { # define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX) #endif +/* lua_absindex was introduced in Lua 5.2 */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +# define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) +#endif + +/* lua_rawsetp was introduced in Lua 5.2 */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +#define lua_rawsetp(L,index,ptr)\ + lua_pushlightuserdata(L,(void*)(ptr));\ + lua_insert(L,-2);\ + lua_rawset(L,index); + +#define lua_rawgetp(L,index,ptr)\ + lua_pushlightuserdata(L,(void*)(ptr));\ + lua_rawget(L,index); + +#endif /* -------------------------------------------------------------------------- * Helper functions for error handling @@ -839,6 +962,12 @@ typedef struct { lua_CFunction set; } swig_lua_var_info; +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +typedef const LUA_REG_TYPE swig_lua_method; +typedef const LUA_REG_TYPE swig_lua_const_info; +#else /* Normal lua */ +typedef luaL_Reg swig_lua_method; + /* Constant information structure */ typedef struct { int type; @@ -849,10 +978,7 @@ typedef struct { swig_type_info **ptype; } swig_lua_const_info; -typedef struct { - const char *name; - lua_CFunction method; -} swig_lua_method; +#endif typedef struct { const char *name; @@ -860,23 +986,28 @@ typedef struct { lua_CFunction setmethod; } swig_lua_attribute; -// Can be used to create namespaces. Currently used to -// wrap class static methods/variables/constants -typedef struct { + +struct swig_lua_class; +/* Can be used to create namespaces. Currently used to wrap class static methods/variables/constants */ +typedef struct swig_lua_namespace { const char *name; swig_lua_method *ns_methods; swig_lua_attribute *ns_attributes; swig_lua_const_info *ns_constants; + struct swig_lua_class **ns_classes; + struct swig_lua_namespace **ns_namespaces; } swig_lua_namespace; typedef struct swig_lua_class { - const char *name; + const char *name; /* Name that this class has in Lua */ + const char *fqname; /* Fully qualified name - Scope + class name */ swig_type_info **type; lua_CFunction constructor; void (*destructor)(void *); swig_lua_method *methods; swig_lua_attribute *attributes; - swig_lua_namespace cls_static; + swig_lua_namespace *cls_static; + swig_lua_method *metatable; /* 0 for -eluac */ struct swig_lua_class **bases; const char **base_names; } swig_lua_class; @@ -940,18 +1071,23 @@ typedef struct { lua_pushcfunction(L, f), \ lua_rawset(L,-3)) +#define SWIG_Lua_add_boolean(L,n,b) \ + (lua_pushstring(L, n), \ + lua_pushboolean(L, b), \ + lua_rawset(L,-3)) + /* special helper for allowing 'nil' for usertypes */ #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) #ifdef __cplusplus /* Special helper for member function pointers it gets the address, casts it, then dereferences it */ -//#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) +/*#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) */ #endif /* storing/access of swig_module_info */ SWIGRUNTIME swig_module_info * -SWIG_Lua_GetModule(lua_State* L) { +SWIG_Lua_GetModule(lua_State *L) { swig_module_info *ret = 0; lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); lua_rawget(L,LUA_REGISTRYINDEX); @@ -962,7 +1098,7 @@ SWIG_Lua_GetModule(lua_State* L) { } SWIGRUNTIME void -SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { +SWIG_Lua_SetModule(lua_State *L, swig_module_info *module) { /* add this all into the Lua registry: */ lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); lua_pushlightuserdata(L,(void*)module); @@ -976,7 +1112,7 @@ SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { /* this function is called when trying to set an immutable. default action is to print an error. This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ -SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L) +SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L) { /* there should be 1 param passed in: the new value */ #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE @@ -986,170 +1122,153 @@ SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L) return 0; /* should not return anything */ } -/* the module.get method used for getting linked data */ -SWIGINTERN int SWIG_Lua_module_get(lua_State* L) -{ -/* there should be 2 params passed in - (1) table (not the meta table) - (2) string name of the attribute - printf("SWIG_Lua_module_get %p(%s) '%s'\n", - lua_topointer(L,1),lua_typename(L,lua_type(L,1)), - lua_tostring(L,2)); -*/ - /* get the metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - assert(lua_isrotable(L,1)); /* just in case */ -#else - assert(lua_istable(L,1)); /* default Lua action */ -#endif - lua_getmetatable(L,1); /* get the metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - assert(lua_isrotable(L,-1)); /* just in case */ -#else - assert(lua_istable(L,-1)); -#endif - SWIG_Lua_get_table(L,".get"); /* get the .get table */ - lua_remove(L,3); /* remove metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - if (lua_isrotable(L,-1)) -#else - if (lua_istable(L,-1)) -#endif - { - /* look for the key in the .get table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,3); /* remove .get */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_call(L,0,1); - return 1; - } - lua_pop(L,1); /* remove the top */ - } - lua_pop(L,1); /* remove the .get */ - lua_pushnil(L); /* return a nil */ - return 1; -} +#ifdef SWIG_LUA_ELUA_EMULATE -/* the module.set method used for setting linked data */ -SWIGINTERN int SWIG_Lua_module_set(lua_State* L) +SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own); +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type); +static int swig_lua_elua_emulate_unique_key; + +/* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */ +SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table) { -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value -*/ - /* get the metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - assert(lua_isrotable(L,1)); /* just in case */ -#else - assert(lua_istable(L,1)); /* default Lua action */ -#endif - lua_getmetatable(L,1); /* get the metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - assert(lua_isrotable(L,-1)); /* just in case */ -#else + int i, table_parsed, parsed_tables_array, target_table; assert(lua_istable(L,-1)); -#endif - SWIG_Lua_get_table(L,".set"); /* get the .set table */ - lua_remove(L,4); /* remove metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - if (lua_isrotable(L,-1)) -#else - if (lua_istable(L,-1)) -#endif + target_table = lua_gettop(L); + /* Get the registry where we put all parsed tables to avoid loops */ + lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); + if(lua_isnil(L,-1)) { + lua_pop(L,1); + lua_newtable(L); + lua_pushvalue(L,-1); + lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key)); + } + parsed_tables_array = lua_gettop(L); + lua_pushvalue(L,target_table); + lua_rawsetp(L, parsed_tables_array, table); + table_parsed = 0; + const int SWIGUNUSED pairs_start = lua_gettop(L); + for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++) { - /* look for the key in the .set table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,4); /* remove .set */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,3); /* value */ - lua_call(L,1,0); - return 0; + const swig_elua_entry *entry = table + i; + int is_metatable = 0; + switch(entry->key.type) { + case LUA_TSTRING: + lua_pushstring(L,entry->key.key.strkey); + if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0) + is_metatable = 1; + break; + case LUA_TNUMBER: + lua_pushnumber(L,entry->key.key.numkey); + break; + case LUA_TNIL: + lua_pushnil(L); + break; + default: + assert(0); } -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) - else { - return 0; // Exits stoically if an invalid key is initialized. + switch(entry->value.type) { + case LUA_TSTRING: + lua_pushstring(L,entry->value.value.string); + break; + case LUA_TNUMBER: + lua_pushnumber(L,entry->value.value.number); + break; + case LUA_TFUNCTION: + lua_pushcfunction(L,entry->value.value.function); + break; + case LUA_TTABLE: + lua_rawgetp(L,parsed_tables_array, entry->value.value.table); + table_parsed = !lua_isnil(L,-1); + if(!table_parsed) { + lua_pop(L,1); /*remove nil */ + lua_newtable(L); + SWIG_Lua_elua_emulate_register(L,entry->value.value.table); + } + if(is_metatable) { + assert(lua_istable(L,-1)); + lua_pushvalue(L,-1); + lua_setmetatable(L,target_table); + } + + break; + case LUA_TUSERDATA: + if(entry->value.value.userdata.member) + SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue, + entry->value.value.userdata.lvalue, + *(entry->value.value.userdata.ptype)); + else + SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue, + *(entry->value.value.userdata.ptype),0); + break; + case LUA_TNIL: + lua_pushnil(L); + break; + default: + assert(0); } -#endif + assert(lua_gettop(L) == pairs_start + 2); + lua_rawset(L,target_table); } - lua_settop(L,3); /* reset back to start */ - /* we now have the table, key & new value, so just set directly */ - lua_rawset(L,1); /* add direct */ - return 0; + lua_pop(L,1); /* Removing parsed tables storage */ + assert(lua_gettop(L) == target_table); } -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) -/* registering a module in lua. Pushes the module table on the stack. */ -SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name) +SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L) { - assert(lua_istable(L,-1)); /* just in case */ - lua_pushstring(L,name); - lua_newtable(L); /* the table */ - /* add meta table */ - lua_newtable(L); /* the meta table */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set); - lua_pushstring(L,".get"); - lua_newtable(L); /* the .get table */ - lua_rawset(L,-3); /* add .get into metatable */ - lua_pushstring(L,".set"); - lua_newtable(L); /* the .set table */ - lua_rawset(L,-3); /* add .set into metatable */ - lua_setmetatable(L,-2); /* sets meta table in module */ -#ifdef SWIG_LUA_MODULE_GLOBAL - /* If requested, install the module directly into the global namespace. */ - lua_rawset(L,-3); /* add module into parent */ - SWIG_Lua_get_table(L,name); /* get the table back out */ -#else - /* Do not install the module table as global name. The stack top has - the module table with the name below. We pop the top and replace - the name with it. */ - lua_replace(L,-2); -#endif + lua_pushnil(L); + lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); } -/* ending the register */ -SWIGINTERN void SWIG_Lua_module_end(lua_State* L) -{ - lua_pop(L,1); /* tidy stack (remove module) */ -} +SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L); -/* adding a linked variable to the module */ -SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) +SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L) { - assert(lua_istable(L,-1)); /* just in case */ - lua_getmetatable(L,-1); /* get the metatable */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); /* should be a table: */ - SWIG_Lua_add_function(L,name,getFn); - lua_pop(L,1); /* tidy stack (remove table) */ - if (setFn) /* if there is a set fn */ - { - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - assert(lua_istable(L,-1)); /* should be a table: */ - SWIG_Lua_add_function(L,name,setFn); - lua_pop(L,1); /* tidy stack (remove table) */ + SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1); + SWIG_Lua_get_class_registry(L); + lua_getfield(L,-1,"lua_getmetatable"); + lua_remove(L,-2); /* remove the registry*/ + assert(!lua_isnil(L,-1)); + lua_pushvalue(L,1); + assert(lua_gettop(L) == 3); /* object | function | object again */ + lua_call(L,1,1); + if(!lua_isnil(L,-1)) /*There is an ordinary metatable */ + return 1; + /*if it is a table, then emulate elua behaviour - check for __metatable attribute of a table*/ + assert(lua_gettop(L) == 2); + if(lua_istable(L,-2)) { + lua_pop(L,1); /*remove the nil*/ + lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY); } - lua_pop(L,1); /* tidy stack (remove meta) */ + assert(lua_gettop(L) == 2); + return 1; + +fail: + lua_error(L); + return 0; } -#endif -/* adding a function module */ -SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn) +SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L) { - SWIG_Lua_add_function(L,name,fn); + SWIG_Lua_get_class_registry(L); + lua_pushglobaltable(L); + lua_pushstring(L,"lua_getmetatable"); + lua_getfield(L,-2,"getmetatable"); + assert(!lua_isnil(L,-1)); + lua_rawset(L,-4); + lua_pushstring(L, "getmetatable"); + lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable); + lua_rawset(L,-3); + lua_pop(L,2); + } +/* END OF REMOVE */ +#endif /* ----------------------------------------------------------------------------- - * global variable support code: namespaces + * global variable support code: namespaces and modules (which are the same thing) * ----------------------------------------------------------------------------- */ -SWIGINTERN int SWIG_Lua_namespace_get(lua_State* L) +SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L) { /* there should be 2 params passed in (1) table (not the meta table) @@ -1186,7 +1305,7 @@ SWIGINTERN int SWIG_Lua_namespace_get(lua_State* L) return 0; } -SWIGINTERN int SWIG_Lua_namespace_set(lua_State* L) +SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L) { /* there should be 3 params passed in (1) table (not the meta table) @@ -1213,46 +1332,70 @@ SWIGINTERN int SWIG_Lua_namespace_set(lua_State* L) lua_pop(L,1); /* remove the value */ } lua_pop(L,1); /* remove the value .set table */ + lua_pop(L,1); /* remote metatable */ + lua_rawset(L,-3); return 0; } -SWIGINTERN void SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]); // forward declaration -SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn); // forward declaration +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ +SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]); /* forward declaration */ +SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn); /* forward declaration */ +SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss); /* helper function - register namespace methods and attributes into namespace */ -SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L, swig_lua_namespace* ns) +SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns) { - int i = 0; + int i; + /* There must be namespace table (not metatable) at the top of the stack */ assert(lua_istable(L,-1)); - /* There must be table at the top of the stack */ SWIG_Lua_InstallConstants(L, ns->ns_constants); + /* add methods to the namespace/module table */ + for(i=0;ns->ns_methods[i].name;i++){ + SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].func); + } lua_getmetatable(L,-1); /* add fns */ for(i=0;ns->ns_attributes[i].name;i++){ - SWIG_Lua_add_class_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); - } - - /* add methods to the metatable */ - SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ - assert(lua_istable(L,-1)); /* just in case */ - for(i=0;ns->ns_methods[i].name;i++){ - SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].method); + SWIG_Lua_add_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); } - lua_pop(L,1); /* clear stack - remove metatble */ lua_pop(L,1); return 0; } -/* helper function. creates namespace table and add it to module table */ -SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns) +/* Register all classes in the namespace */ +SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns) +{ + swig_lua_class **classes; + + /* There must be a module/namespace table at the top of the stack */ + assert(lua_istable(L,-1)); + + classes = ns->ns_classes; + + if( classes != 0 ) { + while(*classes != 0) { + SWIG_Lua_class_register(L, *classes); + classes++; + } + } +} + +/* Helper function. Creates namespace table and adds it to module table + if 'reg' is true, then will register namespace table to parent one (must be on top of the stack + when function is called). + Function always returns newly registered table on top of the stack. +*/ +SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg) { - assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table */ + swig_lua_namespace **sub_namespace; + /* 1 argument - table on the top of the stack */ + const int SWIGUNUSED begin = lua_gettop(L); + assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */ lua_checkstack(L,5); - lua_pushstring(L, ns->name); lua_newtable(L); /* namespace itself */ lua_newtable(L); /* metatable for namespace */ @@ -1274,117 +1417,348 @@ SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns) SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set); lua_setmetatable(L,-2); /* set metatable */ - lua_rawset(L,-3); /* add namespace to module table */ - return 0; + + /* Register all functions, variables etc */ + SWIG_Lua_add_namespace_details(L,ns); + /* Register classes */ + SWIG_Lua_add_namespace_classes(L,ns); + + sub_namespace = ns->ns_namespaces; + if( sub_namespace != 0) { + while(*sub_namespace != 0) { + SWIG_Lua_namespace_register(L, *sub_namespace, 1); + lua_pop(L,1); /* removing sub-namespace table */ + sub_namespace++; + } + } + + if (reg) { + lua_pushstring(L,ns->name); + lua_pushvalue(L,-2); + lua_rawset(L,-4); /* add namespace to module table */ + } + assert(lua_gettop(L) == begin+1); } +#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ + /* ----------------------------------------------------------------------------- * global variable support code: classes * ----------------------------------------------------------------------------- */ -/* the class.get method, performs the lookup of class attributes */ -SWIGINTERN int SWIG_Lua_class_get(lua_State* L) +SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname); + +typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret); + +SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type, + int first_arg, swig_lua_base_iterator_func func, int *const ret) +{ + /* first_arg - position of the object in stack. Everything that is above are arguments + * and is passed to every evocation of the func */ + int last_arg = lua_gettop(L);/* position of last argument */ + int original_metatable = last_arg + 1; + size_t bases_count; + int result = SWIG_ERROR; + int bases_table; + (void)swig_type; + lua_getmetatable(L,first_arg); + + /* initialise base search */ +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + SWIG_Lua_get_table(L,".bases"); + assert(lua_istable(L,-1)); + bases_count = lua_rawlen(L,-1); + bases_table = lua_gettop(L); +#else + /* In elua .bases table doesn't exist. Use table from swig_lua_class */ + (void)bases_table; + assert(swig_type!=0); + swig_module_info *module=SWIG_GetModule(L); + swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases; + const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names; + bases_count = 0; + for(;base_names[bases_count]; + bases_count++);/* get length of bases */ +#endif + + if(ret) + *ret = 0; + if(bases_count>0) + { + int to_remove; + size_t i; + int j; + int subcall_last_arg; + int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */ + int valid = 1; + swig_type_info *base_swig_type = 0; + for(j=first_arg;j<=last_arg;j++) + lua_pushvalue(L,j); + subcall_last_arg = lua_gettop(L); + + /* Trick: temporarily replacing original metatable with metatable for base class and call getter */ + for(i=0;ifqname); + base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]); + assert(base_swig_type != 0); + } +#endif + + if(!valid) + continue; + assert(lua_isuserdata(L, subcall_first_arg)); + assert(lua_istable(L,-1)); + lua_setmetatable(L,subcall_first_arg); /* Set new metatable */ + assert(lua_gettop(L) == subcall_last_arg); + result = func(L, base_swig_type,subcall_first_arg, ret); /* Forward call */ + if(result != SWIG_ERROR) { + break; + } + } + /* Restore original metatable */ + lua_pushvalue(L,original_metatable); + lua_setmetatable(L,first_arg); + /* Clear - remove everything between last_arg and subcall_last_arg including */ + to_remove = subcall_last_arg - last_arg; + for(j=0;jtype; + result = SWIG_Lua_class_do_get(L,type,1,&ret); + if(result == SWIG_OK) + return ret; + + result = SWIG_Lua_class_do_get_item(L,type,1,&ret); + if(result == SWIG_OK) + return ret; + + return 0; } -/* the class.set method, performs the lookup of class attributes */ -SWIGINTERN int SWIG_Lua_class_set(lua_State* L) +/* helper for the class.set method, performs the lookup of class attributes + * It returns error code. Number of function return values is passed inside 'ret' + */ +SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret) { /* there should be 3 params passed in (1) table (not the meta table) (2) string name of the attribute (3) any for the new value -printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n", - lua_topointer(L,1),lua_typename(L,lua_type(L,1)), - lua_tostring(L,2), - lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/ + */ - assert(lua_isuserdata(L,1)); /* just in case */ - lua_getmetatable(L,1); /* get the meta table */ + int bases_search_result; + int substack_start = lua_gettop(L) - 3; + lua_checkstack(L,5); + assert(lua_isuserdata(L,substack_start+1)); /* just in case */ + lua_getmetatable(L,substack_start+1); /* get the meta table */ assert(lua_istable(L,-1)); /* just in case */ + if(ret) + *ret = 0; /* it is setter - number of return values is always 0 */ SWIG_Lua_get_table(L,".set"); /* find the .set table */ if (lua_istable(L,-1)) { /* look for the key in the .set table */ - lua_pushvalue(L,2); /* key */ + lua_pushvalue(L,substack_start+2); /* key */ lua_rawget(L,-2); + lua_remove(L,-2); /* tidy stack, remove .set table */ if (lua_iscfunction(L,-1)) { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* userdata */ - lua_pushvalue(L,3); /* value */ + lua_pushvalue(L,substack_start+1); /* userdata */ + lua_pushvalue(L,substack_start+3); /* value */ lua_call(L,2,0); - return 0; + lua_remove(L,substack_start+4); /*remove metatable*/ + return SWIG_OK; } lua_pop(L,1); /* remove the value */ + } else { + lua_pop(L,1); /* remove the answer for .set table request*/ } - lua_pop(L,1); /* remove the value .set table */ /* NEW: looks for the __setitem() fn this is a user provided set fn */ SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ if (lua_iscfunction(L,-1)) /* if its there */ { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* the userdata */ - lua_pushvalue(L,2); /* the parameter */ - lua_pushvalue(L,3); /* the value */ + lua_pushvalue(L,substack_start+1); /* the userdata */ + lua_pushvalue(L,substack_start+2); /* the parameter */ + lua_pushvalue(L,substack_start+3); /* the value */ lua_call(L,3,0); /* 3 values in ,0 out */ lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; + return SWIG_OK; + } + lua_pop(L,1); /* remove value */ + + lua_pop(L,1); /* remove metatable */ + /* Search among bases */ + bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret); + if(ret) + assert(*ret == 0); + assert(lua_gettop(L) == substack_start + 3); + return bases_search_result; +} + +/* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly + * handles return values. + */ +SWIGINTERN int SWIG_Lua_class_set(lua_State *L) +{ +/* There should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value + */ + int ret = 0; + int result; + swig_lua_userdata *usr; + swig_type_info *type; + assert(lua_isuserdata(L,1)); + usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + type = usr->type; + result = SWIG_Lua_class_do_set(L,type,1,&ret); + if(result != SWIG_OK) { + SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method."); + lua_error(L); + } else { + assert(ret==0); } return 0; } /* the class.destruct method called by the interpreter */ -SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L) +SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L) { /* there should be 1 params passed in (1) userdata (not the meta table) */ - swig_lua_userdata* usr; - swig_lua_class* clss; + swig_lua_userdata *usr; + swig_lua_class *clss; assert(lua_isuserdata(L,-1)); /* just in case */ usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ /* if must be destroyed & has a destructor */ @@ -1400,31 +1774,30 @@ SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L) } /* the class.__tostring method called by the interpreter and print */ -SWIGINTERN int SWIG_Lua_class_tostring(lua_State* L) +SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L) { /* there should be 1 param passed in (1) userdata (not the metatable) */ + const char *className; + void* userData; assert(lua_isuserdata(L,1)); /* just in case */ - unsigned long userData = (unsigned long)lua_touserdata(L,1); /* get the userdata address for later */ + userData = lua_touserdata(L,1); /* get the userdata address for later */ lua_getmetatable(L,1); /* get the meta table */ assert(lua_istable(L,-1)); /* just in case */ - + lua_getfield(L, -1, ".type"); - const char* className = lua_tostring(L, -1); - - char output[256]; - sprintf(output, "<%s userdata: %lX>", className, userData); - - lua_pushstring(L, (const char*)output); + className = lua_tostring(L, -1); + + lua_pushfstring(L, "<%s userdata: %p>", className, userData); return 1; } /* to manually disown some userdata */ -SWIGINTERN int SWIG_Lua_class_disown(lua_State* L) +SWIGINTERN int SWIG_Lua_class_disown(lua_State *L) { /* there should be 1 params passed in (1) userdata (not the meta table) */ - swig_lua_userdata* usr; + swig_lua_userdata *usr; assert(lua_isuserdata(L,-1)); /* just in case */ usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ @@ -1432,25 +1805,69 @@ SWIGINTERN int SWIG_Lua_class_disown(lua_State* L) return 0; } -/* Constructor proxy. Used when class name entry in module is not class constructor, -but special table instead. */ -SWIGINTERN int SWIG_Lua_constructor_proxy(lua_State* L) +/* lua callable function to compare userdata's value +the issue is that two userdata may point to the same thing +but to lua, they are different objects */ +SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L) { - /* unlimited number of parameters - First one is our proxy table and we should remove it - Other we should pass to real constructor - */ - assert(lua_istable(L,1)); - lua_pushstring(L,".constructor"); - lua_rawget(L,1); - assert(!lua_isnil(L,-1)); - lua_replace(L,1); /* replace our table with real constructor */ - lua_call(L,lua_gettop(L)-1,1); - return 1; -} + int result; + swig_lua_userdata *usr1,*usr2; + if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ + return 0; /* nil reply */ + usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ + /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ + result=(usr1->ptr==usr2->ptr); + lua_pushboolean(L,result); + return 1; +} + +/* populate table at the top of the stack with metamethods that ought to be inherited */ +SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L) +{ + SWIG_Lua_add_boolean(L, "__add", 1); + SWIG_Lua_add_boolean(L, "__sub", 1); + SWIG_Lua_add_boolean(L, "__mul", 1); + SWIG_Lua_add_boolean(L, "__div", 1); + SWIG_Lua_add_boolean(L, "__mod", 1); + SWIG_Lua_add_boolean(L, "__pow", 1); + SWIG_Lua_add_boolean(L, "__unm", 1); + SWIG_Lua_add_boolean(L, "__len", 1 ); + SWIG_Lua_add_boolean(L, "__concat", 1 ); + SWIG_Lua_add_boolean(L, "__eq", 1); + SWIG_Lua_add_boolean(L, "__lt", 1); + SWIG_Lua_add_boolean(L, "__le", 1); + SWIG_Lua_add_boolean(L, "__call", 1); + SWIG_Lua_add_boolean(L, "__tostring", 1); + SWIG_Lua_add_boolean(L, "__gc", 0); +} + +/* creates the swig registry */ +SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L) +{ + /* create main SWIG registry table */ + lua_pushstring(L,"SWIG"); + lua_newtable(L); + /* populate it with some predefined data */ -/* gets the swig class registry (or creates it) */ -SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L) + /* .library table. Placeholder */ + lua_pushstring(L,".library"); + lua_newtable(L); + { + /* list of metamethods that class inherits from its bases */ + lua_pushstring(L,"inheritable_metamethods"); + lua_newtable(L); + /* populate with list of metamethods */ + SWIG_Lua_populate_inheritable_metamethods(L); + lua_rawset(L,-3); + } + lua_rawset(L,-3); + + lua_rawset(L,LUA_REGISTRYINDEX); +} + +/* gets the swig registry (or creates it) */ +SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L) { /* add this all into the swig registry: */ lua_pushstring(L,"SWIG"); @@ -1458,17 +1875,29 @@ SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L) if (!lua_istable(L,-1)) /* not there */ { /* must be first time, so add it */ lua_pop(L,1); /* remove the result */ - lua_pushstring(L,"SWIG"); - lua_newtable(L); - lua_rawset(L,LUA_REGISTRYINDEX); + SWIG_Lua_create_class_registry(L); /* then get it */ lua_pushstring(L,"SWIG"); lua_rawget(L,LUA_REGISTRYINDEX); } } -/* helper fn to get the classes metatable from the register */ -SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname) +SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L) +{ + SWIG_Lua_get_class_registry(L); + lua_pushstring(L, ".library"); + lua_rawget(L,-2); + assert( !lua_isnil(L,-1) ); + lua_pushstring(L, "inheritable_metamethods"); + lua_rawget(L,-2); + + /* Remove class registry and library table */ + lua_remove(L,-2); + lua_remove(L,-2); +} + +/* Helper function to get the classes metatable from the register */ +SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname) { SWIG_Lua_get_class_registry(L); /* get the registry */ lua_pushstring(L,cname); /* get the name */ @@ -1476,8 +1905,96 @@ SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname) lua_remove(L,-2); /* tidy up (remove registry) */ } +/* Set up the base classes pointers. +Each class structure has a list of pointers to the base class structures. +This function fills them. +It cannot be done at compile time, as this will not work with hireachies +spread over more than one swig file. +Therefore it must be done at runtime, querying the SWIG type system. +*/ +SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss) +{ + int i=0; + swig_module_info *module=SWIG_GetModule(L); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* not found yet */ + { + /* lookup and cache the base class */ + swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); + if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; + } + } +} + +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) +/* Merges two tables */ +SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source) +{ + /* iterating */ + lua_pushnil(L); + while (lua_next(L,source) != 0) { + /* -1 - value, -2 - index */ + /* have to copy to assign */ + lua_pushvalue(L,-2); /* copy of index */ + lua_pushvalue(L,-2); /* copy of value */ + lua_rawset(L, target); + lua_pop(L,1); + /* only key is left */ + } +} + +/* Merges two tables with given name. original - index of target metatable, base - index of source metatable */ +SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base) +{ + /* push original[name], then base[name] */ + lua_pushstring(L,name); + lua_rawget(L,original); + int original_table = lua_gettop(L); + lua_pushstring(L,name); + lua_rawget(L,base); + int base_table = lua_gettop(L); + SWIG_Lua_merge_tables_by_index(L, original_table, base_table); + /* clearing stack */ + lua_pop(L,2); +} + +/* Function takes all symbols from base and adds it to derived class. It's just a helper. */ +SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls) +{ + /* There is one parameter - original, i.e. 'derived' class metatable */ + assert(lua_istable(L,-1)); + int original = lua_gettop(L); + SWIG_Lua_get_class_metatable(L,base_cls->fqname); + int base = lua_gettop(L); + SWIG_Lua_merge_tables(L, ".fn", original, base ); + SWIG_Lua_merge_tables(L, ".set", original, base ); + SWIG_Lua_merge_tables(L, ".get", original, base ); + lua_pop(L,1); +} + +/* Function squashes all symbols from 'clss' bases into itself */ +SWIGINTERN void SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss) +{ + int i; + SWIG_Lua_get_class_metatable(L,clss->fqname); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* Somehow it's not found. Skip it */ + continue; + /* Thing is: all bases are already registered. Thus they have already executed + * this function. So we just need to squash them into us, because their bases + * are already squashed into them. No need for recursion here! + */ + SWIG_Lua_class_squash_base(L, clss->bases[i]); + } + lua_pop(L,1); /*tidy stack*/ +} +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ /* helper add a variable to a registered class */ -SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) +SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn) { assert(lua_istable(L,-1)); /* just in case */ SWIG_Lua_get_table(L,".get"); /* find the .get table */ @@ -1494,7 +2011,7 @@ SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_C } /* helper to recursively add class static details (static attributes, operations and constants) */ -SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State* L, swig_lua_class* clss) +SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss) { int i = 0; /* The class namespace table must be on the top of the stack */ @@ -1505,72 +2022,269 @@ SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State* L, swig_lua_class* SWIG_Lua_add_class_static_details(L,clss->bases[i]); } - SWIG_Lua_add_namespace_details(L, &clss->cls_static); + SWIG_Lua_add_namespace_details(L, clss->cls_static); } +SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */ + /* helper to recursively add class details (attributes & operations) */ -SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss) +SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss) { int i; - /* call all the base classes first: we can then override these later: */ + size_t bases_count = 0; + /* Add bases to .bases table */ + SWIG_Lua_get_table(L,".bases"); + assert(lua_istable(L,-1)); /* just in case */ for(i=0;clss->bases[i];i++) { - SWIG_Lua_add_class_details(L,clss->bases[i]); - } - /* add fns */ + SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); + /* Base class must be already registered */ + assert(lua_istable(L,-1)); + lua_rawseti(L,-2,i+1); /* In lua indexing starts from 1 */ + bases_count++; + } + assert(lua_rawlen(L,-1) == bases_count); + lua_pop(L,1); /* remove .bases table */ + /* add attributes */ for(i=0;clss->attributes[i].name;i++){ - SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); + SWIG_Lua_add_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); } /* add methods to the metatable */ SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ assert(lua_istable(L,-1)); /* just in case */ for(i=0;clss->methods[i].name;i++){ - SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].func); } lua_pop(L,1); /* tidy stack (remove table) */ - /* add operator overloads - these look ANY method which start with "__" and assume they - are operator overloads & add them to the metatable - (this might mess up is someone defines a method __gc (the destructor)*/ - for(i=0;clss->methods[i].name;i++){ - if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){ - SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + /* add operator overloads + This adds methods from metatable array to metatable. Can mess up garbage + collectind if someone defines __gc method + */ + if(clss->metatable) { + for(i=0;clss->metatable[i].name;i++) { + SWIG_Lua_add_function(L,clss->metatable[i].name,clss->metatable[i].func); } } + +#if !defined(SWIG_LUA_SQUASH_BASES) + /* Adding metamethods that are defined in base classes. If bases were squashed + * then it is obviously unnecessary + */ + SWIG_Lua_add_class_user_metamethods(L, clss); +#endif } -/* set up the base classes pointers. -Each class structure has a list of pointers to the base class structures. -This function fills them. -It cannot be done at compile time, as this will not work with hireachies -spread over more than one swig file. -Therefore it must be done at runtime, querying the SWIG type system. +/* Helpers to add user defined class metamedhods - __add, __sub etc. The helpers are needed + for the following issue: Lua runtime checks for metamethod existence with rawget function + ignoring our SWIG-provided __index and __newindex functions. Thus our inheritance-aware method + search algorithm doesn't work in such case. (Not to say that Lua runtime queries metamethod directly + in metatable and not in object). + Current solution is this: if somewhere in hierarchy metamethod __x is defined, then all descendants + are automatically given a special proxy __x that calls the real __x method. + Obvious idea - to copy __x instead of creating __x-proxy is wrong because if someone changes __x in runtime, + those changes must be reflected in all descendants. */ -SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss) + +SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/ + +/* The real function that resolves a metamethod. + * Function searches given class and all it's bases(recursively) for first instance of something that is + * not equal to SWIG_Lua_resolve_metatmethod. (Almost always this 'something' is actual metamethod implementation + * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the + * answer. + * Returns 1 if found, 0 otherwise. + * clss is class which metatable we will search for method + * metamethod_name_idx is index in L where metamethod name (as string) lies + * skip_check allows to skip searching metamethod in givel clss and immideatelly go to searching in bases. skip_check + * is not caried to subsequent recursive calls - false is always passed. It is set to true only at first call from + * SWIG_Lua_resolve_metamethod + * */ +SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx, + int skip_check) { - int i=0; - swig_module_info* module=SWIG_GetModule(L); - for(i=0;clss->base_names[i];i++) + /* This function is called recursively */ + int result = 0; + int i = 0; + + if (!skip_check) { + SWIG_Lua_get_class_metatable(L, clss->fqname); + lua_pushvalue(L, metamethod_name_idx); + lua_rawget(L,-2); + /* If this is cfunction and it is equal to SWIG_Lua_resolve_metamethod then + * this isn't the function we are looking for :) + * lua_tocfunction will return NULL if not cfunction + */ + if (!lua_isnil(L,-1) && lua_tocfunction(L,-1) != SWIG_Lua_resolve_metamethod ) { + lua_remove(L,-2); /* removing class metatable */ + return 1; + } + lua_pop(L,2); /* remove class metatable and query result */ + } + + /* Forwarding calls to bases */ + for(i=0;clss->bases[i];i++) { - if (clss->bases[i]==0) /* not found yet */ - { - /* lookup and cache the base class */ - swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); - if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; + result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0); + if (result) + break; + } + + return result; +} + +/* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method + * and calls it */ +SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L) +{ + int numargs; + int metamethod_name_idx; + const swig_lua_class* clss; + int result; + + lua_checkstack(L,5); + numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */ + + /* Get upvalues from closure */ + lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/ + metamethod_name_idx = lua_gettop(L); + + lua_pushvalue(L, lua_upvalueindex(2)); + clss = (const swig_lua_class*)(lua_touserdata(L,-1)); + lua_pop(L,1); /* remove lightuserdata with clss from stack */ + + /* Actual work */ + result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1); + if (!result) { + SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation."); + lua_error(L); + return 0; + } + + lua_remove(L,-2); /* remove metamethod key */ + lua_insert(L,1); /* move function to correct position */ + lua_call(L, numargs, LUA_MULTRET); + return lua_gettop(L); /* return all results */ +} + + +/* If given metamethod must be present in given class, then creates appropriate proxy + * Returns 1 if successfully added, 0 if not added because no base class has it, -1 + * if method is defined in the class metatable itself + */ +SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index) +{ + int key_index; + int success = 0; + int i = 0; + + /* metamethod name - on the top of the stack */ + assert(lua_isstring(L,-1)); + + key_index = lua_gettop(L); + + /* Check whether method is already defined in metatable */ + lua_pushvalue(L,key_index); /* copy of the key */ + lua_gettable(L,metatable_index); + if( !lua_isnil(L,-1) ) { + lua_pop(L,1); + return -1; + } + lua_pop(L,1); + + /* Iterating over immediate bases */ + for(i=0;clss->bases[i];i++) + { + const swig_lua_class *base = clss->bases[i]; + SWIG_Lua_get_class_metatable(L, base->fqname); + lua_pushvalue(L, key_index); + lua_rawget(L, -2); + if( !lua_isnil(L,-1) ) { + lua_pushvalue(L, key_index); + + /* Add proxy function */ + lua_pushvalue(L, key_index); /* first closure value is function name */ + lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */ + lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2); + + lua_rawset(L, metatable_index); + success = 1; + } + lua_pop(L,1); /* remove function or nil */ + lua_pop(L,1); /* remove base class metatable */ + + if( success ) + break; + } + + return success; +} + +SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss) +{ + int metatable_index; + int metamethods_info_index; + int tostring_undefined; + int eq_undefined = 0; + + SWIG_Lua_get_class_metatable(L, clss->fqname); + metatable_index = lua_gettop(L); + SWIG_Lua_get_inheritable_metamethods(L); + assert(lua_istable(L,-1)); + metamethods_info_index = lua_gettop(L); + lua_pushnil(L); /* first key */ + while(lua_next(L, metamethods_info_index) != 0 ) { + /* key at index -2, value at index -1 */ + const int is_inheritable = lua_toboolean(L,-2); + lua_pop(L,1); /* remove value - we don't need it anymore */ + + if(is_inheritable) { /* if metamethod is inheritable */ + SWIG_Lua_add_class_user_metamethod(L,clss,metatable_index); } } + + lua_pop(L,1); /* remove inheritable metatmethods table */ + + /* Special handling for __tostring method */ + lua_pushstring(L, "__tostring"); + lua_pushvalue(L,-1); + lua_rawget(L,metatable_index); + tostring_undefined = lua_isnil(L,-1); + lua_pop(L,1); + if( tostring_undefined ) { + lua_pushcfunction(L, SWIG_Lua_class_tostring); + lua_rawset(L, metatable_index); + } else { + lua_pop(L,1); /* remove copy of the key */ + } + + /* Special handling for __eq method */ + lua_pushstring(L, "__eq"); + lua_pushvalue(L,-1); + lua_rawget(L,metatable_index); + eq_undefined = lua_isnil(L,-1); + lua_pop(L,1); + if( eq_undefined ) { + lua_pushcfunction(L, SWIG_Lua_class_equal); + lua_rawset(L, metatable_index); + } else { + lua_pop(L,1); /* remove copy of the key */ + } + /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[] + * a __getitem/__setitem method should be defined + */ + lua_pop(L,1); /* pop class metatable */ } /* Register class static methods,attributes etc as well as constructor proxy */ -SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* clss) +SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss) { + const int SWIGUNUSED begin = lua_gettop(L); lua_checkstack(L,5); /* just in case */ assert(lua_istable(L,-1)); /* just in case */ - assert(strcmp(clss->name, clss->cls_static.name) == 0); /* in class those 2 must be equal */ + assert(strcmp(clss->name, clss->cls_static->name) == 0); /* in class those 2 must be equal */ - SWIG_Lua_namespace_register(L,&clss->cls_static); + SWIG_Lua_namespace_register(L,clss->cls_static, 1); - SWIG_Lua_get_table(L,clss->name); // Get namespace table back assert(lua_istable(L,-1)); /* just in case */ /* add its constructor to module with the name of the class @@ -1579,10 +2293,9 @@ SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* cls (this overcomes the problem of pure virtual classes without constructors)*/ if (clss->constructor) { - SWIG_Lua_add_function(L,".constructor", clss->constructor); lua_getmetatable(L,-1); assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,"__call", SWIG_Lua_constructor_proxy); + SWIG_Lua_add_function(L,"__call", clss->constructor); lua_pop(L,1); } @@ -1591,19 +2304,60 @@ SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* cls /* clear stack */ lua_pop(L,1); + assert( lua_gettop(L) == begin ); } -/* performs the entire class registration process */ -SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss) +/* Performs the instance (non-static) class registration process. Metatable for class is created + * and added to the class registry. + */ +SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss) { - SWIG_Lua_class_register_static(L,clss); - + const int SWIGUNUSED begin = lua_gettop(L); + int i; + /* if name already there (class is already registered) then do nothing */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + lua_rawget(L,-2); + if(!lua_isnil(L,-1)) { + lua_pop(L,2); + assert(lua_gettop(L)==begin); + return; + } + lua_pop(L,2); /* tidy stack */ + /* Recursively initialize all bases */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_class_register_instance(L,clss->bases[i]); + } + /* Again, get registry and push name */ SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->name); /* get the name */ + lua_pushstring(L,clss->fqname); /* get the name */ lua_newtable(L); /* create the metatable */ +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + /* If squashing is requested, then merges all bases metatable into this one. + * It would get us all special methods: __getitem, __add etc. + * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away + */ + { + int new_metatable_index = lua_absindex(L,-1); + for(i=0;clss->bases[i];i++) + { + int base_metatable; + SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); + base_metatable = lua_absindex(L,-1); + SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable); + lua_pop(L,1); + } + } + /* And now we will overwrite all incorrectly set data */ +#endif /* add string of class name called ".type" */ lua_pushstring(L,".type"); - lua_pushstring(L,clss->name); + lua_pushstring(L,clss->fqname); + lua_rawset(L,-3); + /* add a table called bases */ + lua_pushstring(L,".bases"); + lua_newtable(L); lua_rawset(L,-3); /* add a table called ".get" */ lua_pushstring(L,".get"); @@ -1623,27 +2377,99 @@ SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss) SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); - /* add tostring method for better output */ - SWIG_Lua_add_function(L,"__tostring",SWIG_Lua_class_tostring); /* add it */ lua_rawset(L,-3); /* metatable into registry */ lua_pop(L,1); /* tidy stack (remove registry) */ + assert(lua_gettop(L) == begin); - SWIG_Lua_get_class_metatable(L,clss->name); - SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */ +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + /* Now merge all symbols from .fn, .set, .get etc from bases to our tables */ + SWIG_Lua_class_squash_bases(L,clss); +#endif + SWIG_Lua_get_class_metatable(L,clss->fqname); + SWIG_Lua_add_class_instance_details(L,clss); /* recursive adding of details (atts & ops) */ lua_pop(L,1); /* tidy stack (remove class metatable) */ + assert( lua_gettop(L) == begin ); +} + +SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss) +{ + int SWIGUNUSED begin; + assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */ + SWIG_Lua_class_register_instance(L,clss); + SWIG_Lua_class_register_static(L,clss); + + /* Add links from static part to instance part and vice versa */ + /* [SWIG registry] [Module] + * "MyClass" ----> [MyClass metatable] <===== "MyClass" -+> [static part] + * ".get" ----> ... | | getmetatable()----| + * ".set" ----> ... | | | + * ".static" --------------)----------------/ [static part metatable] + * | ".get" --> ... + * | ".set" --> .... + * |=============================== ".instance" + */ + begin = lua_gettop(L); + lua_pushstring(L,clss->cls_static->name); + lua_rawget(L,-2); /* get class static table */ + assert(lua_istable(L,-1)); + lua_getmetatable(L,-1); + assert(lua_istable(L,-1)); /* get class static metatable */ + lua_pushstring(L,".instance"); /* prepare key */ + + SWIG_Lua_get_class_metatable(L,clss->fqname); /* get class metatable */ + assert(lua_istable(L,-1)); + lua_pushstring(L,".static"); /* prepare key */ + lua_pushvalue(L, -4); /* push static class TABLE */ + assert(lua_istable(L,-1)); + lua_rawset(L,-3); /* assign static class table(!NOT metatable) as ".static" member of class metatable */ + lua_rawset(L,-3); /* assign class metatable as ".instance" member of class static METATABLE */ + lua_pop(L,2); + assert(lua_gettop(L) == begin); +} +#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss) +{ + const int SWIGUNUSED begin = lua_gettop(L); + int i; + /* if name already there (class is already registered) then do nothing */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + lua_rawget(L,-2); + if(!lua_isnil(L,-1)) { + lua_pop(L,2); + assert(lua_gettop(L)==begin); + return; + } + lua_pop(L,2); /* tidy stack */ + /* Recursively initialize all bases */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_elua_class_register_instance(L,clss->bases[i]); + } + /* Again, get registry and push name */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + assert(clss->metatable); + lua_pushrotable(L, (void*)(clss->metatable)); /* create the metatable */ + lua_rawset(L,-3); + lua_pop(L,1); + assert(lua_gettop(L) == begin); } +#endif /* elua && eluac */ /* ----------------------------------------------------------------------------- * Class/structure conversion fns * ----------------------------------------------------------------------------- */ /* helper to add metatable to new lua object */ -SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type) +SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L,swig_type_info *type) { if (type->clientdata) /* there is clientdata: so add the metatable */ { - SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name); + SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->fqname); if (lua_istable(L,-1)) { lua_setmetatable(L,-2); @@ -1656,9 +2482,9 @@ SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type) } /* pushes a new object into the lua stack */ -SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own) +SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own) { - swig_lua_userdata* usr; + swig_lua_userdata *usr; if (!ptr){ lua_pushnil(L); return; @@ -1668,15 +2494,15 @@ SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *t usr->type=type; usr->own=own; #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) - _SWIG_Lua_AddMetatable(L,type); /* add metatable */ + SWIG_Lua_AddMetatable(L,type); /* add metatable */ #endif } /* takes a object from the lua stack & converts it into an object of the correct type (if possible) */ -SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags) +SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type_info *type,int flags) { - swig_lua_userdata* usr; + swig_lua_userdata *usr; swig_cast_info *cast; if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */ usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ @@ -1703,9 +2529,9 @@ SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type return SWIG_ERROR; /* error */ } -SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags, - int argnum,const char* func_name){ - void* result; +SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State *L,int index,swig_type_info *type,int flags, + int argnum,const char *func_name){ + void *result; if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ luaL_error (L,"Error in %s, expected a %s at argument number %d\n", func_name,(type && type->str)?type->str:"void*",argnum); @@ -1714,21 +2540,21 @@ SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *typ } /* pushes a packed userdata. user for member fn pointers only */ -SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type) +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type) { - swig_lua_rawdata* raw; + swig_lua_rawdata *raw; assert(ptr); /* not acceptable to pass in a NULL value */ raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ raw->type=type; raw->own=0; memcpy(raw->data,ptr,size); /* copy the data */ - _SWIG_Lua_AddMetatable(L,type); /* add metatable */ + SWIG_Lua_AddMetatable(L,type); /* add metatable */ } /* converts a packed userdata. user for member fn pointers only */ -SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type) +SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type) { - swig_lua_rawdata* raw; + swig_lua_rawdata *raw; raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ if (!raw) return SWIG_ERROR; /* error */ if (type==0 || type==raw->type) /* void* or identical type */ @@ -1742,7 +2568,7 @@ SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t /* a function to get the typestring of a piece of data */ SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) { - swig_lua_userdata* usr; + swig_lua_userdata *usr; if (lua_isuserdata(L,tp)) { usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */ @@ -1754,29 +2580,12 @@ SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) } /* lua callable function to get the userdata's type */ -SWIGRUNTIME int SWIG_Lua_type(lua_State* L) +SWIGRUNTIME int SWIG_Lua_type(lua_State *L) { lua_pushstring(L,SWIG_Lua_typename(L,1)); return 1; } -/* lua callable function to compare userdata's value -the issue is that two userdata may point to the same thing -but to lua, they are different objects */ -SWIGRUNTIME int SWIG_Lua_equal(lua_State* L) -{ - int result; - swig_lua_userdata *usr1,*usr2; - if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ - return 0; /* nil reply */ - usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ - /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ - result=(usr1->ptr==usr2->ptr); - lua_pushboolean(L,result); - return 1; -} - /* ----------------------------------------------------------------------------- * global variable support code: class/struct typemap functions * ----------------------------------------------------------------------------- */ @@ -1784,13 +2593,13 @@ SWIGRUNTIME int SWIG_Lua_equal(lua_State* L) #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) /* Install Constants */ SWIGINTERN void -SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { +SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) { int i; for (i = 0; constants[i].type; i++) { switch(constants[i].type) { case SWIG_LUA_INT: lua_pushstring(L,constants[i].name); - lua_pushnumber(L,(lua_Number)constants[i].lvalue); + lua_pushinteger(L,(lua_Number)constants[i].lvalue); lua_rawset(L,-3); break; case SWIG_LUA_FLOAT: @@ -1800,7 +2609,10 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { break; case SWIG_LUA_CHAR: lua_pushstring(L,constants[i].name); - lua_pushfstring(L,"%c",(char)constants[i].lvalue); + { + char c = constants[i].lvalue; + lua_pushlstring(L,&c,1); + } lua_rawset(L,-3); break; case SWIG_LUA_STRING: @@ -1834,11 +2646,11 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { #endif /* Executes a C string in Lua which is a really simple way of calling lua from C Unfortunately lua keeps changing its APIs, so we need a conditional compile -In lua 5.0.X its lua_dostring() -In lua 5.1.X its luaL_dostring() +In lua 5.0.X it's lua_dostring() +In lua 5.1.X it's luaL_dostring() */ SWIGINTERN int -SWIG_Lua_dostring(lua_State *L, const char* str) { +SWIG_Lua_dostring(lua_State *L, const char *str) { int ok,top; if (str==0 || str[0]==0) return 0; /* nothing to do */ top=lua_gettop(L); /* save stack */ @@ -1928,12 +2740,13 @@ SWIG_Lua_dostring(lua_State *L, const char* str) { #define SWIGTYPE_p_rlWebcam swig_types[62] #define SWIGTYPE_p_short swig_types[63] #define SWIGTYPE_p_sockaddr_in swig_types[64] -#define SWIGTYPE_p_unsigned_char swig_types[65] -#define SWIGTYPE_p_unsigned_int swig_types[66] -#define SWIGTYPE_p_unsigned_short swig_types[67] -#define SWIGTYPE_p_void swig_types[68] -static swig_type_info *swig_types[70]; -static swig_module_info swig_module = {swig_types, 69, 0, 0, 0, 0}; +#define SWIGTYPE_p_std__shared_ptrT_rlSharedMemory__LockUserAddr_t swig_types[65] +#define SWIGTYPE_p_unsigned_char swig_types[66] +#define SWIGTYPE_p_unsigned_int swig_types[67] +#define SWIGTYPE_p_unsigned_short swig_types[68] +#define SWIGTYPE_p_void swig_types[69] +static swig_type_info *swig_types[71]; +static swig_module_info swig_module = {swig_types, 70, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -2179,27 +2992,51 @@ static void swig_delete_THREAD_PARAM(void *obj) { THREAD_PARAM *arg1 = (THREAD_PARAM *) obj; delete arg1; } -static swig_lua_method swig_THREAD_PARAM_methods[] = { - {0,0} -}; +static int _proxy__wrap_new_THREAD_PARAM(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_THREAD_PARAM); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_THREAD_PARAM_attributes[] = { - { "thread", _wrap_THREAD_PARAM_thread_get, _wrap_THREAD_PARAM_thread_set}, - { "user", _wrap_THREAD_PARAM_user_get, _wrap_THREAD_PARAM_user_set}, - { "running", _wrap_THREAD_PARAM_running_get, _wrap_THREAD_PARAM_running_set}, + { "thread", _wrap_THREAD_PARAM_thread_get, _wrap_THREAD_PARAM_thread_set }, + { "user", _wrap_THREAD_PARAM_user_get, _wrap_THREAD_PARAM_user_set }, + { "running", _wrap_THREAD_PARAM_running_get, _wrap_THREAD_PARAM_running_set }, {0,0,0} }; -static swig_lua_attribute swig_THREAD_PARAM_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_THREAD_PARAM_methods[]= { + {0,0} }; -static swig_lua_method swig_THREAD_PARAM_cls_methods[] = { +static swig_lua_method swig_THREAD_PARAM_meta[] = { {0,0} }; -static swig_lua_const_info swig_THREAD_PARAM_cls_constants[] = { + +static swig_lua_attribute swig_THREAD_PARAM_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_THREAD_PARAM_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_THREAD_PARAM_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_THREAD_PARAM_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_THREAD_PARAM_Sf_SwigStatic = { + "THREAD_PARAM", + swig_THREAD_PARAM_Sf_SwigStatic_methods, + swig_THREAD_PARAM_Sf_SwigStatic_attributes, + swig_THREAD_PARAM_Sf_SwigStatic_constants, + swig_THREAD_PARAM_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_THREAD_PARAM_bases[] = {0}; static const char *swig_THREAD_PARAM_base_names[] = {0}; -static swig_lua_class _wrap_class_THREAD_PARAM = { "THREAD_PARAM", &SWIGTYPE_p_THREAD_PARAM,_wrap_new_THREAD_PARAM, swig_delete_THREAD_PARAM, swig_THREAD_PARAM_methods, swig_THREAD_PARAM_attributes, { "THREAD_PARAM", swig_THREAD_PARAM_cls_methods, swig_THREAD_PARAM_cls_attributes, swig_THREAD_PARAM_cls_constants }, swig_THREAD_PARAM_bases, swig_THREAD_PARAM_base_names }; +static swig_lua_class _wrap_class_THREAD_PARAM = { "THREAD_PARAM", "THREAD_PARAM", &SWIGTYPE_p_THREAD_PARAM,_proxy__wrap_new_THREAD_PARAM, swig_delete_THREAD_PARAM, swig_THREAD_PARAM_methods, swig_THREAD_PARAM_attributes, &swig_THREAD_PARAM_Sf_SwigStatic, swig_THREAD_PARAM_meta, swig_THREAD_PARAM_bases, swig_THREAD_PARAM_base_names }; static int _wrap_new_rlThread__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -2741,37 +3578,61 @@ static void swig_delete_rlThread(void *obj) { rlThread *arg1 = (rlThread *) obj; delete arg1; } -static swig_lua_method swig_rlThread_methods[] = { - {"create", _wrap_rlThread_create}, - {"trylock", _wrap_rlThread_trylock}, - {"lock", _wrap_rlThread_lock}, - {"unlock", _wrap_rlThread_unlock}, - {"waitSemaphore", _wrap_rlThread_waitSemaphore}, - {"incrementSemaphore", _wrap_rlThread_incrementSemaphore}, - {"join", _wrap_rlThread_join}, - {"cancel", _wrap_rlThread_cancel}, - {"threadExit", _wrap_rlThread_threadExit}, - {0,0} -}; +static int _proxy__wrap_new_rlThread(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlThread); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlThread_attributes[] = { - { "tid", _wrap_rlThread_tid_get, _wrap_rlThread_tid_set}, - { "attr", _wrap_rlThread_attr_get, _wrap_rlThread_attr_set}, - { "mutex", _wrap_rlThread_mutex_get, _wrap_rlThread_mutex_set}, - { "semaphore", _wrap_rlThread_semaphore_get, _wrap_rlThread_semaphore_set}, + { "tid", _wrap_rlThread_tid_get, _wrap_rlThread_tid_set }, + { "attr", _wrap_rlThread_attr_get, _wrap_rlThread_attr_set }, + { "mutex", _wrap_rlThread_mutex_get, _wrap_rlThread_mutex_set }, + { "semaphore", _wrap_rlThread_semaphore_get, _wrap_rlThread_semaphore_set }, {0,0,0} }; -static swig_lua_attribute swig_rlThread_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlThread_methods[]= { + { "create", _wrap_rlThread_create}, + { "trylock", _wrap_rlThread_trylock}, + { "lock", _wrap_rlThread_lock}, + { "unlock", _wrap_rlThread_unlock}, + { "waitSemaphore", _wrap_rlThread_waitSemaphore}, + { "incrementSemaphore", _wrap_rlThread_incrementSemaphore}, + { "join", _wrap_rlThread_join}, + { "cancel", _wrap_rlThread_cancel}, + { "threadExit", _wrap_rlThread_threadExit}, + {0,0} }; -static swig_lua_method swig_rlThread_cls_methods[] = { +static swig_lua_method swig_rlThread_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlThread_cls_constants[] = { + +static swig_lua_attribute swig_rlThread_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlThread_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlThread_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlThread_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlThread_Sf_SwigStatic = { + "rlThread", + swig_rlThread_Sf_SwigStatic_methods, + swig_rlThread_Sf_SwigStatic_attributes, + swig_rlThread_Sf_SwigStatic_constants, + swig_rlThread_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlThread_bases[] = {0}; static const char *swig_rlThread_base_names[] = {0}; -static swig_lua_class _wrap_class_rlThread = { "rlThread", &SWIGTYPE_p_rlThread,_wrap_new_rlThread, swig_delete_rlThread, swig_rlThread_methods, swig_rlThread_attributes, { "rlThread", swig_rlThread_cls_methods, swig_rlThread_cls_attributes, swig_rlThread_cls_constants }, swig_rlThread_bases, swig_rlThread_base_names }; +static swig_lua_class _wrap_class_rlThread = { "rlThread", "rlThread", &SWIGTYPE_p_rlThread,_proxy__wrap_new_rlThread, swig_delete_rlThread, swig_rlThread_methods, swig_rlThread_attributes, &swig_rlThread_Sf_SwigStatic, swig_rlThread_meta, swig_rlThread_bases, swig_rlThread_base_names }; static int _wrap_new_rlMutex__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -2978,30 +3839,54 @@ static void swig_delete_rlMutex(void *obj) { rlMutex *arg1 = (rlMutex *) obj; delete arg1; } -static swig_lua_method swig_rlMutex_methods[] = { - {"trylock", _wrap_rlMutex_trylock}, - {"lock", _wrap_rlMutex_lock}, - {"unlock", _wrap_rlMutex_unlock}, - {0,0} -}; +static int _proxy__wrap_new_rlMutex(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlMutex); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlMutex_attributes[] = { - { "mutex", _wrap_rlMutex_mutex_get, _wrap_rlMutex_mutex_set}, + { "mutex", _wrap_rlMutex_mutex_get, _wrap_rlMutex_mutex_set }, {0,0,0} }; -static swig_lua_attribute swig_rlMutex_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlMutex_methods[]= { + { "trylock", _wrap_rlMutex_trylock}, + { "lock", _wrap_rlMutex_lock}, + { "unlock", _wrap_rlMutex_unlock}, + {0,0} }; -static swig_lua_method swig_rlMutex_cls_methods[] = { +static swig_lua_method swig_rlMutex_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlMutex_cls_constants[] = { + +static swig_lua_attribute swig_rlMutex_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlMutex_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; -static swig_lua_class *swig_rlMutex_bases[] = {0}; -static const char *swig_rlMutex_base_names[] = {0}; -static swig_lua_class _wrap_class_rlMutex = { "rlMutex", &SWIGTYPE_p_rlMutex,_wrap_new_rlMutex, swig_delete_rlMutex, swig_rlMutex_methods, swig_rlMutex_attributes, { "rlMutex", swig_rlMutex_cls_methods, swig_rlMutex_cls_attributes, swig_rlMutex_cls_constants }, swig_rlMutex_bases, swig_rlMutex_base_names }; - -static int _wrap_new_rlSemaphore__SWIG_0(lua_State* L) { +static swig_lua_method swig_rlMutex_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlMutex_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlMutex_Sf_SwigStatic = { + "rlMutex", + swig_rlMutex_Sf_SwigStatic_methods, + swig_rlMutex_Sf_SwigStatic_attributes, + swig_rlMutex_Sf_SwigStatic_constants, + swig_rlMutex_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_rlMutex_bases[] = {0}; +static const char *swig_rlMutex_base_names[] = {0}; +static swig_lua_class _wrap_class_rlMutex = { "rlMutex", "rlMutex", &SWIGTYPE_p_rlMutex,_proxy__wrap_new_rlMutex, swig_delete_rlMutex, swig_rlMutex_methods, swig_rlMutex_attributes, &swig_rlMutex_Sf_SwigStatic, swig_rlMutex_meta, swig_rlMutex_bases, swig_rlMutex_base_names }; + +static int _wrap_new_rlSemaphore__SWIG_0(lua_State* L) { int SWIG_arg = 0; int arg1 ; rlSemaphore *result = 0 ; @@ -3177,27 +4062,51 @@ static void swig_delete_rlSemaphore(void *obj) { rlSemaphore *arg1 = (rlSemaphore *) obj; delete arg1; } -static swig_lua_method swig_rlSemaphore_methods[] = { - {"waitSemaphore", _wrap_rlSemaphore_waitSemaphore}, - {"incrementSemaphore", _wrap_rlSemaphore_incrementSemaphore}, - {0,0} -}; +static int _proxy__wrap_new_rlSemaphore(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSemaphore); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSemaphore_attributes[] = { - { "semaphore", _wrap_rlSemaphore_semaphore_get, _wrap_rlSemaphore_semaphore_set}, + { "semaphore", _wrap_rlSemaphore_semaphore_get, _wrap_rlSemaphore_semaphore_set }, {0,0,0} }; -static swig_lua_attribute swig_rlSemaphore_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSemaphore_methods[]= { + { "waitSemaphore", _wrap_rlSemaphore_waitSemaphore}, + { "incrementSemaphore", _wrap_rlSemaphore_incrementSemaphore}, + {0,0} }; -static swig_lua_method swig_rlSemaphore_cls_methods[] = { +static swig_lua_method swig_rlSemaphore_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSemaphore_cls_constants[] = { + +static swig_lua_attribute swig_rlSemaphore_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSemaphore_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSemaphore_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSemaphore_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSemaphore_Sf_SwigStatic = { + "rlSemaphore", + swig_rlSemaphore_Sf_SwigStatic_methods, + swig_rlSemaphore_Sf_SwigStatic_attributes, + swig_rlSemaphore_Sf_SwigStatic_constants, + swig_rlSemaphore_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSemaphore_bases[] = {0}; static const char *swig_rlSemaphore_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSemaphore = { "rlSemaphore", &SWIGTYPE_p_rlSemaphore,_wrap_new_rlSemaphore, swig_delete_rlSemaphore, swig_rlSemaphore_methods, swig_rlSemaphore_attributes, { "rlSemaphore", swig_rlSemaphore_cls_methods, swig_rlSemaphore_cls_attributes, swig_rlSemaphore_cls_constants }, swig_rlSemaphore_bases, swig_rlSemaphore_base_names }; +static swig_lua_class _wrap_class_rlSemaphore = { "rlSemaphore", "rlSemaphore", &SWIGTYPE_p_rlSemaphore,_proxy__wrap_new_rlSemaphore, swig_delete_rlSemaphore, swig_rlSemaphore_methods, swig_rlSemaphore_attributes, &swig_rlSemaphore_Sf_SwigStatic, swig_rlSemaphore_meta, swig_rlSemaphore_bases, swig_rlSemaphore_base_names }; static int _wrap_new_rlSharedMemory__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -3676,6 +4585,33 @@ static int _wrap_rlSharedMemory_getUserAdr(lua_State* L) { } +static int _wrap_rlSharedMemory_getLock(lua_State* L) { + int SWIG_arg = 0; + rlSharedMemory *arg1 = (rlSharedMemory *) 0 ; + SwigValueWrapper< std::shared_ptr< rlSharedMemory::LockUserAddr > > result; + + SWIG_check_num_args("rlSharedMemory::getLock",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlSharedMemory::getLock",1,"rlSharedMemory *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlSharedMemory,0))){ + SWIG_fail_ptr("rlSharedMemory_getLock",1,SWIGTYPE_p_rlSharedMemory); + } + + result = (arg1)->getLock(); + { + std::shared_ptr< rlSharedMemory::LockUserAddr > * resultptr = new std::shared_ptr< rlSharedMemory::LockUserAddr >((const std::shared_ptr< rlSharedMemory::LockUserAddr > &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_std__shared_ptrT_rlSharedMemory__LockUserAddr_t,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_rlSharedMemory_shmKey(lua_State* L) { int SWIG_arg = 0; rlSharedMemory *arg1 = (rlSharedMemory *) 0 ; @@ -3860,36 +4796,46 @@ static void swig_delete_rlSharedMemory(void *obj) { rlSharedMemory *arg1 = (rlSharedMemory *) obj; delete arg1; } -static swig_lua_method swig_rlSharedMemory_methods[] = { - {"deleteSharedMemory", _wrap_rlSharedMemory_deleteSharedMemory}, - {"write", _wrap_rlSharedMemory_write}, - {"read", _wrap_rlSharedMemory_read}, - {"readInt", _wrap_rlSharedMemory_readInt}, - {"readShort", _wrap_rlSharedMemory_readShort}, - {"readByte", _wrap_rlSharedMemory_readByte}, - {"readFloat", _wrap_rlSharedMemory_readFloat}, - {"writeInt", _wrap_rlSharedMemory_writeInt}, - {"writeShort", _wrap_rlSharedMemory_writeShort}, - {"writeByte", _wrap_rlSharedMemory_writeByte}, - {"writeFloat", _wrap_rlSharedMemory_writeFloat}, - {"getUserAdr", _wrap_rlSharedMemory_getUserAdr}, - {"shmKey", _wrap_rlSharedMemory_shmKey}, - {"shmId", _wrap_rlSharedMemory_shmId}, - {"size", _wrap_rlSharedMemory_size}, - {0,0} -}; +static int _proxy__wrap_new_rlSharedMemory(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSharedMemory); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSharedMemory_attributes[] = { - { "status", _wrap_rlSharedMemory_status_get, _wrap_rlSharedMemory_status_set}, - { "name", _wrap_rlSharedMemory_name_get, _wrap_rlSharedMemory_name_set}, + { "status", _wrap_rlSharedMemory_status_get, _wrap_rlSharedMemory_status_set }, + { "name", _wrap_rlSharedMemory_name_get, _wrap_rlSharedMemory_name_set }, {0,0,0} }; -static swig_lua_attribute swig_rlSharedMemory_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSharedMemory_methods[]= { + { "deleteSharedMemory", _wrap_rlSharedMemory_deleteSharedMemory}, + { "write", _wrap_rlSharedMemory_write}, + { "read", _wrap_rlSharedMemory_read}, + { "readInt", _wrap_rlSharedMemory_readInt}, + { "readShort", _wrap_rlSharedMemory_readShort}, + { "readByte", _wrap_rlSharedMemory_readByte}, + { "readFloat", _wrap_rlSharedMemory_readFloat}, + { "writeInt", _wrap_rlSharedMemory_writeInt}, + { "writeShort", _wrap_rlSharedMemory_writeShort}, + { "writeByte", _wrap_rlSharedMemory_writeByte}, + { "writeFloat", _wrap_rlSharedMemory_writeFloat}, + { "getUserAdr", _wrap_rlSharedMemory_getUserAdr}, + { "getLock", _wrap_rlSharedMemory_getLock}, + { "shmKey", _wrap_rlSharedMemory_shmKey}, + { "shmId", _wrap_rlSharedMemory_shmId}, + { "size", _wrap_rlSharedMemory_size}, + {0,0} }; -static swig_lua_method swig_rlSharedMemory_cls_methods[] = { +static swig_lua_method swig_rlSharedMemory_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSharedMemory_cls_constants[] = { + +static swig_lua_attribute swig_rlSharedMemory_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSharedMemory_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("OK", rlSharedMemory::OK)}, {SWIG_LUA_CONSTTAB_INT("ERROR_FILE", rlSharedMemory::ERROR_FILE)}, {SWIG_LUA_CONSTTAB_INT("ERROR_SHMGET", rlSharedMemory::ERROR_SHMGET)}, @@ -3897,9 +4843,24 @@ static swig_lua_const_info swig_rlSharedMemory_cls_constants[] = { {SWIG_LUA_CONSTTAB_INT("ERROR_SHMCTL", rlSharedMemory::ERROR_SHMCTL)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSharedMemory_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSharedMemory_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSharedMemory_Sf_SwigStatic = { + "rlSharedMemory", + swig_rlSharedMemory_Sf_SwigStatic_methods, + swig_rlSharedMemory_Sf_SwigStatic_attributes, + swig_rlSharedMemory_Sf_SwigStatic_constants, + swig_rlSharedMemory_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSharedMemory_bases[] = {0}; static const char *swig_rlSharedMemory_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSharedMemory = { "rlSharedMemory", &SWIGTYPE_p_rlSharedMemory,_wrap_new_rlSharedMemory, swig_delete_rlSharedMemory, swig_rlSharedMemory_methods, swig_rlSharedMemory_attributes, { "rlSharedMemory", swig_rlSharedMemory_cls_methods, swig_rlSharedMemory_cls_attributes, swig_rlSharedMemory_cls_constants }, swig_rlSharedMemory_bases, swig_rlSharedMemory_base_names }; +static swig_lua_class _wrap_class_rlSharedMemory = { "rlSharedMemory", "rlSharedMemory", &SWIGTYPE_p_rlSharedMemory,_proxy__wrap_new_rlSharedMemory, swig_delete_rlSharedMemory, swig_rlSharedMemory_methods, swig_rlSharedMemory_attributes, &swig_rlSharedMemory_Sf_SwigStatic, swig_rlSharedMemory_meta, swig_rlSharedMemory_bases, swig_rlSharedMemory_base_names }; static int _wrap_new_rlIpAdr(lua_State* L) { int SWIG_arg = 0; @@ -4042,27 +5003,52 @@ static void swig_delete_rlIpAdr(void *obj) { rlIpAdr *arg1 = (rlIpAdr *) obj; delete arg1; } -static swig_lua_method swig_rlIpAdr_methods[] = { - {"setAdr", _wrap_rlIpAdr_setAdr}, - {"__eq", _wrap_rlIpAdr___eq}, - {0,0} -}; +static int _proxy__wrap_new_rlIpAdr(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlIpAdr); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlIpAdr_attributes[] = { - { "address", _wrap_rlIpAdr_address_get, _wrap_rlIpAdr_address_set}, + { "address", _wrap_rlIpAdr_address_get, _wrap_rlIpAdr_address_set }, {0,0,0} }; -static swig_lua_attribute swig_rlIpAdr_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlIpAdr_methods[]= { + { "setAdr", _wrap_rlIpAdr_setAdr}, + { "__eq", _wrap_rlIpAdr___eq}, + {0,0} }; -static swig_lua_method swig_rlIpAdr_cls_methods[] = { +static swig_lua_method swig_rlIpAdr_meta[] = { + { "__eq", _wrap_rlIpAdr___eq}, {0,0} }; -static swig_lua_const_info swig_rlIpAdr_cls_constants[] = { + +static swig_lua_attribute swig_rlIpAdr_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlIpAdr_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlIpAdr_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlIpAdr_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlIpAdr_Sf_SwigStatic = { + "rlIpAdr", + swig_rlIpAdr_Sf_SwigStatic_methods, + swig_rlIpAdr_Sf_SwigStatic_attributes, + swig_rlIpAdr_Sf_SwigStatic_constants, + swig_rlIpAdr_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlIpAdr_bases[] = {0}; static const char *swig_rlIpAdr_base_names[] = {0}; -static swig_lua_class _wrap_class_rlIpAdr = { "rlIpAdr", &SWIGTYPE_p_rlIpAdr,_wrap_new_rlIpAdr, swig_delete_rlIpAdr, swig_rlIpAdr_methods, swig_rlIpAdr_attributes, { "rlIpAdr", swig_rlIpAdr_cls_methods, swig_rlIpAdr_cls_attributes, swig_rlIpAdr_cls_constants }, swig_rlIpAdr_bases, swig_rlIpAdr_base_names }; +static swig_lua_class _wrap_class_rlIpAdr = { "rlIpAdr", "rlIpAdr", &SWIGTYPE_p_rlIpAdr,_proxy__wrap_new_rlIpAdr, swig_delete_rlIpAdr, swig_rlIpAdr_methods, swig_rlIpAdr_attributes, &swig_rlIpAdr_Sf_SwigStatic, swig_rlIpAdr_meta, swig_rlIpAdr_bases, swig_rlIpAdr_base_names }; static int _wrap_new_rlUdpSocket__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -4722,33 +5708,57 @@ static void swig_delete_rlUdpSocket(void *obj) { rlUdpSocket *arg1 = (rlUdpSocket *) obj; delete arg1; } -static swig_lua_method swig_rlUdpSocket_methods[] = { - {"setSockopt", _wrap_rlUdpSocket_setSockopt}, - {"bind", _wrap_rlUdpSocket_bind}, - {"select", _wrap_rlUdpSocket_select}, - {"recvfrom", _wrap_rlUdpSocket_recvfrom}, - {"sendto", _wrap_rlUdpSocket_sendto}, - {"printf", _wrap_rlUdpSocket_printf}, - {0,0} -}; +static int _proxy__wrap_new_rlUdpSocket(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlUdpSocket); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlUdpSocket_attributes[] = { - { "debug", _wrap_rlUdpSocket_debug_get, _wrap_rlUdpSocket_debug_set}, - { "readflag", _wrap_rlUdpSocket_readflag_get, _wrap_rlUdpSocket_readflag_set}, - { "writeflag", _wrap_rlUdpSocket_writeflag_get, _wrap_rlUdpSocket_writeflag_set}, + { "debug", _wrap_rlUdpSocket_debug_get, _wrap_rlUdpSocket_debug_set }, + { "readflag", _wrap_rlUdpSocket_readflag_get, _wrap_rlUdpSocket_readflag_set }, + { "writeflag", _wrap_rlUdpSocket_writeflag_get, _wrap_rlUdpSocket_writeflag_set }, {0,0,0} }; -static swig_lua_attribute swig_rlUdpSocket_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlUdpSocket_methods[]= { + { "setSockopt", _wrap_rlUdpSocket_setSockopt}, + { "bind", _wrap_rlUdpSocket_bind}, + { "select", _wrap_rlUdpSocket_select}, + { "recvfrom", _wrap_rlUdpSocket_recvfrom}, + { "sendto", _wrap_rlUdpSocket_sendto}, + { "printf", _wrap_rlUdpSocket_printf}, + {0,0} }; -static swig_lua_method swig_rlUdpSocket_cls_methods[] = { +static swig_lua_method swig_rlUdpSocket_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlUdpSocket_cls_constants[] = { + +static swig_lua_attribute swig_rlUdpSocket_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlUdpSocket_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlUdpSocket_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlUdpSocket_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlUdpSocket_Sf_SwigStatic = { + "rlUdpSocket", + swig_rlUdpSocket_Sf_SwigStatic_methods, + swig_rlUdpSocket_Sf_SwigStatic_attributes, + swig_rlUdpSocket_Sf_SwigStatic_constants, + swig_rlUdpSocket_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlUdpSocket_bases[] = {0}; static const char *swig_rlUdpSocket_base_names[] = {0}; -static swig_lua_class _wrap_class_rlUdpSocket = { "rlUdpSocket", &SWIGTYPE_p_rlUdpSocket,_wrap_new_rlUdpSocket, swig_delete_rlUdpSocket, swig_rlUdpSocket_methods, swig_rlUdpSocket_attributes, { "rlUdpSocket", swig_rlUdpSocket_cls_methods, swig_rlUdpSocket_cls_attributes, swig_rlUdpSocket_cls_constants }, swig_rlUdpSocket_bases, swig_rlUdpSocket_base_names }; +static swig_lua_class _wrap_class_rlUdpSocket = { "rlUdpSocket", "rlUdpSocket", &SWIGTYPE_p_rlUdpSocket,_proxy__wrap_new_rlUdpSocket, swig_delete_rlUdpSocket, swig_rlUdpSocket_methods, swig_rlUdpSocket_attributes, &swig_rlUdpSocket_Sf_SwigStatic, swig_rlUdpSocket_meta, swig_rlUdpSocket_bases, swig_rlUdpSocket_base_names }; static int _wrap_rlwsa(lua_State* L) { int SWIG_arg = 0; @@ -6125,40 +7135,49 @@ static void swig_delete_rlSocket(void *obj) { rlSocket *arg1 = (rlSocket *) obj; delete arg1; } -static swig_lua_method swig_rlSocket_methods[] = { - {"setAdr", _wrap_rlSocket_setAdr}, - {"setPort", _wrap_rlSocket_setPort}, - {"getPort", _wrap_rlSocket_getPort}, - {"setActive", _wrap_rlSocket_setActive}, - {"read", _wrap_rlSocket_read}, - {"readStr", _wrap_rlSocket_readStr}, - {"readHttpHeader", _wrap_rlSocket_readHttpHeader}, - {"write", _wrap_rlSocket_write}, - {"printf", _wrap_rlSocket_printf}, - {"connect", _wrap_rlSocket_connect}, - {"disconnect", _wrap_rlSocket_disconnect}, - {"select", _wrap_rlSocket_select}, - {"isConnected", _wrap_rlSocket_isConnected}, - {"setIPVersion", _wrap_rlSocket_setIPVersion}, - {"getIPVersion", _wrap_rlSocket_getIPVersion}, - {"sendProcessViewBrowserButtonEvent", _wrap_rlSocket_sendProcessViewBrowserButtonEvent}, - {"rlGetsockopt", _wrap_rlSocket_rlGetsockopt}, - {"rlSetsockopt", _wrap_rlSocket_rlSetsockopt}, - {"readHttpContentLength", _wrap_rlSocket_readHttpContentLength}, - {0,0} -}; +static int _proxy__wrap_new_rlSocket(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSocket); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSocket_attributes[] = { - { "s", _wrap_rlSocket_s_get, _wrap_rlSocket_s_set}, - { "sockaddr", _wrap_rlSocket_sockaddr_get, _wrap_rlSocket_sockaddr_set}, + { "s", _wrap_rlSocket_s_get, _wrap_rlSocket_s_set }, + { "sockaddr", _wrap_rlSocket_sockaddr_get, _wrap_rlSocket_sockaddr_set }, {0,0,0} }; -static swig_lua_attribute swig_rlSocket_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSocket_methods[]= { + { "setAdr", _wrap_rlSocket_setAdr}, + { "setPort", _wrap_rlSocket_setPort}, + { "getPort", _wrap_rlSocket_getPort}, + { "setActive", _wrap_rlSocket_setActive}, + { "read", _wrap_rlSocket_read}, + { "readStr", _wrap_rlSocket_readStr}, + { "readHttpHeader", _wrap_rlSocket_readHttpHeader}, + { "write", _wrap_rlSocket_write}, + { "printf", _wrap_rlSocket_printf}, + { "connect", _wrap_rlSocket_connect}, + { "disconnect", _wrap_rlSocket_disconnect}, + { "select", _wrap_rlSocket_select}, + { "isConnected", _wrap_rlSocket_isConnected}, + { "setIPVersion", _wrap_rlSocket_setIPVersion}, + { "getIPVersion", _wrap_rlSocket_getIPVersion}, + { "sendProcessViewBrowserButtonEvent", _wrap_rlSocket_sendProcessViewBrowserButtonEvent}, + { "rlGetsockopt", _wrap_rlSocket_rlGetsockopt}, + { "rlSetsockopt", _wrap_rlSocket_rlSetsockopt}, + { "readHttpContentLength", _wrap_rlSocket_readHttpContentLength}, + {0,0} }; -static swig_lua_method swig_rlSocket_cls_methods[] = { +static swig_lua_method swig_rlSocket_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSocket_cls_constants[] = { + +static swig_lua_attribute swig_rlSocket_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSocket_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("SOCKET_ERR", rlSocket::SOCKET_ERR)}, {SWIG_LUA_CONSTTAB_INT("SETSOCKOPT_ERR", rlSocket::SETSOCKOPT_ERR)}, {SWIG_LUA_CONSTTAB_INT("LISTEN_ERR", rlSocket::LISTEN_ERR)}, @@ -6168,9 +7187,24 @@ static swig_lua_const_info swig_rlSocket_cls_constants[] = { {SWIG_LUA_CONSTTAB_INT("PORT_ERR", rlSocket::PORT_ERR)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSocket_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSocket_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSocket_Sf_SwigStatic = { + "rlSocket", + swig_rlSocket_Sf_SwigStatic_methods, + swig_rlSocket_Sf_SwigStatic_attributes, + swig_rlSocket_Sf_SwigStatic_constants, + swig_rlSocket_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSocket_bases[] = {0}; static const char *swig_rlSocket_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSocket = { "rlSocket", &SWIGTYPE_p_rlSocket,_wrap_new_rlSocket, swig_delete_rlSocket, swig_rlSocket_methods, swig_rlSocket_attributes, { "rlSocket", swig_rlSocket_cls_methods, swig_rlSocket_cls_attributes, swig_rlSocket_cls_constants }, swig_rlSocket_bases, swig_rlSocket_base_names }; +static swig_lua_class _wrap_class_rlSocket = { "rlSocket", "rlSocket", &SWIGTYPE_p_rlSocket,_proxy__wrap_new_rlSocket, swig_delete_rlSocket, swig_rlSocket_methods, swig_rlSocket_attributes, &swig_rlSocket_Sf_SwigStatic, swig_rlSocket_meta, swig_rlSocket_bases, swig_rlSocket_base_names }; static int _wrap_new_rl3964R__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -6830,39 +7864,63 @@ static void swig_delete_rl3964R(void *obj) { rl3964R *arg1 = (rl3964R *) obj; delete arg1; } -static swig_lua_method swig_rl3964R_methods[] = { - {"open", _wrap_rl3964R_open}, - {"close", _wrap_rl3964R_close}, - {"setReadCallback", _wrap_rl3964R_setReadCallback}, - {"write", _wrap_rl3964R_write}, - {"send", _wrap_rl3964R_send}, - {"receive", _wrap_rl3964R_receive}, - {"dprintf", _wrap_rl3964R_dprintf}, - {0,0} -}; +static int _proxy__wrap_new_rl3964R(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rl3964R); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rl3964R_attributes[] = { - { "receiver", _wrap_rl3964R_receiver_get, _wrap_rl3964R_receiver_set}, - { "tty", _wrap_rl3964R_tty_get, _wrap_rl3964R_tty_set}, - { "state", _wrap_rl3964R_state_get, _wrap_rl3964R_state_set}, - { "priority", _wrap_rl3964R_priority_get, _wrap_rl3964R_priority_set}, - { "run", _wrap_rl3964R_run_get, _wrap_rl3964R_run_set}, - { "debug", _wrap_rl3964R_debug_get, _wrap_rl3964R_debug_set}, + { "receiver", _wrap_rl3964R_receiver_get, _wrap_rl3964R_receiver_set }, + { "tty", _wrap_rl3964R_tty_get, _wrap_rl3964R_tty_set }, + { "state", _wrap_rl3964R_state_get, _wrap_rl3964R_state_set }, + { "priority", _wrap_rl3964R_priority_get, _wrap_rl3964R_priority_set }, + { "run", _wrap_rl3964R_run_get, _wrap_rl3964R_run_set }, + { "debug", _wrap_rl3964R_debug_get, _wrap_rl3964R_debug_set }, {0,0,0} }; -static swig_lua_attribute swig_rl3964R_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rl3964R_methods[]= { + { "open", _wrap_rl3964R_open}, + { "close", _wrap_rl3964R_close}, + { "setReadCallback", _wrap_rl3964R_setReadCallback}, + { "write", _wrap_rl3964R_write}, + { "send", _wrap_rl3964R_send}, + { "receive", _wrap_rl3964R_receive}, + { "dprintf", _wrap_rl3964R_dprintf}, + {0,0} }; -static swig_lua_method swig_rl3964R_cls_methods[] = { +static swig_lua_method swig_rl3964R_meta[] = { {0,0} }; -static swig_lua_const_info swig_rl3964R_cls_constants[] = { + +static swig_lua_attribute swig_rl3964R_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rl3964R_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("highPriority", rl3964R::highPriority)}, {SWIG_LUA_CONSTTAB_INT("lowPriority", rl3964R::lowPriority)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rl3964R_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rl3964R_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rl3964R_Sf_SwigStatic = { + "rl3964R", + swig_rl3964R_Sf_SwigStatic_methods, + swig_rl3964R_Sf_SwigStatic_attributes, + swig_rl3964R_Sf_SwigStatic_constants, + swig_rl3964R_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rl3964R_bases[] = {0}; static const char *swig_rl3964R_base_names[] = {0}; -static swig_lua_class _wrap_class_rl3964R = { "rl3964R", &SWIGTYPE_p_rl3964R,_wrap_new_rl3964R, swig_delete_rl3964R, swig_rl3964R_methods, swig_rl3964R_attributes, { "rl3964R", swig_rl3964R_cls_methods, swig_rl3964R_cls_attributes, swig_rl3964R_cls_constants }, swig_rl3964R_bases, swig_rl3964R_base_names }; +static swig_lua_class _wrap_class_rl3964R = { "rl3964R", "rl3964R", &SWIGTYPE_p_rl3964R,_proxy__wrap_new_rl3964R, swig_delete_rl3964R, swig_rl3964R_methods, swig_rl3964R_attributes, &swig_rl3964R_Sf_SwigStatic, swig_rl3964R_meta, swig_rl3964R_bases, swig_rl3964R_base_names }; static int _wrap_new_rlCommandlineInterface(lua_State* L) { int SWIG_arg = 0; @@ -7357,29 +8415,53 @@ static void swig_delete_rlCommandlineInterface(void *obj) { rlCommandlineInterface *arg1 = (rlCommandlineInterface *) obj; delete arg1; } -static swig_lua_method swig_rlCommandlineInterface_methods[] = { - {"start", _wrap_rlCommandlineInterface_start}, - {"readLine", _wrap_rlCommandlineInterface_readLine}, - {"readBlock", _wrap_rlCommandlineInterface_readBlock}, - {"printf", _wrap_rlCommandlineInterface_printf}, - {"writeBlock", _wrap_rlCommandlineInterface_writeBlock}, - {0,0} -}; +static int _proxy__wrap_new_rlCommandlineInterface(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlCommandlineInterface); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlCommandlineInterface_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlCommandlineInterface_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlCommandlineInterface_methods[]= { + { "start", _wrap_rlCommandlineInterface_start}, + { "readLine", _wrap_rlCommandlineInterface_readLine}, + { "readBlock", _wrap_rlCommandlineInterface_readBlock}, + { "printf", _wrap_rlCommandlineInterface_printf}, + { "writeBlock", _wrap_rlCommandlineInterface_writeBlock}, + {0,0} }; -static swig_lua_method swig_rlCommandlineInterface_cls_methods[] = { +static swig_lua_method swig_rlCommandlineInterface_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlCommandlineInterface_cls_constants[] = { + +static swig_lua_attribute swig_rlCommandlineInterface_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlCommandlineInterface_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlCommandlineInterface_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlCommandlineInterface_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlCommandlineInterface_Sf_SwigStatic = { + "rlCommandlineInterface", + swig_rlCommandlineInterface_Sf_SwigStatic_methods, + swig_rlCommandlineInterface_Sf_SwigStatic_attributes, + swig_rlCommandlineInterface_Sf_SwigStatic_constants, + swig_rlCommandlineInterface_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlCommandlineInterface_bases[] = {0}; static const char *swig_rlCommandlineInterface_base_names[] = {0}; -static swig_lua_class _wrap_class_rlCommandlineInterface = { "rlCommandlineInterface", &SWIGTYPE_p_rlCommandlineInterface,_wrap_new_rlCommandlineInterface, swig_delete_rlCommandlineInterface, swig_rlCommandlineInterface_methods, swig_rlCommandlineInterface_attributes, { "rlCommandlineInterface", swig_rlCommandlineInterface_cls_methods, swig_rlCommandlineInterface_cls_attributes, swig_rlCommandlineInterface_cls_constants }, swig_rlCommandlineInterface_bases, swig_rlCommandlineInterface_base_names }; +static swig_lua_class _wrap_class_rlCommandlineInterface = { "rlCommandlineInterface", "rlCommandlineInterface", &SWIGTYPE_p_rlCommandlineInterface,_proxy__wrap_new_rlCommandlineInterface, swig_delete_rlCommandlineInterface, swig_rlCommandlineInterface_methods, swig_rlCommandlineInterface_attributes, &swig_rlCommandlineInterface_Sf_SwigStatic, swig_rlCommandlineInterface_meta, swig_rlCommandlineInterface_bases, swig_rlCommandlineInterface_base_names }; static int _wrap_rlSetDebugPrintf(lua_State* L) { int SWIG_arg = 0; @@ -9049,39 +10131,63 @@ static void swig_delete_rlDataAcquisition(void *obj) { rlDataAcquisition *arg1 = (rlDataAcquisition *) obj; delete arg1; } -static swig_lua_method swig_rlDataAcquisition_methods[] = { - {"stringValue", _wrap_rlDataAcquisition_stringValue}, - {"intValue", _wrap_rlDataAcquisition_intValue}, - {"floatValue", _wrap_rlDataAcquisition_floatValue}, - {"writeStringValue", _wrap_rlDataAcquisition_writeStringValue}, - {"writeIntValue", _wrap_rlDataAcquisition_writeIntValue}, - {"writeFloatValue", _wrap_rlDataAcquisition_writeFloatValue}, - {"readErrorCount", _wrap_rlDataAcquisition_readErrorCount}, - {"writeErrorCount", _wrap_rlDataAcquisition_writeErrorCount}, - {"lifeCounter", _wrap_rlDataAcquisition_lifeCounter}, - {"firstVariable", _wrap_rlDataAcquisition_firstVariable}, - {"nextVariable", _wrap_rlDataAcquisition_nextVariable}, - {"shmStatus", _wrap_rlDataAcquisition_shmStatus}, - {"shmKey", _wrap_rlDataAcquisition_shmKey}, - {"shmId", _wrap_rlDataAcquisition_shmId}, - {0,0} -}; +static int _proxy__wrap_new_rlDataAcquisition(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlDataAcquisition); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlDataAcquisition_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlDataAcquisition_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlDataAcquisition_methods[]= { + { "stringValue", _wrap_rlDataAcquisition_stringValue}, + { "intValue", _wrap_rlDataAcquisition_intValue}, + { "floatValue", _wrap_rlDataAcquisition_floatValue}, + { "writeStringValue", _wrap_rlDataAcquisition_writeStringValue}, + { "writeIntValue", _wrap_rlDataAcquisition_writeIntValue}, + { "writeFloatValue", _wrap_rlDataAcquisition_writeFloatValue}, + { "readErrorCount", _wrap_rlDataAcquisition_readErrorCount}, + { "writeErrorCount", _wrap_rlDataAcquisition_writeErrorCount}, + { "lifeCounter", _wrap_rlDataAcquisition_lifeCounter}, + { "firstVariable", _wrap_rlDataAcquisition_firstVariable}, + { "nextVariable", _wrap_rlDataAcquisition_nextVariable}, + { "shmStatus", _wrap_rlDataAcquisition_shmStatus}, + { "shmKey", _wrap_rlDataAcquisition_shmKey}, + { "shmId", _wrap_rlDataAcquisition_shmId}, + {0,0} }; -static swig_lua_method swig_rlDataAcquisition_cls_methods[] = { +static swig_lua_method swig_rlDataAcquisition_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlDataAcquisition_cls_constants[] = { + +static swig_lua_attribute swig_rlDataAcquisition_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlDataAcquisition_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("DAQ_ERROR", rlDataAcquisition::DAQ_ERROR)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlDataAcquisition_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlDataAcquisition_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlDataAcquisition_Sf_SwigStatic = { + "rlDataAcquisition", + swig_rlDataAcquisition_Sf_SwigStatic_methods, + swig_rlDataAcquisition_Sf_SwigStatic_attributes, + swig_rlDataAcquisition_Sf_SwigStatic_constants, + swig_rlDataAcquisition_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlDataAcquisition_bases[] = {0}; static const char *swig_rlDataAcquisition_base_names[] = {0}; -static swig_lua_class _wrap_class_rlDataAcquisition = { "rlDataAcquisition", &SWIGTYPE_p_rlDataAcquisition,_wrap_new_rlDataAcquisition, swig_delete_rlDataAcquisition, swig_rlDataAcquisition_methods, swig_rlDataAcquisition_attributes, { "rlDataAcquisition", swig_rlDataAcquisition_cls_methods, swig_rlDataAcquisition_cls_attributes, swig_rlDataAcquisition_cls_constants }, swig_rlDataAcquisition_bases, swig_rlDataAcquisition_base_names }; +static swig_lua_class _wrap_class_rlDataAcquisition = { "rlDataAcquisition", "rlDataAcquisition", &SWIGTYPE_p_rlDataAcquisition,_proxy__wrap_new_rlDataAcquisition, swig_delete_rlDataAcquisition, swig_rlDataAcquisition_methods, swig_rlDataAcquisition_attributes, &swig_rlDataAcquisition_Sf_SwigStatic, swig_rlDataAcquisition_meta, swig_rlDataAcquisition_bases, swig_rlDataAcquisition_base_names }; static int _wrap_new_rlDataAcquisitionProvider__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -9689,42 +10795,66 @@ static void swig_delete_rlDataAcquisitionProvider(void *obj) { rlDataAcquisitionProvider *arg1 = (rlDataAcquisitionProvider *) obj; delete arg1; } -static swig_lua_method swig_rlDataAcquisitionProvider_methods[] = { - {"readItemList", _wrap_rlDataAcquisitionProvider_readItemList}, - {"firstItem", _wrap_rlDataAcquisitionProvider_firstItem}, - {"nextItem", _wrap_rlDataAcquisitionProvider_nextItem}, - {"stringValue", _wrap_rlDataAcquisitionProvider_stringValue}, - {"intValue", _wrap_rlDataAcquisitionProvider_intValue}, - {"floatValue", _wrap_rlDataAcquisitionProvider_floatValue}, - {"setStringValue", _wrap_rlDataAcquisitionProvider_setStringValue}, - {"setIntValue", _wrap_rlDataAcquisitionProvider_setIntValue}, - {"setFloatValue", _wrap_rlDataAcquisitionProvider_setFloatValue}, - {"readErrorCount", _wrap_rlDataAcquisitionProvider_readErrorCount}, - {"writeErrorCount", _wrap_rlDataAcquisitionProvider_writeErrorCount}, - {"lifeCounter", _wrap_rlDataAcquisitionProvider_lifeCounter}, - {"setReadErrorCount", _wrap_rlDataAcquisitionProvider_setReadErrorCount}, - {"setWriteErrorCount", _wrap_rlDataAcquisitionProvider_setWriteErrorCount}, - {"setLifeCounter", _wrap_rlDataAcquisitionProvider_setLifeCounter}, - {"shmStatus", _wrap_rlDataAcquisitionProvider_shmStatus}, - {"setAllowAddValues", _wrap_rlDataAcquisitionProvider_setAllowAddValues}, - {0,0} -}; +static int _proxy__wrap_new_rlDataAcquisitionProvider(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlDataAcquisitionProvider); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlDataAcquisitionProvider_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlDataAcquisitionProvider_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlDataAcquisitionProvider_methods[]= { + { "readItemList", _wrap_rlDataAcquisitionProvider_readItemList}, + { "firstItem", _wrap_rlDataAcquisitionProvider_firstItem}, + { "nextItem", _wrap_rlDataAcquisitionProvider_nextItem}, + { "stringValue", _wrap_rlDataAcquisitionProvider_stringValue}, + { "intValue", _wrap_rlDataAcquisitionProvider_intValue}, + { "floatValue", _wrap_rlDataAcquisitionProvider_floatValue}, + { "setStringValue", _wrap_rlDataAcquisitionProvider_setStringValue}, + { "setIntValue", _wrap_rlDataAcquisitionProvider_setIntValue}, + { "setFloatValue", _wrap_rlDataAcquisitionProvider_setFloatValue}, + { "readErrorCount", _wrap_rlDataAcquisitionProvider_readErrorCount}, + { "writeErrorCount", _wrap_rlDataAcquisitionProvider_writeErrorCount}, + { "lifeCounter", _wrap_rlDataAcquisitionProvider_lifeCounter}, + { "setReadErrorCount", _wrap_rlDataAcquisitionProvider_setReadErrorCount}, + { "setWriteErrorCount", _wrap_rlDataAcquisitionProvider_setWriteErrorCount}, + { "setLifeCounter", _wrap_rlDataAcquisitionProvider_setLifeCounter}, + { "shmStatus", _wrap_rlDataAcquisitionProvider_shmStatus}, + { "setAllowAddValues", _wrap_rlDataAcquisitionProvider_setAllowAddValues}, + {0,0} }; -static swig_lua_method swig_rlDataAcquisitionProvider_cls_methods[] = { +static swig_lua_method swig_rlDataAcquisitionProvider_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlDataAcquisitionProvider_cls_constants[] = { + +static swig_lua_attribute swig_rlDataAcquisitionProvider_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlDataAcquisitionProvider_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("DAQ_PROVIDER_ERROR", rlDataAcquisitionProvider::DAQ_PROVIDER_ERROR)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlDataAcquisitionProvider_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlDataAcquisitionProvider_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlDataAcquisitionProvider_Sf_SwigStatic = { + "rlDataAcquisitionProvider", + swig_rlDataAcquisitionProvider_Sf_SwigStatic_methods, + swig_rlDataAcquisitionProvider_Sf_SwigStatic_attributes, + swig_rlDataAcquisitionProvider_Sf_SwigStatic_constants, + swig_rlDataAcquisitionProvider_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlDataAcquisitionProvider_bases[] = {0}; static const char *swig_rlDataAcquisitionProvider_base_names[] = {0}; -static swig_lua_class _wrap_class_rlDataAcquisitionProvider = { "rlDataAcquisitionProvider", &SWIGTYPE_p_rlDataAcquisitionProvider,_wrap_new_rlDataAcquisitionProvider, swig_delete_rlDataAcquisitionProvider, swig_rlDataAcquisitionProvider_methods, swig_rlDataAcquisitionProvider_attributes, { "rlDataAcquisitionProvider", swig_rlDataAcquisitionProvider_cls_methods, swig_rlDataAcquisitionProvider_cls_attributes, swig_rlDataAcquisitionProvider_cls_constants }, swig_rlDataAcquisitionProvider_bases, swig_rlDataAcquisitionProvider_base_names }; +static swig_lua_class _wrap_class_rlDataAcquisitionProvider = { "rlDataAcquisitionProvider", "rlDataAcquisitionProvider", &SWIGTYPE_p_rlDataAcquisitionProvider,_proxy__wrap_new_rlDataAcquisitionProvider, swig_delete_rlDataAcquisitionProvider, swig_rlDataAcquisitionProvider_methods, swig_rlDataAcquisitionProvider_attributes, &swig_rlDataAcquisitionProvider_Sf_SwigStatic, swig_rlDataAcquisitionProvider_meta, swig_rlDataAcquisitionProvider_bases, swig_rlDataAcquisitionProvider_base_names }; static int _wrap_new_rlDataProvider__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -10316,39 +11446,63 @@ static void swig_delete_rlDataProvider(void *obj) { rlDataProvider *arg1 = (rlDataProvider *) obj; delete arg1; } -static swig_lua_method swig_rlDataProvider_methods[] = { - {"getInt", _wrap_rlDataProvider_getInt}, - {"getFloat", _wrap_rlDataProvider_getFloat}, - {"getIntArray", _wrap_rlDataProvider_getIntArray}, - {"getFloatArray", _wrap_rlDataProvider_getFloatArray}, - {"getString", _wrap_rlDataProvider_getString}, - {"setInt", _wrap_rlDataProvider_setInt}, - {"setFloat", _wrap_rlDataProvider_setFloat}, - {"setIntArray", _wrap_rlDataProvider_setIntArray}, - {"setFloatArray", _wrap_rlDataProvider_setFloatArray}, - {"setString", _wrap_rlDataProvider_setString}, - {"getIntAndReset", _wrap_rlDataProvider_getIntAndReset}, - {"setIntAndWaitForReset", _wrap_rlDataProvider_setIntAndWaitForReset}, - {"setInt0Semaphore", _wrap_rlDataProvider_setInt0Semaphore}, - {"getInt0Semaphore", _wrap_rlDataProvider_getInt0Semaphore}, - {"run", _wrap_rlDataProvider_run}, - {0,0} -}; +static int _proxy__wrap_new_rlDataProvider(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlDataProvider); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlDataProvider_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlDataProvider_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlDataProvider_methods[]= { + { "getInt", _wrap_rlDataProvider_getInt}, + { "getFloat", _wrap_rlDataProvider_getFloat}, + { "getIntArray", _wrap_rlDataProvider_getIntArray}, + { "getFloatArray", _wrap_rlDataProvider_getFloatArray}, + { "getString", _wrap_rlDataProvider_getString}, + { "setInt", _wrap_rlDataProvider_setInt}, + { "setFloat", _wrap_rlDataProvider_setFloat}, + { "setIntArray", _wrap_rlDataProvider_setIntArray}, + { "setFloatArray", _wrap_rlDataProvider_setFloatArray}, + { "setString", _wrap_rlDataProvider_setString}, + { "getIntAndReset", _wrap_rlDataProvider_getIntAndReset}, + { "setIntAndWaitForReset", _wrap_rlDataProvider_setIntAndWaitForReset}, + { "setInt0Semaphore", _wrap_rlDataProvider_setInt0Semaphore}, + { "getInt0Semaphore", _wrap_rlDataProvider_getInt0Semaphore}, + { "run", _wrap_rlDataProvider_run}, + {0,0} }; -static swig_lua_method swig_rlDataProvider_cls_methods[] = { +static swig_lua_method swig_rlDataProvider_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlDataProvider_cls_constants[] = { + +static swig_lua_attribute swig_rlDataProvider_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlDataProvider_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlDataProvider_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlDataProvider_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlDataProvider_Sf_SwigStatic = { + "rlDataProvider", + swig_rlDataProvider_Sf_SwigStatic_methods, + swig_rlDataProvider_Sf_SwigStatic_attributes, + swig_rlDataProvider_Sf_SwigStatic_constants, + swig_rlDataProvider_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlDataProvider_bases[] = {0}; static const char *swig_rlDataProvider_base_names[] = {0}; -static swig_lua_class _wrap_class_rlDataProvider = { "rlDataProvider", &SWIGTYPE_p_rlDataProvider,_wrap_new_rlDataProvider, swig_delete_rlDataProvider, swig_rlDataProvider_methods, swig_rlDataProvider_attributes, { "rlDataProvider", swig_rlDataProvider_cls_methods, swig_rlDataProvider_cls_attributes, swig_rlDataProvider_cls_constants }, swig_rlDataProvider_bases, swig_rlDataProvider_base_names }; +static swig_lua_class _wrap_class_rlDataProvider = { "rlDataProvider", "rlDataProvider", &SWIGTYPE_p_rlDataProvider,_proxy__wrap_new_rlDataProvider, swig_delete_rlDataProvider, swig_rlDataProvider_methods, swig_rlDataProvider_attributes, &swig_rlDataProvider_Sf_SwigStatic, swig_rlDataProvider_meta, swig_rlDataProvider_bases, swig_rlDataProvider_base_names }; static int _wrap_new_rlDataProviderClient(lua_State* L) { int SWIG_arg = 0; @@ -10897,37 +12051,61 @@ static void swig_delete_rlDataProviderClient(void *obj) { rlDataProviderClient *arg1 = (rlDataProviderClient *) obj; delete arg1; } -static swig_lua_method swig_rlDataProviderClient_methods[] = { - {"getInt", _wrap_rlDataProviderClient_getInt}, - {"getFloat", _wrap_rlDataProviderClient_getFloat}, - {"getIntArray", _wrap_rlDataProviderClient_getIntArray}, - {"getFloatArray", _wrap_rlDataProviderClient_getFloatArray}, - {"getString", _wrap_rlDataProviderClient_getString}, - {"setInt", _wrap_rlDataProviderClient_setInt}, - {"setFloat", _wrap_rlDataProviderClient_setFloat}, - {"setIntArray", _wrap_rlDataProviderClient_setIntArray}, - {"setFloatArray", _wrap_rlDataProviderClient_setFloatArray}, - {"setString", _wrap_rlDataProviderClient_setString}, - {"getIntAndReset", _wrap_rlDataProviderClient_getIntAndReset}, - {"setIntAndWaitForReset", _wrap_rlDataProviderClient_setIntAndWaitForReset}, - {"getInt0Semaphore", _wrap_rlDataProviderClient_getInt0Semaphore}, - {0,0} -}; +static int _proxy__wrap_new_rlDataProviderClient(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlDataProviderClient); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlDataProviderClient_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlDataProviderClient_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlDataProviderClient_methods[]= { + { "getInt", _wrap_rlDataProviderClient_getInt}, + { "getFloat", _wrap_rlDataProviderClient_getFloat}, + { "getIntArray", _wrap_rlDataProviderClient_getIntArray}, + { "getFloatArray", _wrap_rlDataProviderClient_getFloatArray}, + { "getString", _wrap_rlDataProviderClient_getString}, + { "setInt", _wrap_rlDataProviderClient_setInt}, + { "setFloat", _wrap_rlDataProviderClient_setFloat}, + { "setIntArray", _wrap_rlDataProviderClient_setIntArray}, + { "setFloatArray", _wrap_rlDataProviderClient_setFloatArray}, + { "setString", _wrap_rlDataProviderClient_setString}, + { "getIntAndReset", _wrap_rlDataProviderClient_getIntAndReset}, + { "setIntAndWaitForReset", _wrap_rlDataProviderClient_setIntAndWaitForReset}, + { "getInt0Semaphore", _wrap_rlDataProviderClient_getInt0Semaphore}, + {0,0} }; -static swig_lua_method swig_rlDataProviderClient_cls_methods[] = { +static swig_lua_method swig_rlDataProviderClient_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlDataProviderClient_cls_constants[] = { + +static swig_lua_attribute swig_rlDataProviderClient_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlDataProviderClient_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlDataProviderClient_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlDataProviderClient_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlDataProviderClient_Sf_SwigStatic = { + "rlDataProviderClient", + swig_rlDataProviderClient_Sf_SwigStatic_methods, + swig_rlDataProviderClient_Sf_SwigStatic_attributes, + swig_rlDataProviderClient_Sf_SwigStatic_constants, + swig_rlDataProviderClient_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlDataProviderClient_bases[] = {0}; static const char *swig_rlDataProviderClient_base_names[] = {0}; -static swig_lua_class _wrap_class_rlDataProviderClient = { "rlDataProviderClient", &SWIGTYPE_p_rlDataProviderClient,_wrap_new_rlDataProviderClient, swig_delete_rlDataProviderClient, swig_rlDataProviderClient_methods, swig_rlDataProviderClient_attributes, { "rlDataProviderClient", swig_rlDataProviderClient_cls_methods, swig_rlDataProviderClient_cls_attributes, swig_rlDataProviderClient_cls_constants }, swig_rlDataProviderClient_bases, swig_rlDataProviderClient_base_names }; +static swig_lua_class _wrap_class_rlDataProviderClient = { "rlDataProviderClient", "rlDataProviderClient", &SWIGTYPE_p_rlDataProviderClient,_proxy__wrap_new_rlDataProviderClient, swig_delete_rlDataProviderClient, swig_rlDataProviderClient_methods, swig_rlDataProviderClient_attributes, &swig_rlDataProviderClient_Sf_SwigStatic, swig_rlDataProviderClient_meta, swig_rlDataProviderClient_bases, swig_rlDataProviderClient_base_names }; static int _wrap_new_rlDataProviderThreads(lua_State* L) { int SWIG_arg = 0; @@ -11141,28 +12319,52 @@ static void swig_delete_rlDataProviderThreads(void *obj) { rlDataProviderThreads *arg1 = (rlDataProviderThreads *) obj; delete arg1; } -static swig_lua_method swig_rlDataProviderThreads_methods[] = { - {"start", _wrap_rlDataProviderThreads_start}, - {0,0} -}; +static int _proxy__wrap_new_rlDataProviderThreads(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlDataProviderThreads); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlDataProviderThreads_attributes[] = { - { "provider", _wrap_rlDataProviderThreads_provider_get, _wrap_rlDataProviderThreads_provider_set}, - { "thread", _wrap_rlDataProviderThreads_thread_get, _wrap_rlDataProviderThreads_thread_set}, - { "port", _wrap_rlDataProviderThreads_port_get, _wrap_rlDataProviderThreads_port_set}, + { "provider", _wrap_rlDataProviderThreads_provider_get, _wrap_rlDataProviderThreads_provider_set }, + { "thread", _wrap_rlDataProviderThreads_thread_get, _wrap_rlDataProviderThreads_thread_set }, + { "port", _wrap_rlDataProviderThreads_port_get, _wrap_rlDataProviderThreads_port_set }, {0,0,0} }; -static swig_lua_attribute swig_rlDataProviderThreads_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlDataProviderThreads_methods[]= { + { "start", _wrap_rlDataProviderThreads_start}, + {0,0} }; -static swig_lua_method swig_rlDataProviderThreads_cls_methods[] = { +static swig_lua_method swig_rlDataProviderThreads_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlDataProviderThreads_cls_constants[] = { + +static swig_lua_attribute swig_rlDataProviderThreads_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlDataProviderThreads_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlDataProviderThreads_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlDataProviderThreads_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlDataProviderThreads_Sf_SwigStatic = { + "rlDataProviderThreads", + swig_rlDataProviderThreads_Sf_SwigStatic_methods, + swig_rlDataProviderThreads_Sf_SwigStatic_attributes, + swig_rlDataProviderThreads_Sf_SwigStatic_constants, + swig_rlDataProviderThreads_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlDataProviderThreads_bases[] = {0}; static const char *swig_rlDataProviderThreads_base_names[] = {0}; -static swig_lua_class _wrap_class_rlDataProviderThreads = { "rlDataProviderThreads", &SWIGTYPE_p_rlDataProviderThreads,_wrap_new_rlDataProviderThreads, swig_delete_rlDataProviderThreads, swig_rlDataProviderThreads_methods, swig_rlDataProviderThreads_attributes, { "rlDataProviderThreads", swig_rlDataProviderThreads_cls_methods, swig_rlDataProviderThreads_cls_attributes, swig_rlDataProviderThreads_cls_constants }, swig_rlDataProviderThreads_bases, swig_rlDataProviderThreads_base_names }; +static swig_lua_class _wrap_class_rlDataProviderThreads = { "rlDataProviderThreads", "rlDataProviderThreads", &SWIGTYPE_p_rlDataProviderThreads,_proxy__wrap_new_rlDataProviderThreads, swig_delete_rlDataProviderThreads, swig_rlDataProviderThreads_methods, swig_rlDataProviderThreads_attributes, &swig_rlDataProviderThreads_Sf_SwigStatic, swig_rlDataProviderThreads_meta, swig_rlDataProviderThreads_bases, swig_rlDataProviderThreads_base_names }; static int _wrap_rlevent_name_get(lua_State* L) { int SWIG_arg = 0; @@ -11422,26 +12624,50 @@ static void swig_delete_rlEventLogServer(void *obj) { rlEventLogServer *arg1 = (rlEventLogServer *) obj; delete arg1; } -static swig_lua_method swig_rlEventLogServer_methods[] = { - {"getEvent", _wrap_rlEventLogServer_getEvent}, - {"putEvent", _wrap_rlEventLogServer_putEvent}, - {0,0} -}; +static int _proxy__wrap_new_rlEventLogServer(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlEventLogServer); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlEventLogServer_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlEventLogServer_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlEventLogServer_methods[]= { + { "getEvent", _wrap_rlEventLogServer_getEvent}, + { "putEvent", _wrap_rlEventLogServer_putEvent}, + {0,0} }; -static swig_lua_method swig_rlEventLogServer_cls_methods[] = { +static swig_lua_method swig_rlEventLogServer_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlEventLogServer_cls_constants[] = { + +static swig_lua_attribute swig_rlEventLogServer_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlEventLogServer_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlEventLogServer_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlEventLogServer_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlEventLogServer_Sf_SwigStatic = { + "rlEventLogServer", + swig_rlEventLogServer_Sf_SwigStatic_methods, + swig_rlEventLogServer_Sf_SwigStatic_attributes, + swig_rlEventLogServer_Sf_SwigStatic_constants, + swig_rlEventLogServer_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlEventLogServer_bases[] = {0}; static const char *swig_rlEventLogServer_base_names[] = {0}; -static swig_lua_class _wrap_class_rlEventLogServer = { "rlEventLogServer", &SWIGTYPE_p_rlEventLogServer,_wrap_new_rlEventLogServer, swig_delete_rlEventLogServer, swig_rlEventLogServer_methods, swig_rlEventLogServer_attributes, { "rlEventLogServer", swig_rlEventLogServer_cls_methods, swig_rlEventLogServer_cls_attributes, swig_rlEventLogServer_cls_constants }, swig_rlEventLogServer_bases, swig_rlEventLogServer_base_names }; +static swig_lua_class _wrap_class_rlEventLogServer = { "rlEventLogServer", "rlEventLogServer", &SWIGTYPE_p_rlEventLogServer,_proxy__wrap_new_rlEventLogServer, swig_delete_rlEventLogServer, swig_rlEventLogServer_methods, swig_rlEventLogServer_attributes, &swig_rlEventLogServer_Sf_SwigStatic, swig_rlEventLogServer_meta, swig_rlEventLogServer_bases, swig_rlEventLogServer_base_names }; static int _wrap_new_rlEventLogServerThreads(lua_State* L) { int SWIG_arg = 0; @@ -11575,27 +12801,51 @@ static void swig_delete_rlEventLogServerThreads(void *obj) { rlEventLogServerThreads *arg1 = (rlEventLogServerThreads *) obj; delete arg1; } -static swig_lua_method swig_rlEventLogServerThreads_methods[] = { - {"start", _wrap_rlEventLogServerThreads_start}, - {"getPort", _wrap_rlEventLogServerThreads_getPort}, - {0,0} -}; +static int _proxy__wrap_new_rlEventLogServerThreads(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlEventLogServerThreads); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlEventLogServerThreads_attributes[] = { - { "event_log_server", _wrap_rlEventLogServerThreads_event_log_server_get, _wrap_rlEventLogServerThreads_event_log_server_set}, + { "event_log_server", _wrap_rlEventLogServerThreads_event_log_server_get, _wrap_rlEventLogServerThreads_event_log_server_set }, {0,0,0} }; -static swig_lua_attribute swig_rlEventLogServerThreads_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlEventLogServerThreads_methods[]= { + { "start", _wrap_rlEventLogServerThreads_start}, + { "getPort", _wrap_rlEventLogServerThreads_getPort}, + {0,0} }; -static swig_lua_method swig_rlEventLogServerThreads_cls_methods[] = { +static swig_lua_method swig_rlEventLogServerThreads_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlEventLogServerThreads_cls_constants[] = { + +static swig_lua_attribute swig_rlEventLogServerThreads_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlEventLogServerThreads_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlEventLogServerThreads_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlEventLogServerThreads_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlEventLogServerThreads_Sf_SwigStatic = { + "rlEventLogServerThreads", + swig_rlEventLogServerThreads_Sf_SwigStatic_methods, + swig_rlEventLogServerThreads_Sf_SwigStatic_attributes, + swig_rlEventLogServerThreads_Sf_SwigStatic_constants, + swig_rlEventLogServerThreads_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlEventLogServerThreads_bases[] = {0}; static const char *swig_rlEventLogServerThreads_base_names[] = {0}; -static swig_lua_class _wrap_class_rlEventLogServerThreads = { "rlEventLogServerThreads", &SWIGTYPE_p_rlEventLogServerThreads,_wrap_new_rlEventLogServerThreads, swig_delete_rlEventLogServerThreads, swig_rlEventLogServerThreads_methods, swig_rlEventLogServerThreads_attributes, { "rlEventLogServerThreads", swig_rlEventLogServerThreads_cls_methods, swig_rlEventLogServerThreads_cls_attributes, swig_rlEventLogServerThreads_cls_constants }, swig_rlEventLogServerThreads_bases, swig_rlEventLogServerThreads_base_names }; +static swig_lua_class _wrap_class_rlEventLogServerThreads = { "rlEventLogServerThreads", "rlEventLogServerThreads", &SWIGTYPE_p_rlEventLogServerThreads,_proxy__wrap_new_rlEventLogServerThreads, swig_delete_rlEventLogServerThreads, swig_rlEventLogServerThreads_methods, swig_rlEventLogServerThreads_attributes, &swig_rlEventLogServerThreads_Sf_SwigStatic, swig_rlEventLogServerThreads_meta, swig_rlEventLogServerThreads_bases, swig_rlEventLogServerThreads_base_names }; static int _wrap_new_rlFifo__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -11802,33 +13052,57 @@ static void swig_delete_rlFifo(void *obj) { rlFifo *arg1 = (rlFifo *) obj; delete arg1; } -static swig_lua_method swig_rlFifo_methods[] = { - {"read", _wrap_rlFifo_read}, - {"poll", _wrap_rlFifo_poll}, - {"nmesAvailable", _wrap_rlFifo_nmesAvailable}, - {"write", _wrap_rlFifo_write}, - {"printf", _wrap_rlFifo_printf}, - {0,0} -}; +static int _proxy__wrap_new_rlFifo(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlFifo); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlFifo_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlFifo_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlFifo_methods[]= { + { "read", _wrap_rlFifo_read}, + { "poll", _wrap_rlFifo_poll}, + { "nmesAvailable", _wrap_rlFifo_nmesAvailable}, + { "write", _wrap_rlFifo_write}, + { "printf", _wrap_rlFifo_printf}, + {0,0} }; -static swig_lua_method swig_rlFifo_cls_methods[] = { +static swig_lua_method swig_rlFifo_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlFifo_cls_constants[] = { + +static swig_lua_attribute swig_rlFifo_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlFifo_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("DATA_AVAILABLE", rlFifo::DATA_AVAILABLE)}, {SWIG_LUA_CONSTTAB_INT("NO_DATA_AVAILABLE", rlFifo::NO_DATA_AVAILABLE)}, {SWIG_LUA_CONSTTAB_INT("MESSAGE_TO_BIG", rlFifo::MESSAGE_TO_BIG)}, {SWIG_LUA_CONSTTAB_INT("FIFO_FULL", rlFifo::FIFO_FULL)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlFifo_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlFifo_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlFifo_Sf_SwigStatic = { + "rlFifo", + swig_rlFifo_Sf_SwigStatic_methods, + swig_rlFifo_Sf_SwigStatic_attributes, + swig_rlFifo_Sf_SwigStatic_constants, + swig_rlFifo_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlFifo_bases[] = {0}; static const char *swig_rlFifo_base_names[] = {0}; -static swig_lua_class _wrap_class_rlFifo = { "rlFifo", &SWIGTYPE_p_rlFifo,_wrap_new_rlFifo, swig_delete_rlFifo, swig_rlFifo_methods, swig_rlFifo_attributes, { "rlFifo", swig_rlFifo_cls_methods, swig_rlFifo_cls_attributes, swig_rlFifo_cls_constants }, swig_rlFifo_bases, swig_rlFifo_base_names }; +static swig_lua_class _wrap_class_rlFifo = { "rlFifo", "rlFifo", &SWIGTYPE_p_rlFifo,_proxy__wrap_new_rlFifo, swig_delete_rlFifo, swig_rlFifo_methods, swig_rlFifo_attributes, &swig_rlFifo_Sf_SwigStatic, swig_rlFifo_meta, swig_rlFifo_bases, swig_rlFifo_base_names }; static int _wrap_rlFileLines_line_set(lua_State* L) { int SWIG_arg = 0; @@ -11963,26 +13237,50 @@ static void swig_delete_rlFileLines(void *obj) { _rlFileLines_ *arg1 = (_rlFileLines_ *) obj; delete arg1; } -static swig_lua_method swig__rlFileLines__methods[] = { +static int _proxy__wrap_new_rlFileLines(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlFileLines); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_rlFileLines_attributes[] = { + { "line", _wrap_rlFileLines_line_get, _wrap_rlFileLines_line_set }, + { "next", _wrap_rlFileLines_next_get, _wrap_rlFileLines_next_set }, + {0,0,0} +}; +static swig_lua_method swig_rlFileLines_methods[]= { {0,0} }; -static swig_lua_attribute swig__rlFileLines__attributes[] = { - { "line", _wrap_rlFileLines_line_get, _wrap_rlFileLines_line_set}, - { "next", _wrap_rlFileLines_next_get, _wrap_rlFileLines_next_set}, - {0,0,0} +static swig_lua_method swig_rlFileLines_meta[] = { + {0,0} }; -static swig_lua_attribute swig__rlFileLines__cls_attributes[] = { + +static swig_lua_attribute swig_rlFileLines_Sf_SwigStatic_attributes[] = { {0,0,0} }; -static swig_lua_method swig__rlFileLines__cls_methods[] = { +static swig_lua_const_info swig_rlFileLines_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_rlFileLines_Sf_SwigStatic_methods[]= { {0,0} }; -static swig_lua_const_info swig__rlFileLines__cls_constants[] = { - {0,0,0,0,0,0} +static swig_lua_class* swig_rlFileLines_Sf_SwigStatic_classes[]= { + 0 }; -static swig_lua_class *swig__rlFileLines__bases[] = {0}; -static const char *swig__rlFileLines__base_names[] = {0}; -static swig_lua_class _wrap_class__rlFileLines_ = { "rlFileLines", &SWIGTYPE_p__rlFileLines_,_wrap_new_rlFileLines, swig_delete_rlFileLines, swig__rlFileLines__methods, swig__rlFileLines__attributes, { "rlFileLines", swig__rlFileLines__cls_methods, swig__rlFileLines__cls_attributes, swig__rlFileLines__cls_constants }, swig__rlFileLines__bases, swig__rlFileLines__base_names }; + +static swig_lua_namespace swig_rlFileLines_Sf_SwigStatic = { + "rlFileLines", + swig_rlFileLines_Sf_SwigStatic_methods, + swig_rlFileLines_Sf_SwigStatic_attributes, + swig_rlFileLines_Sf_SwigStatic_constants, + swig_rlFileLines_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_rlFileLines_bases[] = {0}; +static const char *swig_rlFileLines_base_names[] = {0}; +static swig_lua_class _wrap_class_rlFileLines = { "rlFileLines", "rlFileLines", &SWIGTYPE_p__rlFileLines_,_proxy__wrap_new_rlFileLines, swig_delete_rlFileLines, swig_rlFileLines_methods, swig_rlFileLines_attributes, &swig_rlFileLines_Sf_SwigStatic, swig_rlFileLines_meta, swig_rlFileLines_bases, swig_rlFileLines_base_names }; static int _wrap_new_rlFileLoad(lua_State* L) { int SWIG_arg = 0; @@ -12160,30 +13458,54 @@ static void swig_delete_rlFileLoad(void *obj) { rlFileLoad *arg1 = (rlFileLoad *) obj; delete arg1; } -static swig_lua_method swig_rlFileLoad_methods[] = { - {"load", _wrap_rlFileLoad_load}, - {"unload", _wrap_rlFileLoad_unload}, - {"firstLine", _wrap_rlFileLoad_firstLine}, - {"nextLine", _wrap_rlFileLoad_nextLine}, - {"setDebug", _wrap_rlFileLoad_setDebug}, - {"text2rlstring", _wrap_rlFileLoad_text2rlstring}, - {0,0} -}; +static int _proxy__wrap_new_rlFileLoad(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlFileLoad); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlFileLoad_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlFileLoad_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlFileLoad_methods[]= { + { "load", _wrap_rlFileLoad_load}, + { "unload", _wrap_rlFileLoad_unload}, + { "firstLine", _wrap_rlFileLoad_firstLine}, + { "nextLine", _wrap_rlFileLoad_nextLine}, + { "setDebug", _wrap_rlFileLoad_setDebug}, + { "text2rlstring", _wrap_rlFileLoad_text2rlstring}, + {0,0} }; -static swig_lua_method swig_rlFileLoad_cls_methods[] = { +static swig_lua_method swig_rlFileLoad_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlFileLoad_cls_constants[] = { + +static swig_lua_attribute swig_rlFileLoad_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlFileLoad_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlFileLoad_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlFileLoad_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlFileLoad_Sf_SwigStatic = { + "rlFileLoad", + swig_rlFileLoad_Sf_SwigStatic_methods, + swig_rlFileLoad_Sf_SwigStatic_attributes, + swig_rlFileLoad_Sf_SwigStatic_constants, + swig_rlFileLoad_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlFileLoad_bases[] = {0}; static const char *swig_rlFileLoad_base_names[] = {0}; -static swig_lua_class _wrap_class_rlFileLoad = { "rlFileLoad", &SWIGTYPE_p_rlFileLoad,_wrap_new_rlFileLoad, swig_delete_rlFileLoad, swig_rlFileLoad_methods, swig_rlFileLoad_attributes, { "rlFileLoad", swig_rlFileLoad_cls_methods, swig_rlFileLoad_cls_attributes, swig_rlFileLoad_cls_constants }, swig_rlFileLoad_bases, swig_rlFileLoad_base_names }; +static swig_lua_class _wrap_class_rlFileLoad = { "rlFileLoad", "rlFileLoad", &SWIGTYPE_p_rlFileLoad,_proxy__wrap_new_rlFileLoad, swig_delete_rlFileLoad, swig_rlFileLoad_methods, swig_rlFileLoad_attributes, &swig_rlFileLoad_Sf_SwigStatic, swig_rlFileLoad_meta, swig_rlFileLoad_bases, swig_rlFileLoad_base_names }; static int _wrap_rlHistoryLogLine_next_set(lua_State* L) { int SWIG_arg = 0; @@ -12318,26 +13640,50 @@ static void swig_delete_rlHistoryLogLine(void *obj) { _rlHistoryLogLine_ *arg1 = (_rlHistoryLogLine_ *) obj; delete arg1; } -static swig_lua_method swig__rlHistoryLogLine__methods[] = { +static int _proxy__wrap_new_rlHistoryLogLine(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlHistoryLogLine); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_rlHistoryLogLine_attributes[] = { + { "next", _wrap_rlHistoryLogLine_next_get, _wrap_rlHistoryLogLine_next_set }, + { "line", _wrap_rlHistoryLogLine_line_get, _wrap_rlHistoryLogLine_line_set }, + {0,0,0} +}; +static swig_lua_method swig_rlHistoryLogLine_methods[]= { {0,0} }; -static swig_lua_attribute swig__rlHistoryLogLine__attributes[] = { - { "next", _wrap_rlHistoryLogLine_next_get, _wrap_rlHistoryLogLine_next_set}, - { "line", _wrap_rlHistoryLogLine_line_get, _wrap_rlHistoryLogLine_line_set}, - {0,0,0} +static swig_lua_method swig_rlHistoryLogLine_meta[] = { + {0,0} }; -static swig_lua_attribute swig__rlHistoryLogLine__cls_attributes[] = { + +static swig_lua_attribute swig_rlHistoryLogLine_Sf_SwigStatic_attributes[] = { {0,0,0} }; -static swig_lua_method swig__rlHistoryLogLine__cls_methods[] = { +static swig_lua_const_info swig_rlHistoryLogLine_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_rlHistoryLogLine_Sf_SwigStatic_methods[]= { {0,0} }; -static swig_lua_const_info swig__rlHistoryLogLine__cls_constants[] = { - {0,0,0,0,0,0} +static swig_lua_class* swig_rlHistoryLogLine_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlHistoryLogLine_Sf_SwigStatic = { + "rlHistoryLogLine", + swig_rlHistoryLogLine_Sf_SwigStatic_methods, + swig_rlHistoryLogLine_Sf_SwigStatic_attributes, + swig_rlHistoryLogLine_Sf_SwigStatic_constants, + swig_rlHistoryLogLine_Sf_SwigStatic_classes, + 0 }; -static swig_lua_class *swig__rlHistoryLogLine__bases[] = {0}; -static const char *swig__rlHistoryLogLine__base_names[] = {0}; -static swig_lua_class _wrap_class__rlHistoryLogLine_ = { "rlHistoryLogLine", &SWIGTYPE_p__rlHistoryLogLine_,_wrap_new_rlHistoryLogLine, swig_delete_rlHistoryLogLine, swig__rlHistoryLogLine__methods, swig__rlHistoryLogLine__attributes, { "rlHistoryLogLine", swig__rlHistoryLogLine__cls_methods, swig__rlHistoryLogLine__cls_attributes, swig__rlHistoryLogLine__cls_constants }, swig__rlHistoryLogLine__bases, swig__rlHistoryLogLine__base_names }; +static swig_lua_class *swig_rlHistoryLogLine_bases[] = {0}; +static const char *swig_rlHistoryLogLine_base_names[] = {0}; +static swig_lua_class _wrap_class_rlHistoryLogLine = { "rlHistoryLogLine", "rlHistoryLogLine", &SWIGTYPE_p__rlHistoryLogLine_,_proxy__wrap_new_rlHistoryLogLine, swig_delete_rlHistoryLogLine, swig_rlHistoryLogLine_methods, swig_rlHistoryLogLine_attributes, &swig_rlHistoryLogLine_Sf_SwigStatic, swig_rlHistoryLogLine_meta, swig_rlHistoryLogLine_bases, swig_rlHistoryLogLine_base_names }; static int _wrap_new_rlHistoryLogger__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -12620,29 +13966,53 @@ static void swig_delete_rlHistoryLogger(void *obj) { rlHistoryLogger *arg1 = (rlHistoryLogger *) obj; delete arg1; } -static swig_lua_method swig_rlHistoryLogger_methods[] = { - {"pushLine", _wrap_rlHistoryLogger_pushLine}, - {"firstLine", _wrap_rlHistoryLogger_firstLine}, - {"nextLine", _wrap_rlHistoryLogger_nextLine}, - {0,0} -}; +static int _proxy__wrap_new_rlHistoryLogger(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlHistoryLogger); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlHistoryLogger_attributes[] = { - { "mutex", _wrap_rlHistoryLogger_mutex_get, _wrap_rlHistoryLogger_mutex_set}, - { "debug", _wrap_rlHistoryLogger_debug_get, _wrap_rlHistoryLogger_debug_set}, + { "mutex", _wrap_rlHistoryLogger_mutex_get, _wrap_rlHistoryLogger_mutex_set }, + { "debug", _wrap_rlHistoryLogger_debug_get, _wrap_rlHistoryLogger_debug_set }, {0,0,0} }; -static swig_lua_attribute swig_rlHistoryLogger_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlHistoryLogger_methods[]= { + { "pushLine", _wrap_rlHistoryLogger_pushLine}, + { "firstLine", _wrap_rlHistoryLogger_firstLine}, + { "nextLine", _wrap_rlHistoryLogger_nextLine}, + {0,0} }; -static swig_lua_method swig_rlHistoryLogger_cls_methods[] = { +static swig_lua_method swig_rlHistoryLogger_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlHistoryLogger_cls_constants[] = { + +static swig_lua_attribute swig_rlHistoryLogger_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlHistoryLogger_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlHistoryLogger_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlHistoryLogger_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlHistoryLogger_Sf_SwigStatic = { + "rlHistoryLogger", + swig_rlHistoryLogger_Sf_SwigStatic_methods, + swig_rlHistoryLogger_Sf_SwigStatic_attributes, + swig_rlHistoryLogger_Sf_SwigStatic_constants, + swig_rlHistoryLogger_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlHistoryLogger_bases[] = {0}; static const char *swig_rlHistoryLogger_base_names[] = {0}; -static swig_lua_class _wrap_class_rlHistoryLogger = { "rlHistoryLogger", &SWIGTYPE_p_rlHistoryLogger,_wrap_new_rlHistoryLogger, swig_delete_rlHistoryLogger, swig_rlHistoryLogger_methods, swig_rlHistoryLogger_attributes, { "rlHistoryLogger", swig_rlHistoryLogger_cls_methods, swig_rlHistoryLogger_cls_attributes, swig_rlHistoryLogger_cls_constants }, swig_rlHistoryLogger_bases, swig_rlHistoryLogger_base_names }; +static swig_lua_class _wrap_class_rlHistoryLogger = { "rlHistoryLogger", "rlHistoryLogger", &SWIGTYPE_p_rlHistoryLogger,_proxy__wrap_new_rlHistoryLogger, swig_delete_rlHistoryLogger, swig_rlHistoryLogger_methods, swig_rlHistoryLogger_attributes, &swig_rlHistoryLogger_Sf_SwigStatic, swig_rlHistoryLogger_meta, swig_rlHistoryLogger_bases, swig_rlHistoryLogger_base_names }; static int _wrap_rlHistoryReaderLine_next_set(lua_State* L) { int SWIG_arg = 0; @@ -12777,26 +14147,50 @@ static void swig_delete_rlHistoryReaderLine(void *obj) { _rlHistoryReaderLine_ *arg1 = (_rlHistoryReaderLine_ *) obj; delete arg1; } -static swig_lua_method swig__rlHistoryReaderLine__methods[] = { +static int _proxy__wrap_new_rlHistoryReaderLine(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlHistoryReaderLine); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_rlHistoryReaderLine_attributes[] = { + { "next", _wrap_rlHistoryReaderLine_next_get, _wrap_rlHistoryReaderLine_next_set }, + { "line", _wrap_rlHistoryReaderLine_line_get, _wrap_rlHistoryReaderLine_line_set }, + {0,0,0} +}; +static swig_lua_method swig_rlHistoryReaderLine_methods[]= { {0,0} }; -static swig_lua_attribute swig__rlHistoryReaderLine__attributes[] = { - { "next", _wrap_rlHistoryReaderLine_next_get, _wrap_rlHistoryReaderLine_next_set}, - { "line", _wrap_rlHistoryReaderLine_line_get, _wrap_rlHistoryReaderLine_line_set}, - {0,0,0} +static swig_lua_method swig_rlHistoryReaderLine_meta[] = { + {0,0} }; -static swig_lua_attribute swig__rlHistoryReaderLine__cls_attributes[] = { + +static swig_lua_attribute swig_rlHistoryReaderLine_Sf_SwigStatic_attributes[] = { {0,0,0} }; -static swig_lua_method swig__rlHistoryReaderLine__cls_methods[] = { +static swig_lua_const_info swig_rlHistoryReaderLine_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_rlHistoryReaderLine_Sf_SwigStatic_methods[]= { {0,0} }; -static swig_lua_const_info swig__rlHistoryReaderLine__cls_constants[] = { - {0,0,0,0,0,0} +static swig_lua_class* swig_rlHistoryReaderLine_Sf_SwigStatic_classes[]= { + 0 }; -static swig_lua_class *swig__rlHistoryReaderLine__bases[] = {0}; -static const char *swig__rlHistoryReaderLine__base_names[] = {0}; -static swig_lua_class _wrap_class__rlHistoryReaderLine_ = { "rlHistoryReaderLine", &SWIGTYPE_p__rlHistoryReaderLine_,_wrap_new_rlHistoryReaderLine, swig_delete_rlHistoryReaderLine, swig__rlHistoryReaderLine__methods, swig__rlHistoryReaderLine__attributes, { "rlHistoryReaderLine", swig__rlHistoryReaderLine__cls_methods, swig__rlHistoryReaderLine__cls_attributes, swig__rlHistoryReaderLine__cls_constants }, swig__rlHistoryReaderLine__bases, swig__rlHistoryReaderLine__base_names }; + +static swig_lua_namespace swig_rlHistoryReaderLine_Sf_SwigStatic = { + "rlHistoryReaderLine", + swig_rlHistoryReaderLine_Sf_SwigStatic_methods, + swig_rlHistoryReaderLine_Sf_SwigStatic_attributes, + swig_rlHistoryReaderLine_Sf_SwigStatic_constants, + swig_rlHistoryReaderLine_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_rlHistoryReaderLine_bases[] = {0}; +static const char *swig_rlHistoryReaderLine_base_names[] = {0}; +static swig_lua_class _wrap_class_rlHistoryReaderLine = { "rlHistoryReaderLine", "rlHistoryReaderLine", &SWIGTYPE_p__rlHistoryReaderLine_,_proxy__wrap_new_rlHistoryReaderLine, swig_delete_rlHistoryReaderLine, swig_rlHistoryReaderLine_methods, swig_rlHistoryReaderLine_attributes, &swig_rlHistoryReaderLine_Sf_SwigStatic, swig_rlHistoryReaderLine_meta, swig_rlHistoryReaderLine_bases, swig_rlHistoryReaderLine_base_names }; static int _wrap_new_rlHistoryReader(lua_State* L) { int SWIG_arg = 0; @@ -13016,30 +14410,54 @@ static void swig_delete_rlHistoryReader(void *obj) { rlHistoryReader *arg1 = (rlHistoryReader *) obj; delete arg1; } -static swig_lua_method swig_rlHistoryReader_methods[] = { - {"read", _wrap_rlHistoryReader_read}, - {"firstLine", _wrap_rlHistoryReader_firstLine}, - {"nextLine", _wrap_rlHistoryReader_nextLine}, - {"clean", _wrap_rlHistoryReader_clean}, - {"cat", _wrap_rlHistoryReader_cat}, - {0,0} -}; +static int _proxy__wrap_new_rlHistoryReader(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlHistoryReader); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlHistoryReader_attributes[] = { - { "debug", _wrap_rlHistoryReader_debug_get, _wrap_rlHistoryReader_debug_set}, + { "debug", _wrap_rlHistoryReader_debug_get, _wrap_rlHistoryReader_debug_set }, {0,0,0} }; -static swig_lua_attribute swig_rlHistoryReader_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlHistoryReader_methods[]= { + { "read", _wrap_rlHistoryReader_read}, + { "firstLine", _wrap_rlHistoryReader_firstLine}, + { "nextLine", _wrap_rlHistoryReader_nextLine}, + { "clean", _wrap_rlHistoryReader_clean}, + { "cat", _wrap_rlHistoryReader_cat}, + {0,0} }; -static swig_lua_method swig_rlHistoryReader_cls_methods[] = { +static swig_lua_method swig_rlHistoryReader_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlHistoryReader_cls_constants[] = { + +static swig_lua_attribute swig_rlHistoryReader_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlHistoryReader_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlHistoryReader_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlHistoryReader_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlHistoryReader_Sf_SwigStatic = { + "rlHistoryReader", + swig_rlHistoryReader_Sf_SwigStatic_methods, + swig_rlHistoryReader_Sf_SwigStatic_attributes, + swig_rlHistoryReader_Sf_SwigStatic_constants, + swig_rlHistoryReader_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlHistoryReader_bases[] = {0}; static const char *swig_rlHistoryReader_base_names[] = {0}; -static swig_lua_class _wrap_class_rlHistoryReader = { "rlHistoryReader", &SWIGTYPE_p_rlHistoryReader,_wrap_new_rlHistoryReader, swig_delete_rlHistoryReader, swig_rlHistoryReader_methods, swig_rlHistoryReader_attributes, { "rlHistoryReader", swig_rlHistoryReader_cls_methods, swig_rlHistoryReader_cls_attributes, swig_rlHistoryReader_cls_constants }, swig_rlHistoryReader_bases, swig_rlHistoryReader_base_names }; +static swig_lua_class _wrap_class_rlHistoryReader = { "rlHistoryReader", "rlHistoryReader", &SWIGTYPE_p_rlHistoryReader,_proxy__wrap_new_rlHistoryReader, swig_delete_rlHistoryReader, swig_rlHistoryReader_methods, swig_rlHistoryReader_attributes, &swig_rlHistoryReader_Sf_SwigStatic, swig_rlHistoryReader_meta, swig_rlHistoryReader_bases, swig_rlHistoryReader_base_names }; static int _wrap_new_rlIniFile(lua_State* L) { int SWIG_arg = 0; @@ -13645,39 +15063,63 @@ static void swig_delete_rlIniFile(void *obj) { rlIniFile *arg1 = (rlIniFile *) obj; delete arg1; } -static swig_lua_method swig_rlIniFile_methods[] = { - {"read", _wrap_rlIniFile_read}, - {"write", _wrap_rlIniFile_write}, - {"filename", _wrap_rlIniFile_filename}, - {"text", _wrap_rlIniFile_text}, - {"setText", _wrap_rlIniFile_setText}, - {"printf", _wrap_rlIniFile_printf}, - {"remove", _wrap_rlIniFile_remove}, - {"firstSection", _wrap_rlIniFile_firstSection}, - {"nextSection", _wrap_rlIniFile_nextSection}, - {"firstName", _wrap_rlIniFile_firstName}, - {"nextName", _wrap_rlIniFile_nextName}, - {"setDefaultSection", _wrap_rlIniFile_setDefaultSection}, - {"defaultSection", _wrap_rlIniFile_defaultSection}, - {"i18n", _wrap_rlIniFile_i18n}, - {"tr", _wrap_rlIniFile_tr}, - {0,0} -}; +static int _proxy__wrap_new_rlIniFile(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlIniFile); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlIniFile_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlIniFile_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlIniFile_methods[]= { + { "read", _wrap_rlIniFile_read}, + { "write", _wrap_rlIniFile_write}, + { "filename", _wrap_rlIniFile_filename}, + { "text", _wrap_rlIniFile_text}, + { "setText", _wrap_rlIniFile_setText}, + { "printf", _wrap_rlIniFile_printf}, + { "remove", _wrap_rlIniFile_remove}, + { "firstSection", _wrap_rlIniFile_firstSection}, + { "nextSection", _wrap_rlIniFile_nextSection}, + { "firstName", _wrap_rlIniFile_firstName}, + { "nextName", _wrap_rlIniFile_nextName}, + { "setDefaultSection", _wrap_rlIniFile_setDefaultSection}, + { "defaultSection", _wrap_rlIniFile_defaultSection}, + { "i18n", _wrap_rlIniFile_i18n}, + { "tr", _wrap_rlIniFile_tr}, + {0,0} }; -static swig_lua_method swig_rlIniFile_cls_methods[] = { +static swig_lua_method swig_rlIniFile_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlIniFile_cls_constants[] = { + +static swig_lua_attribute swig_rlIniFile_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlIniFile_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlIniFile_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlIniFile_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlIniFile_Sf_SwigStatic = { + "rlIniFile", + swig_rlIniFile_Sf_SwigStatic_methods, + swig_rlIniFile_Sf_SwigStatic_attributes, + swig_rlIniFile_Sf_SwigStatic_constants, + swig_rlIniFile_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlIniFile_bases[] = {0}; static const char *swig_rlIniFile_base_names[] = {0}; -static swig_lua_class _wrap_class_rlIniFile = { "rlIniFile", &SWIGTYPE_p_rlIniFile,_wrap_new_rlIniFile, swig_delete_rlIniFile, swig_rlIniFile_methods, swig_rlIniFile_attributes, { "rlIniFile", swig_rlIniFile_cls_methods, swig_rlIniFile_cls_attributes, swig_rlIniFile_cls_constants }, swig_rlIniFile_bases, swig_rlIniFile_base_names }; +static swig_lua_class _wrap_class_rlIniFile = { "rlIniFile", "rlIniFile", &SWIGTYPE_p_rlIniFile,_proxy__wrap_new_rlIniFile, swig_delete_rlIniFile, swig_rlIniFile_methods, swig_rlIniFile_attributes, &swig_rlIniFile_Sf_SwigStatic, swig_rlIniFile_meta, swig_rlIniFile_bases, swig_rlIniFile_base_names }; static int _wrap_rlSetTranslator__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -13769,14 +15211,14 @@ static int _wrap_rltranslate__SWIG_0(lua_State* L) { SWIG_check_num_args("rltranslate",2,2) if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("rltranslate",1,"char const *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("rltranslate",2,"char const **"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("rltranslate",2,"char **"); arg1 = (char *)lua_tostring(L, 1); if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_p_char,0))){ SWIG_fail_ptr("rltranslate",2,SWIGTYPE_p_p_char); } - result = (char *)rltranslate((char const *)arg1,(char const **)arg2); + result = (char *)rltranslate((char const *)arg1,arg2); lua_pushstring(L,(const char *)result); SWIG_arg++; return SWIG_arg; @@ -13846,7 +15288,7 @@ static int _wrap_rltranslate(lua_State* L) { SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'rltranslate'\n" " Possible C/C++ prototypes are:\n" - " rltranslate(char const *,char const **)\n" + " rltranslate(char const *,char **)\n" " rltranslate(char const *)\n"); lua_error(L);return 0; } @@ -14166,28 +15608,52 @@ static void swig_delete_rlInterpreter(void *obj) { rlInterpreter *arg1 = (rlInterpreter *) obj; delete arg1; } -static swig_lua_method swig_rlInterpreter_methods[] = { - {"isCommand", _wrap_rlInterpreter_isCommand}, - {"copyStringParam", _wrap_rlInterpreter_copyStringParam}, - {"maxchar", _wrap_rlInterpreter_maxchar}, - {0,0} -}; +static int _proxy__wrap_new_rlInterpreter(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlInterpreter); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlInterpreter_attributes[] = { - { "line", _wrap_rlInterpreter_line_get, _wrap_rlInterpreter_line_set}, + { "line", _wrap_rlInterpreter_line_get, _wrap_rlInterpreter_line_set }, {0,0,0} }; -static swig_lua_attribute swig_rlInterpreter_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlInterpreter_methods[]= { + { "isCommand", _wrap_rlInterpreter_isCommand}, + { "copyStringParam", _wrap_rlInterpreter_copyStringParam}, + { "maxchar", _wrap_rlInterpreter_maxchar}, + {0,0} }; -static swig_lua_method swig_rlInterpreter_cls_methods[] = { +static swig_lua_method swig_rlInterpreter_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlInterpreter_cls_constants[] = { + +static swig_lua_attribute swig_rlInterpreter_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlInterpreter_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlInterpreter_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlInterpreter_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlInterpreter_Sf_SwigStatic = { + "rlInterpreter", + swig_rlInterpreter_Sf_SwigStatic_methods, + swig_rlInterpreter_Sf_SwigStatic_attributes, + swig_rlInterpreter_Sf_SwigStatic_constants, + swig_rlInterpreter_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlInterpreter_bases[] = {0}; static const char *swig_rlInterpreter_base_names[] = {0}; -static swig_lua_class _wrap_class_rlInterpreter = { "rlInterpreter", &SWIGTYPE_p_rlInterpreter,_wrap_new_rlInterpreter, swig_delete_rlInterpreter, swig_rlInterpreter_methods, swig_rlInterpreter_attributes, { "rlInterpreter", swig_rlInterpreter_cls_methods, swig_rlInterpreter_cls_attributes, swig_rlInterpreter_cls_constants }, swig_rlInterpreter_bases, swig_rlInterpreter_base_names }; +static swig_lua_class _wrap_class_rlInterpreter = { "rlInterpreter", "rlInterpreter", &SWIGTYPE_p_rlInterpreter,_proxy__wrap_new_rlInterpreter, swig_delete_rlInterpreter, swig_rlInterpreter_methods, swig_rlInterpreter_attributes, &swig_rlInterpreter_Sf_SwigStatic, swig_rlInterpreter_meta, swig_rlInterpreter_bases, swig_rlInterpreter_base_names }; static int _wrap_new_rlMailbox(lua_State* L) { int SWIG_arg = 0; @@ -14748,26 +16214,35 @@ static void swig_delete_rlMailbox(void *obj) { rlMailbox *arg1 = (rlMailbox *) obj; delete arg1; } -static swig_lua_method swig_rlMailbox_methods[] = { - {"printf", _wrap_rlMailbox_printf}, - {"setReadBufferSize", _wrap_rlMailbox_setReadBufferSize}, - {"read", _wrap_rlMailbox_read}, - {"write", _wrap_rlMailbox_write}, - {"clear", _wrap_rlMailbox_clear}, - {0,0} -}; +static int _proxy__wrap_new_rlMailbox(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlMailbox); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlMailbox_attributes[] = { - { "status", _wrap_rlMailbox_status_get, _wrap_rlMailbox_status_set}, - { "name", _wrap_rlMailbox_name_get, _wrap_rlMailbox_name_set}, + { "status", _wrap_rlMailbox_status_get, _wrap_rlMailbox_status_set }, + { "name", _wrap_rlMailbox_name_get, _wrap_rlMailbox_name_set }, {0,0,0} }; -static swig_lua_attribute swig_rlMailbox_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlMailbox_methods[]= { + { "printf", _wrap_rlMailbox_printf}, + { "setReadBufferSize", _wrap_rlMailbox_setReadBufferSize}, + { "read", _wrap_rlMailbox_read}, + { "write", _wrap_rlMailbox_write}, + { "clear", _wrap_rlMailbox_clear}, + {0,0} }; -static swig_lua_method swig_rlMailbox_cls_methods[] = { +static swig_lua_method swig_rlMailbox_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlMailbox_cls_constants[] = { + +static swig_lua_attribute swig_rlMailbox_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlMailbox_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("MAILBOX_ERROR", rlMailbox::MAILBOX_ERROR)}, {SWIG_LUA_CONSTTAB_INT("MAILBOX_FULL", rlMailbox::MAILBOX_FULL)}, {SWIG_LUA_CONSTTAB_INT("WAIT", rlMailbox::WAIT)}, @@ -14779,9 +16254,24 @@ static swig_lua_const_info swig_rlMailbox_cls_constants[] = { {SWIG_LUA_CONSTTAB_INT("COULD_NOT_GET_CHAN_ID", rlMailbox::COULD_NOT_GET_CHAN_ID)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlMailbox_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlMailbox_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlMailbox_Sf_SwigStatic = { + "rlMailbox", + swig_rlMailbox_Sf_SwigStatic_methods, + swig_rlMailbox_Sf_SwigStatic_attributes, + swig_rlMailbox_Sf_SwigStatic_constants, + swig_rlMailbox_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlMailbox_bases[] = {0}; static const char *swig_rlMailbox_base_names[] = {0}; -static swig_lua_class _wrap_class_rlMailbox = { "rlMailbox", &SWIGTYPE_p_rlMailbox,_wrap_new_rlMailbox, swig_delete_rlMailbox, swig_rlMailbox_methods, swig_rlMailbox_attributes, { "rlMailbox", swig_rlMailbox_cls_methods, swig_rlMailbox_cls_attributes, swig_rlMailbox_cls_constants }, swig_rlMailbox_bases, swig_rlMailbox_base_names }; +static swig_lua_class _wrap_class_rlMailbox = { "rlMailbox", "rlMailbox", &SWIGTYPE_p_rlMailbox,_proxy__wrap_new_rlMailbox, swig_delete_rlMailbox, swig_rlMailbox_methods, swig_rlMailbox_attributes, &swig_rlMailbox_Sf_SwigStatic, swig_rlMailbox_meta, swig_rlMailbox_bases, swig_rlMailbox_base_names }; static int _wrap_new_rlModbusClient(lua_State* L) { int SWIG_arg = 0; @@ -15089,32 +16579,56 @@ static void swig_delete_rlModbusClient(void *obj) { rlModbusClient *arg1 = (rlModbusClient *) obj; delete arg1; } -static swig_lua_method swig_rlModbusClient_methods[] = { - {"write", _wrap_rlModbusClient_write}, - {"writeSingleCoil", _wrap_rlModbusClient_writeSingleCoil}, - {"writeMultipleCoils", _wrap_rlModbusClient_writeMultipleCoils}, - {"writePresetSingleRegister", _wrap_rlModbusClient_writePresetSingleRegister}, - {"writePresetMultipleRegisters", _wrap_rlModbusClient_writePresetMultipleRegisters}, - {"readBit", _wrap_rlModbusClient_readBit}, - {"readByte", _wrap_rlModbusClient_readByte}, - {"readShort", _wrap_rlModbusClient_readShort}, - {0,0} -}; +static int _proxy__wrap_new_rlModbusClient(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlModbusClient); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlModbusClient_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlModbusClient_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlModbusClient_methods[]= { + { "write", _wrap_rlModbusClient_write}, + { "writeSingleCoil", _wrap_rlModbusClient_writeSingleCoil}, + { "writeMultipleCoils", _wrap_rlModbusClient_writeMultipleCoils}, + { "writePresetSingleRegister", _wrap_rlModbusClient_writePresetSingleRegister}, + { "writePresetMultipleRegisters", _wrap_rlModbusClient_writePresetMultipleRegisters}, + { "readBit", _wrap_rlModbusClient_readBit}, + { "readByte", _wrap_rlModbusClient_readByte}, + { "readShort", _wrap_rlModbusClient_readShort}, + {0,0} }; -static swig_lua_method swig_rlModbusClient_cls_methods[] = { +static swig_lua_method swig_rlModbusClient_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlModbusClient_cls_constants[] = { + +static swig_lua_attribute swig_rlModbusClient_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlModbusClient_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlModbusClient_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlModbusClient_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlModbusClient_Sf_SwigStatic = { + "rlModbusClient", + swig_rlModbusClient_Sf_SwigStatic_methods, + swig_rlModbusClient_Sf_SwigStatic_attributes, + swig_rlModbusClient_Sf_SwigStatic_constants, + swig_rlModbusClient_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlModbusClient_bases[] = {0,0,0}; static const char *swig_rlModbusClient_base_names[] = {"rlMailbox *","rlSharedMemory *",0}; -static swig_lua_class _wrap_class_rlModbusClient = { "rlModbusClient", &SWIGTYPE_p_rlModbusClient,_wrap_new_rlModbusClient, swig_delete_rlModbusClient, swig_rlModbusClient_methods, swig_rlModbusClient_attributes, { "rlModbusClient", swig_rlModbusClient_cls_methods, swig_rlModbusClient_cls_attributes, swig_rlModbusClient_cls_constants }, swig_rlModbusClient_bases, swig_rlModbusClient_base_names }; +static swig_lua_class _wrap_class_rlModbusClient = { "rlModbusClient", "rlModbusClient", &SWIGTYPE_p_rlModbusClient,_proxy__wrap_new_rlModbusClient, swig_delete_rlModbusClient, swig_rlModbusClient_methods, swig_rlModbusClient_attributes, &swig_rlModbusClient_Sf_SwigStatic, swig_rlModbusClient_meta, swig_rlModbusClient_bases, swig_rlModbusClient_base_names }; static int _wrap_new_rlModbus__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -17602,37 +19116,46 @@ static void swig_delete_rlModbus(void *obj) { rlModbus *arg1 = (rlModbus *) obj; delete arg1; } -static swig_lua_method swig_rlModbus_methods[] = { - {"write", _wrap_rlModbus_write}, - {"request", _wrap_rlModbus_request}, - {"response", _wrap_rlModbus_response}, - {"readRequest", _wrap_rlModbus_readRequest}, - {"registerSocket", _wrap_rlModbus_registerSocket}, - {"registerSerial", _wrap_rlModbus_registerSerial}, - {"data2int", _wrap_rlModbus_data2int}, - {"int2data", _wrap_rlModbus_int2data}, - {"intsize", _wrap_rlModbus_intsize}, - {"readCoilStatus", _wrap_rlModbus_readCoilStatus}, - {"readInputStatus", _wrap_rlModbus_readInputStatus}, - {"readHoldingRegisters", _wrap_rlModbus_readHoldingRegisters}, - {"readInputRegisters", _wrap_rlModbus_readInputRegisters}, - {"forceSingleCoil", _wrap_rlModbus_forceSingleCoil}, - {"presetSingleRegister", _wrap_rlModbus_presetSingleRegister}, - {"forceMultipleCoils", _wrap_rlModbus_forceMultipleCoils}, - {"presetMultipleRegisters", _wrap_rlModbus_presetMultipleRegisters}, - {0,0} -}; +static int _proxy__wrap_new_rlModbus(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlModbus); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlModbus_attributes[] = { - { "autoreconnectSocket", _wrap_rlModbus_autoreconnectSocket_get, _wrap_rlModbus_autoreconnectSocket_set}, + { "autoreconnectSocket", _wrap_rlModbus_autoreconnectSocket_get, _wrap_rlModbus_autoreconnectSocket_set }, {0,0,0} }; -static swig_lua_attribute swig_rlModbus_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlModbus_methods[]= { + { "write", _wrap_rlModbus_write}, + { "request", _wrap_rlModbus_request}, + { "response", _wrap_rlModbus_response}, + { "readRequest", _wrap_rlModbus_readRequest}, + { "registerSocket", _wrap_rlModbus_registerSocket}, + { "registerSerial", _wrap_rlModbus_registerSerial}, + { "data2int", _wrap_rlModbus_data2int}, + { "int2data", _wrap_rlModbus_int2data}, + { "intsize", _wrap_rlModbus_intsize}, + { "readCoilStatus", _wrap_rlModbus_readCoilStatus}, + { "readInputStatus", _wrap_rlModbus_readInputStatus}, + { "readHoldingRegisters", _wrap_rlModbus_readHoldingRegisters}, + { "readInputRegisters", _wrap_rlModbus_readInputRegisters}, + { "forceSingleCoil", _wrap_rlModbus_forceSingleCoil}, + { "presetSingleRegister", _wrap_rlModbus_presetSingleRegister}, + { "forceMultipleCoils", _wrap_rlModbus_forceMultipleCoils}, + { "presetMultipleRegisters", _wrap_rlModbus_presetMultipleRegisters}, + {0,0} }; -static swig_lua_method swig_rlModbus_cls_methods[] = { +static swig_lua_method swig_rlModbus_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlModbus_cls_constants[] = { + +static swig_lua_attribute swig_rlModbus_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlModbus_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("MODBUS_CHECKSUM_ERROR", rlModbus::MODBUS_CHECKSUM_ERROR)}, {SWIG_LUA_CONSTTAB_INT("MODBUS_ERROR", rlModbus::MODBUS_ERROR)}, {SWIG_LUA_CONSTTAB_INT("MODBUS_SUCCESS", rlModbus::MODBUS_SUCCESS)}, @@ -17657,9 +19180,24 @@ static swig_lua_const_info swig_rlModbus_cls_constants[] = { {SWIG_LUA_CONSTTAB_INT("ReadFifoQueue", rlModbus::ReadFifoQueue)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlModbus_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlModbus_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlModbus_Sf_SwigStatic = { + "rlModbus", + swig_rlModbus_Sf_SwigStatic_methods, + swig_rlModbus_Sf_SwigStatic_attributes, + swig_rlModbus_Sf_SwigStatic_constants, + swig_rlModbus_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlModbus_bases[] = {0}; static const char *swig_rlModbus_base_names[] = {0}; -static swig_lua_class _wrap_class_rlModbus = { "rlModbus", &SWIGTYPE_p_rlModbus,_wrap_new_rlModbus, swig_delete_rlModbus, swig_rlModbus_methods, swig_rlModbus_attributes, { "rlModbus", swig_rlModbus_cls_methods, swig_rlModbus_cls_attributes, swig_rlModbus_cls_constants }, swig_rlModbus_bases, swig_rlModbus_base_names }; +static swig_lua_class _wrap_class_rlModbus = { "rlModbus", "rlModbus", &SWIGTYPE_p_rlModbus,_proxy__wrap_new_rlModbus, swig_delete_rlModbus, swig_rlModbus_methods, swig_rlModbus_attributes, &swig_rlModbus_Sf_SwigStatic, swig_rlModbus_meta, swig_rlModbus_bases, swig_rlModbus_base_names }; static int _wrap_new_rlOpcXmlDa__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -18057,34 +19595,58 @@ static void swig_delete_rlOpcXmlDa(void *obj) { rlOpcXmlDa *arg1 = (rlOpcXmlDa *) obj; delete arg1; } -static swig_lua_method swig_rlOpcXmlDa_methods[] = { - {"stringValue", _wrap_rlOpcXmlDa_stringValue}, - {"intValue", _wrap_rlOpcXmlDa_intValue}, - {"floatValue", _wrap_rlOpcXmlDa_floatValue}, - {"writeStringValue", _wrap_rlOpcXmlDa_writeStringValue}, - {"writeIntValue", _wrap_rlOpcXmlDa_writeIntValue}, - {"writeFloatValue", _wrap_rlOpcXmlDa_writeFloatValue}, - {"readErrorCount", _wrap_rlOpcXmlDa_readErrorCount}, - {"writeErrorCount", _wrap_rlOpcXmlDa_writeErrorCount}, - {"shmStatus", _wrap_rlOpcXmlDa_shmStatus}, - {0,0} -}; +static int _proxy__wrap_new_rlOpcXmlDa(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlOpcXmlDa); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlOpcXmlDa_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlOpcXmlDa_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlOpcXmlDa_methods[]= { + { "stringValue", _wrap_rlOpcXmlDa_stringValue}, + { "intValue", _wrap_rlOpcXmlDa_intValue}, + { "floatValue", _wrap_rlOpcXmlDa_floatValue}, + { "writeStringValue", _wrap_rlOpcXmlDa_writeStringValue}, + { "writeIntValue", _wrap_rlOpcXmlDa_writeIntValue}, + { "writeFloatValue", _wrap_rlOpcXmlDa_writeFloatValue}, + { "readErrorCount", _wrap_rlOpcXmlDa_readErrorCount}, + { "writeErrorCount", _wrap_rlOpcXmlDa_writeErrorCount}, + { "shmStatus", _wrap_rlOpcXmlDa_shmStatus}, + {0,0} }; -static swig_lua_method swig_rlOpcXmlDa_cls_methods[] = { +static swig_lua_method swig_rlOpcXmlDa_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlOpcXmlDa_cls_constants[] = { + +static swig_lua_attribute swig_rlOpcXmlDa_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlOpcXmlDa_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("OPCXMLDA_ERROR", rlOpcXmlDa::OPCXMLDA_ERROR)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlOpcXmlDa_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlOpcXmlDa_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlOpcXmlDa_Sf_SwigStatic = { + "rlOpcXmlDa", + swig_rlOpcXmlDa_Sf_SwigStatic_methods, + swig_rlOpcXmlDa_Sf_SwigStatic_attributes, + swig_rlOpcXmlDa_Sf_SwigStatic_constants, + swig_rlOpcXmlDa_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlOpcXmlDa_bases[] = {0}; static const char *swig_rlOpcXmlDa_base_names[] = {0}; -static swig_lua_class _wrap_class_rlOpcXmlDa = { "rlOpcXmlDa", &SWIGTYPE_p_rlOpcXmlDa,_wrap_new_rlOpcXmlDa, swig_delete_rlOpcXmlDa, swig_rlOpcXmlDa_methods, swig_rlOpcXmlDa_attributes, { "rlOpcXmlDa", swig_rlOpcXmlDa_cls_methods, swig_rlOpcXmlDa_cls_attributes, swig_rlOpcXmlDa_cls_constants }, swig_rlOpcXmlDa_bases, swig_rlOpcXmlDa_base_names }; +static swig_lua_class _wrap_class_rlOpcXmlDa = { "rlOpcXmlDa", "rlOpcXmlDa", &SWIGTYPE_p_rlOpcXmlDa,_proxy__wrap_new_rlOpcXmlDa, swig_delete_rlOpcXmlDa, swig_rlOpcXmlDa_methods, swig_rlOpcXmlDa_attributes, &swig_rlOpcXmlDa_Sf_SwigStatic, swig_rlOpcXmlDa_meta, swig_rlOpcXmlDa_bases, swig_rlOpcXmlDa_base_names }; static int _wrap_new_rlPcontrol(lua_State* L) { int SWIG_arg = 0; @@ -18452,38 +20014,62 @@ static void swig_delete_rlPcontrol(void *obj) { rlPcontrol *arg1 = (rlPcontrol *) obj; delete arg1; } -static swig_lua_method swig_rlPcontrol_methods[] = { - {"setStartupCommand", _wrap_rlPcontrol_setStartupCommand}, - {"start", _wrap_rlPcontrol_start}, - {"sigterm", _wrap_rlPcontrol_sigterm}, - {"sigkill", _wrap_rlPcontrol_sigkill}, - {"isAlive", _wrap_rlPcontrol_isAlive}, - {"startupCommand", _wrap_rlPcontrol_startupCommand}, - {"processName", _wrap_rlPcontrol_processName}, - {"processTime", _wrap_rlPcontrol_processTime}, - {"setPID", _wrap_rlPcontrol_setPID}, - {"pid", _wrap_rlPcontrol_pid}, - {"getNext", _wrap_rlPcontrol_getNext}, - {"addNew", _wrap_rlPcontrol_addNew}, - {"setPriority", _wrap_rlPcontrol_setPriority}, - {"priority", _wrap_rlPcontrol_priority}, - {0,0} -}; +static int _proxy__wrap_new_rlPcontrol(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlPcontrol); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlPcontrol_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlPcontrol_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlPcontrol_methods[]= { + { "setStartupCommand", _wrap_rlPcontrol_setStartupCommand}, + { "start", _wrap_rlPcontrol_start}, + { "sigterm", _wrap_rlPcontrol_sigterm}, + { "sigkill", _wrap_rlPcontrol_sigkill}, + { "isAlive", _wrap_rlPcontrol_isAlive}, + { "startupCommand", _wrap_rlPcontrol_startupCommand}, + { "processName", _wrap_rlPcontrol_processName}, + { "processTime", _wrap_rlPcontrol_processTime}, + { "setPID", _wrap_rlPcontrol_setPID}, + { "pid", _wrap_rlPcontrol_pid}, + { "getNext", _wrap_rlPcontrol_getNext}, + { "addNew", _wrap_rlPcontrol_addNew}, + { "setPriority", _wrap_rlPcontrol_setPriority}, + { "priority", _wrap_rlPcontrol_priority}, + {0,0} }; -static swig_lua_method swig_rlPcontrol_cls_methods[] = { +static swig_lua_method swig_rlPcontrol_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlPcontrol_cls_constants[] = { + +static swig_lua_attribute swig_rlPcontrol_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlPcontrol_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlPcontrol_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlPcontrol_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlPcontrol_Sf_SwigStatic = { + "rlPcontrol", + swig_rlPcontrol_Sf_SwigStatic_methods, + swig_rlPcontrol_Sf_SwigStatic_attributes, + swig_rlPcontrol_Sf_SwigStatic_constants, + swig_rlPcontrol_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlPcontrol_bases[] = {0}; static const char *swig_rlPcontrol_base_names[] = {0}; -static swig_lua_class _wrap_class_rlPcontrol = { "rlPcontrol", &SWIGTYPE_p_rlPcontrol,_wrap_new_rlPcontrol, swig_delete_rlPcontrol, swig_rlPcontrol_methods, swig_rlPcontrol_attributes, { "rlPcontrol", swig_rlPcontrol_cls_methods, swig_rlPcontrol_cls_attributes, swig_rlPcontrol_cls_constants }, swig_rlPcontrol_bases, swig_rlPcontrol_base_names }; +static swig_lua_class _wrap_class_rlPcontrol = { "rlPcontrol", "rlPcontrol", &SWIGTYPE_p_rlPcontrol,_proxy__wrap_new_rlPcontrol, swig_delete_rlPcontrol, swig_rlPcontrol_methods, swig_rlPcontrol_attributes, &swig_rlPcontrol_Sf_SwigStatic, swig_rlPcontrol_meta, swig_rlPcontrol_bases, swig_rlPcontrol_base_names }; static int _wrap_new_rlPlcState__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -19906,59 +21492,83 @@ static void swig_delete_rlPlcState(void *obj) { rlPlcState *arg1 = (rlPlcState *) obj; delete arg1; } -static swig_lua_method swig_rlPlcState_methods[] = { - {"rememberState", _wrap_rlPlcState_rememberState}, - {"intChanged", _wrap_rlPlcState_intChanged}, - {"floatChanged", _wrap_rlPlcState_floatChanged}, - {"doubleChanged", _wrap_rlPlcState_doubleChanged}, - {"intHasIncreased", _wrap_rlPlcState_intHasIncreased}, - {"floatHasIncreased", _wrap_rlPlcState_floatHasIncreased}, - {"doubleHasIncreased", _wrap_rlPlcState_doubleHasIncreased}, - {"intHasDecreased", _wrap_rlPlcState_intHasDecreased}, - {"floatHasDecreased", _wrap_rlPlcState_floatHasDecreased}, - {"doubleHasDecreased", _wrap_rlPlcState_doubleHasDecreased}, - {"deltaInt", _wrap_rlPlcState_deltaInt}, - {"deltaFloat", _wrap_rlPlcState_deltaFloat}, - {"deltaDouble", _wrap_rlPlcState_deltaDouble}, - {"set", _wrap_rlPlcState_set}, - {"clear", _wrap_rlPlcState_clear}, - {"isSet", _wrap_rlPlcState_isSet}, - {"isClear", _wrap_rlPlcState_isClear}, - {"hasBeenSet", _wrap_rlPlcState_hasBeenSet}, - {"hasBeenCleared", _wrap_rlPlcState_hasBeenCleared}, - {"maxInt", _wrap_rlPlcState_maxInt}, - {"maxFloat", _wrap_rlPlcState_maxFloat}, - {"maxDouble", _wrap_rlPlcState_maxDouble}, - {"getInt", _wrap_rlPlcState_getInt}, - {"getFloat", _wrap_rlPlcState_getFloat}, - {"getDouble", _wrap_rlPlcState_getDouble}, - {"getOldInt", _wrap_rlPlcState_getOldInt}, - {"getOldFloat", _wrap_rlPlcState_getOldFloat}, - {"getOldDouble", _wrap_rlPlcState_getOldDouble}, - {0,0} -}; +static int _proxy__wrap_new_rlPlcState(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlPlcState); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlPlcState_attributes[] = { - { "i", _wrap_rlPlcState_i_get, _wrap_rlPlcState_i_set}, - { "i_old", _wrap_rlPlcState_i_old_get, _wrap_rlPlcState_i_old_set}, - { "f", _wrap_rlPlcState_f_get, _wrap_rlPlcState_f_set}, - { "f_old", _wrap_rlPlcState_f_old_get, _wrap_rlPlcState_f_old_set}, - { "d", _wrap_rlPlcState_d_get, _wrap_rlPlcState_d_set}, - { "d_old", _wrap_rlPlcState_d_old_get, _wrap_rlPlcState_d_old_set}, - { "shm", _wrap_rlPlcState_shm_get, _wrap_rlPlcState_shm_set}, + { "i", _wrap_rlPlcState_i_get, _wrap_rlPlcState_i_set }, + { "i_old", _wrap_rlPlcState_i_old_get, _wrap_rlPlcState_i_old_set }, + { "f", _wrap_rlPlcState_f_get, _wrap_rlPlcState_f_set }, + { "f_old", _wrap_rlPlcState_f_old_get, _wrap_rlPlcState_f_old_set }, + { "d", _wrap_rlPlcState_d_get, _wrap_rlPlcState_d_set }, + { "d_old", _wrap_rlPlcState_d_old_get, _wrap_rlPlcState_d_old_set }, + { "shm", _wrap_rlPlcState_shm_get, _wrap_rlPlcState_shm_set }, {0,0,0} }; -static swig_lua_attribute swig_rlPlcState_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlPlcState_methods[]= { + { "rememberState", _wrap_rlPlcState_rememberState}, + { "intChanged", _wrap_rlPlcState_intChanged}, + { "floatChanged", _wrap_rlPlcState_floatChanged}, + { "doubleChanged", _wrap_rlPlcState_doubleChanged}, + { "intHasIncreased", _wrap_rlPlcState_intHasIncreased}, + { "floatHasIncreased", _wrap_rlPlcState_floatHasIncreased}, + { "doubleHasIncreased", _wrap_rlPlcState_doubleHasIncreased}, + { "intHasDecreased", _wrap_rlPlcState_intHasDecreased}, + { "floatHasDecreased", _wrap_rlPlcState_floatHasDecreased}, + { "doubleHasDecreased", _wrap_rlPlcState_doubleHasDecreased}, + { "deltaInt", _wrap_rlPlcState_deltaInt}, + { "deltaFloat", _wrap_rlPlcState_deltaFloat}, + { "deltaDouble", _wrap_rlPlcState_deltaDouble}, + { "set", _wrap_rlPlcState_set}, + { "clear", _wrap_rlPlcState_clear}, + { "isSet", _wrap_rlPlcState_isSet}, + { "isClear", _wrap_rlPlcState_isClear}, + { "hasBeenSet", _wrap_rlPlcState_hasBeenSet}, + { "hasBeenCleared", _wrap_rlPlcState_hasBeenCleared}, + { "maxInt", _wrap_rlPlcState_maxInt}, + { "maxFloat", _wrap_rlPlcState_maxFloat}, + { "maxDouble", _wrap_rlPlcState_maxDouble}, + { "getInt", _wrap_rlPlcState_getInt}, + { "getFloat", _wrap_rlPlcState_getFloat}, + { "getDouble", _wrap_rlPlcState_getDouble}, + { "getOldInt", _wrap_rlPlcState_getOldInt}, + { "getOldFloat", _wrap_rlPlcState_getOldFloat}, + { "getOldDouble", _wrap_rlPlcState_getOldDouble}, + {0,0} }; -static swig_lua_method swig_rlPlcState_cls_methods[] = { +static swig_lua_method swig_rlPlcState_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlPlcState_cls_constants[] = { + +static swig_lua_attribute swig_rlPlcState_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlPlcState_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlPlcState_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlPlcState_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlPlcState_Sf_SwigStatic = { + "rlPlcState", + swig_rlPlcState_Sf_SwigStatic_methods, + swig_rlPlcState_Sf_SwigStatic_attributes, + swig_rlPlcState_Sf_SwigStatic_constants, + swig_rlPlcState_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlPlcState_bases[] = {0}; static const char *swig_rlPlcState_base_names[] = {0}; -static swig_lua_class _wrap_class_rlPlcState = { "rlPlcState", &SWIGTYPE_p_rlPlcState,_wrap_new_rlPlcState, swig_delete_rlPlcState, swig_rlPlcState_methods, swig_rlPlcState_attributes, { "rlPlcState", swig_rlPlcState_cls_methods, swig_rlPlcState_cls_attributes, swig_rlPlcState_cls_constants }, swig_rlPlcState_bases, swig_rlPlcState_base_names }; +static swig_lua_class _wrap_class_rlPlcState = { "rlPlcState", "rlPlcState", &SWIGTYPE_p_rlPlcState,_proxy__wrap_new_rlPlcState, swig_delete_rlPlcState, swig_rlPlcState_methods, swig_rlPlcState_attributes, &swig_rlPlcState_Sf_SwigStatic, swig_rlPlcState_meta, swig_rlPlcState_bases, swig_rlPlcState_base_names }; static int _wrap_new_rlPlcMem(lua_State* L) { int SWIG_arg = 0; @@ -20752,49 +22362,73 @@ static void swig_delete_rlPlcMem(void *obj) { rlPlcMem *arg1 = (rlPlcMem *) obj; delete arg1; } -static swig_lua_method swig_rlPlcMem_methods[] = { - {"rememberState", _wrap_rlPlcMem_rememberState}, - {"intChanged", _wrap_rlPlcMem_intChanged}, - {"floatChanged", _wrap_rlPlcMem_floatChanged}, - {"doubleChanged", _wrap_rlPlcMem_doubleChanged}, - {"intHasIncreased", _wrap_rlPlcMem_intHasIncreased}, - {"floatHasIncreased", _wrap_rlPlcMem_floatHasIncreased}, - {"doubleHasIncreased", _wrap_rlPlcMem_doubleHasIncreased}, - {"intHasDecreased", _wrap_rlPlcMem_intHasDecreased}, - {"floatHasDecreased", _wrap_rlPlcMem_floatHasDecreased}, - {"doubleHasDecreased", _wrap_rlPlcMem_doubleHasDecreased}, - {"deltaInt", _wrap_rlPlcMem_deltaInt}, - {"deltaFloat", _wrap_rlPlcMem_deltaFloat}, - {"deltaDouble", _wrap_rlPlcMem_deltaDouble}, - {"set", _wrap_rlPlcMem_set}, - {"clear", _wrap_rlPlcMem_clear}, - {"isSet", _wrap_rlPlcMem_isSet}, - {"isClear", _wrap_rlPlcMem_isClear}, - {"hasBeenSet", _wrap_rlPlcMem_hasBeenSet}, - {"hasBeenCleared", _wrap_rlPlcMem_hasBeenCleared}, - {0,0} -}; +static int _proxy__wrap_new_rlPlcMem(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlPlcMem); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlPlcMem_attributes[] = { - { "i", _wrap_rlPlcMem_i_get, _wrap_rlPlcMem_i_set}, - { "i_old", _wrap_rlPlcMem_i_old_get, _wrap_rlPlcMem_i_old_set}, - { "f", _wrap_rlPlcMem_f_get, _wrap_rlPlcMem_f_set}, - { "f_old", _wrap_rlPlcMem_f_old_get, _wrap_rlPlcMem_f_old_set}, - { "d", _wrap_rlPlcMem_d_get, _wrap_rlPlcMem_d_set}, - { "d_old", _wrap_rlPlcMem_d_old_get, _wrap_rlPlcMem_d_old_set}, + { "i", _wrap_rlPlcMem_i_get, _wrap_rlPlcMem_i_set }, + { "i_old", _wrap_rlPlcMem_i_old_get, _wrap_rlPlcMem_i_old_set }, + { "f", _wrap_rlPlcMem_f_get, _wrap_rlPlcMem_f_set }, + { "f_old", _wrap_rlPlcMem_f_old_get, _wrap_rlPlcMem_f_old_set }, + { "d", _wrap_rlPlcMem_d_get, _wrap_rlPlcMem_d_set }, + { "d_old", _wrap_rlPlcMem_d_old_get, _wrap_rlPlcMem_d_old_set }, {0,0,0} }; -static swig_lua_attribute swig_rlPlcMem_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlPlcMem_methods[]= { + { "rememberState", _wrap_rlPlcMem_rememberState}, + { "intChanged", _wrap_rlPlcMem_intChanged}, + { "floatChanged", _wrap_rlPlcMem_floatChanged}, + { "doubleChanged", _wrap_rlPlcMem_doubleChanged}, + { "intHasIncreased", _wrap_rlPlcMem_intHasIncreased}, + { "floatHasIncreased", _wrap_rlPlcMem_floatHasIncreased}, + { "doubleHasIncreased", _wrap_rlPlcMem_doubleHasIncreased}, + { "intHasDecreased", _wrap_rlPlcMem_intHasDecreased}, + { "floatHasDecreased", _wrap_rlPlcMem_floatHasDecreased}, + { "doubleHasDecreased", _wrap_rlPlcMem_doubleHasDecreased}, + { "deltaInt", _wrap_rlPlcMem_deltaInt}, + { "deltaFloat", _wrap_rlPlcMem_deltaFloat}, + { "deltaDouble", _wrap_rlPlcMem_deltaDouble}, + { "set", _wrap_rlPlcMem_set}, + { "clear", _wrap_rlPlcMem_clear}, + { "isSet", _wrap_rlPlcMem_isSet}, + { "isClear", _wrap_rlPlcMem_isClear}, + { "hasBeenSet", _wrap_rlPlcMem_hasBeenSet}, + { "hasBeenCleared", _wrap_rlPlcMem_hasBeenCleared}, + {0,0} }; -static swig_lua_method swig_rlPlcMem_cls_methods[] = { +static swig_lua_method swig_rlPlcMem_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlPlcMem_cls_constants[] = { + +static swig_lua_attribute swig_rlPlcMem_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlPlcMem_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlPlcMem_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlPlcMem_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlPlcMem_Sf_SwigStatic = { + "rlPlcMem", + swig_rlPlcMem_Sf_SwigStatic_methods, + swig_rlPlcMem_Sf_SwigStatic_attributes, + swig_rlPlcMem_Sf_SwigStatic_constants, + swig_rlPlcMem_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlPlcMem_bases[] = {0}; static const char *swig_rlPlcMem_base_names[] = {0}; -static swig_lua_class _wrap_class_rlPlcMem = { "rlPlcMem", &SWIGTYPE_p_rlPlcMem,_wrap_new_rlPlcMem, swig_delete_rlPlcMem, swig_rlPlcMem_methods, swig_rlPlcMem_attributes, { "rlPlcMem", swig_rlPlcMem_cls_methods, swig_rlPlcMem_cls_attributes, swig_rlPlcMem_cls_constants }, swig_rlPlcMem_bases, swig_rlPlcMem_base_names }; +static swig_lua_class _wrap_class_rlPlcMem = { "rlPlcMem", "rlPlcMem", &SWIGTYPE_p_rlPlcMem,_proxy__wrap_new_rlPlcMem, swig_delete_rlPlcMem, swig_rlPlcMem_methods, swig_rlPlcMem_attributes, &swig_rlPlcMem_Sf_SwigStatic, swig_rlPlcMem_meta, swig_rlPlcMem_bases, swig_rlPlcMem_base_names }; static int _wrap_new_rlPPIClient__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -21413,32 +23047,41 @@ static void swig_delete_rlPPIClient(void *obj) { rlPPIClient *arg1 = (rlPPIClient *) obj; delete arg1; } -static swig_lua_method swig_rlPPIClient_methods[] = { - {"write", _wrap_rlPPIClient_write}, - {"writeFloat", _wrap_rlPPIClient_writeFloat}, - {"writeDword", _wrap_rlPPIClient_writeDword}, - {"writeShort", _wrap_rlPPIClient_writeShort}, - {"writeUDword", _wrap_rlPPIClient_writeUDword}, - {"writeUShort", _wrap_rlPPIClient_writeUShort}, - {"read", _wrap_rlPPIClient_read}, - {"Float", _wrap_rlPPIClient_Float}, - {"Dword", _wrap_rlPPIClient_Dword}, - {"Short", _wrap_rlPPIClient_Short}, - {"UDword", _wrap_rlPPIClient_UDword}, - {"UShort", _wrap_rlPPIClient_UShort}, - {0,0} -}; +static int _proxy__wrap_new_rlPPIClient(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlPPIClient); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlPPIClient_attributes[] = { - { "buf", _wrap_rlPPIClient_buf_get, _wrap_rlPPIClient_buf_set}, + { "buf", _wrap_rlPPIClient_buf_get, _wrap_rlPPIClient_buf_set }, {0,0,0} }; -static swig_lua_attribute swig_rlPPIClient_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlPPIClient_methods[]= { + { "write", _wrap_rlPPIClient_write}, + { "writeFloat", _wrap_rlPPIClient_writeFloat}, + { "writeDword", _wrap_rlPPIClient_writeDword}, + { "writeShort", _wrap_rlPPIClient_writeShort}, + { "writeUDword", _wrap_rlPPIClient_writeUDword}, + { "writeUShort", _wrap_rlPPIClient_writeUShort}, + { "read", _wrap_rlPPIClient_read}, + { "Float", _wrap_rlPPIClient_Float}, + { "Dword", _wrap_rlPPIClient_Dword}, + { "Short", _wrap_rlPPIClient_Short}, + { "UDword", _wrap_rlPPIClient_UDword}, + { "UShort", _wrap_rlPPIClient_UShort}, + {0,0} }; -static swig_lua_method swig_rlPPIClient_cls_methods[] = { +static swig_lua_method swig_rlPPIClient_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlPPIClient_cls_constants[] = { + +static swig_lua_attribute swig_rlPPIClient_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlPPIClient_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("daveSD", rlPPIClient::daveSD)}, {SWIG_LUA_CONSTTAB_INT("daveInputs", rlPPIClient::daveInputs)}, {SWIG_LUA_CONSTTAB_INT("daveOutputs", rlPPIClient::daveOutputs)}, @@ -21451,9 +23094,24 @@ static swig_lua_const_info swig_rlPPIClient_cls_constants[] = { {SWIG_LUA_CONSTTAB_INT("daveTimer", rlPPIClient::daveTimer)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlPPIClient_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlPPIClient_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlPPIClient_Sf_SwigStatic = { + "rlPPIClient", + swig_rlPPIClient_Sf_SwigStatic_methods, + swig_rlPPIClient_Sf_SwigStatic_attributes, + swig_rlPPIClient_Sf_SwigStatic_constants, + swig_rlPPIClient_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlPPIClient_bases[] = {0,0}; static const char *swig_rlPPIClient_base_names[] = {"rlMailbox *",0}; -static swig_lua_class _wrap_class_rlPPIClient = { "rlPPIClient", &SWIGTYPE_p_rlPPIClient,_wrap_new_rlPPIClient, swig_delete_rlPPIClient, swig_rlPPIClient_methods, swig_rlPPIClient_attributes, { "rlPPIClient", swig_rlPPIClient_cls_methods, swig_rlPPIClient_cls_attributes, swig_rlPPIClient_cls_constants }, swig_rlPPIClient_bases, swig_rlPPIClient_base_names }; +static swig_lua_class _wrap_class_rlPPIClient = { "rlPPIClient", "rlPPIClient", &SWIGTYPE_p_rlPPIClient,_proxy__wrap_new_rlPPIClient, swig_delete_rlPPIClient, swig_rlPPIClient_methods, swig_rlPPIClient_attributes, &swig_rlPPIClient_Sf_SwigStatic, swig_rlPPIClient_meta, swig_rlPPIClient_bases, swig_rlPPIClient_base_names }; static int _wrap_new_rlSerial(lua_State* L) { int SWIG_arg = 0; @@ -22523,36 +24181,60 @@ static void swig_delete_rlSerial(void *obj) { rlSerial *arg1 = (rlSerial *) obj; delete arg1; } -static swig_lua_method swig_rlSerial_methods[] = { - {"openDevice", _wrap_rlSerial_openDevice}, - {"select", _wrap_rlSerial_select}, - {"readChar", _wrap_rlSerial_readChar}, - {"writeChar", _wrap_rlSerial_writeChar}, - {"readBlock", _wrap_rlSerial_readBlock}, - {"writeBlock", _wrap_rlSerial_writeBlock}, - {"readLine", _wrap_rlSerial_readLine}, - {"closeDevice", _wrap_rlSerial_closeDevice}, - {"setTrace", _wrap_rlSerial_setTrace}, - {0,0} -}; +static int _proxy__wrap_new_rlSerial(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSerial); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSerial_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlSerial_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSerial_methods[]= { + { "openDevice", _wrap_rlSerial_openDevice}, + { "select", _wrap_rlSerial_select}, + { "readChar", _wrap_rlSerial_readChar}, + { "writeChar", _wrap_rlSerial_writeChar}, + { "readBlock", _wrap_rlSerial_readBlock}, + { "writeBlock", _wrap_rlSerial_writeBlock}, + { "readLine", _wrap_rlSerial_readLine}, + { "closeDevice", _wrap_rlSerial_closeDevice}, + { "setTrace", _wrap_rlSerial_setTrace}, + {0,0} }; -static swig_lua_method swig_rlSerial_cls_methods[] = { +static swig_lua_method swig_rlSerial_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSerial_cls_constants[] = { + +static swig_lua_attribute swig_rlSerial_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSerial_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("NONE", rlSerial::NONE)}, {SWIG_LUA_CONSTTAB_INT("ODD", rlSerial::ODD)}, {SWIG_LUA_CONSTTAB_INT("EVEN", rlSerial::EVEN)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSerial_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSerial_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSerial_Sf_SwigStatic = { + "rlSerial", + swig_rlSerial_Sf_SwigStatic_methods, + swig_rlSerial_Sf_SwigStatic_attributes, + swig_rlSerial_Sf_SwigStatic_constants, + swig_rlSerial_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSerial_bases[] = {0}; static const char *swig_rlSerial_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSerial = { "rlSerial", &SWIGTYPE_p_rlSerial,_wrap_new_rlSerial, swig_delete_rlSerial, swig_rlSerial_methods, swig_rlSerial_attributes, { "rlSerial", swig_rlSerial_cls_methods, swig_rlSerial_cls_attributes, swig_rlSerial_cls_constants }, swig_rlSerial_bases, swig_rlSerial_base_names }; +static swig_lua_class _wrap_class_rlSerial = { "rlSerial", "rlSerial", &SWIGTYPE_p_rlSerial,_proxy__wrap_new_rlSerial, swig_delete_rlSerial, swig_rlSerial_methods, swig_rlSerial_attributes, &swig_rlSerial_Sf_SwigStatic, swig_rlSerial_meta, swig_rlSerial_bases, swig_rlSerial_base_names }; static int _wrap_new_rlSiemensTCPClient__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -23269,34 +24951,43 @@ static void swig_delete_rlSiemensTCPClient(void *obj) { rlSiemensTCPClient *arg1 = (rlSiemensTCPClient *) obj; delete arg1; } -static swig_lua_method swig_rlSiemensTCPClient_methods[] = { - {"write", _wrap_rlSiemensTCPClient_write}, - {"writeBit", _wrap_rlSiemensTCPClient_writeBit}, - {"writeByte", _wrap_rlSiemensTCPClient_writeByte}, - {"writeFloat", _wrap_rlSiemensTCPClient_writeFloat}, - {"writeDword", _wrap_rlSiemensTCPClient_writeDword}, - {"writeShort", _wrap_rlSiemensTCPClient_writeShort}, - {"writeUDword", _wrap_rlSiemensTCPClient_writeUDword}, - {"writeUShort", _wrap_rlSiemensTCPClient_writeUShort}, - {"read", _wrap_rlSiemensTCPClient_read}, - {"Float", _wrap_rlSiemensTCPClient_Float}, - {"Dword", _wrap_rlSiemensTCPClient_Dword}, - {"Short", _wrap_rlSiemensTCPClient_Short}, - {"UDword", _wrap_rlSiemensTCPClient_UDword}, - {"UShort", _wrap_rlSiemensTCPClient_UShort}, - {0,0} -}; +static int _proxy__wrap_new_rlSiemensTCPClient(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSiemensTCPClient); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSiemensTCPClient_attributes[] = { - { "buf", _wrap_rlSiemensTCPClient_buf_get, _wrap_rlSiemensTCPClient_buf_set}, + { "buf", _wrap_rlSiemensTCPClient_buf_get, _wrap_rlSiemensTCPClient_buf_set }, {0,0,0} }; -static swig_lua_attribute swig_rlSiemensTCPClient_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSiemensTCPClient_methods[]= { + { "write", _wrap_rlSiemensTCPClient_write}, + { "writeBit", _wrap_rlSiemensTCPClient_writeBit}, + { "writeByte", _wrap_rlSiemensTCPClient_writeByte}, + { "writeFloat", _wrap_rlSiemensTCPClient_writeFloat}, + { "writeDword", _wrap_rlSiemensTCPClient_writeDword}, + { "writeShort", _wrap_rlSiemensTCPClient_writeShort}, + { "writeUDword", _wrap_rlSiemensTCPClient_writeUDword}, + { "writeUShort", _wrap_rlSiemensTCPClient_writeUShort}, + { "read", _wrap_rlSiemensTCPClient_read}, + { "Float", _wrap_rlSiemensTCPClient_Float}, + { "Dword", _wrap_rlSiemensTCPClient_Dword}, + { "Short", _wrap_rlSiemensTCPClient_Short}, + { "UDword", _wrap_rlSiemensTCPClient_UDword}, + { "UShort", _wrap_rlSiemensTCPClient_UShort}, + {0,0} }; -static swig_lua_method swig_rlSiemensTCPClient_cls_methods[] = { +static swig_lua_method swig_rlSiemensTCPClient_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSiemensTCPClient_cls_constants[] = { + +static swig_lua_attribute swig_rlSiemensTCPClient_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSiemensTCPClient_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("ORG_DB", rlSiemensTCPClient::ORG_DB)}, {SWIG_LUA_CONSTTAB_INT("ORG_M", rlSiemensTCPClient::ORG_M)}, {SWIG_LUA_CONSTTAB_INT("ORG_E", rlSiemensTCPClient::ORG_E)}, @@ -23306,9 +24997,24 @@ static swig_lua_const_info swig_rlSiemensTCPClient_cls_constants[] = { {SWIG_LUA_CONSTTAB_INT("ORG_T", rlSiemensTCPClient::ORG_T)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSiemensTCPClient_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSiemensTCPClient_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSiemensTCPClient_Sf_SwigStatic = { + "rlSiemensTCPClient", + swig_rlSiemensTCPClient_Sf_SwigStatic_methods, + swig_rlSiemensTCPClient_Sf_SwigStatic_attributes, + swig_rlSiemensTCPClient_Sf_SwigStatic_constants, + swig_rlSiemensTCPClient_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSiemensTCPClient_bases[] = {0,0}; static const char *swig_rlSiemensTCPClient_base_names[] = {"rlMailbox *",0}; -static swig_lua_class _wrap_class_rlSiemensTCPClient = { "rlSiemensTCPClient", &SWIGTYPE_p_rlSiemensTCPClient,_wrap_new_rlSiemensTCPClient, swig_delete_rlSiemensTCPClient, swig_rlSiemensTCPClient_methods, swig_rlSiemensTCPClient_attributes, { "rlSiemensTCPClient", swig_rlSiemensTCPClient_cls_methods, swig_rlSiemensTCPClient_cls_attributes, swig_rlSiemensTCPClient_cls_constants }, swig_rlSiemensTCPClient_bases, swig_rlSiemensTCPClient_base_names }; +static swig_lua_class _wrap_class_rlSiemensTCPClient = { "rlSiemensTCPClient", "rlSiemensTCPClient", &SWIGTYPE_p_rlSiemensTCPClient,_proxy__wrap_new_rlSiemensTCPClient, swig_delete_rlSiemensTCPClient, swig_rlSiemensTCPClient_methods, swig_rlSiemensTCPClient_attributes, &swig_rlSiemensTCPClient_Sf_SwigStatic, swig_rlSiemensTCPClient_meta, swig_rlSiemensTCPClient_bases, swig_rlSiemensTCPClient_base_names }; static int _wrap_new_rlSiemensTCP__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -23892,24 +25598,33 @@ static void swig_delete_rlSiemensTCP(void *obj) { rlSiemensTCP *arg1 = (rlSiemensTCP *) obj; delete arg1; } -static swig_lua_method swig_rlSiemensTCP_methods[] = { - {"getDefaultConnectBlock", _wrap_rlSiemensTCP_getDefaultConnectBlock}, - {"setConnectBlock", _wrap_rlSiemensTCP_setConnectBlock}, - {"getConnectBlock", _wrap_rlSiemensTCP_getConnectBlock}, - {"write", _wrap_rlSiemensTCP_write}, - {"fetch", _wrap_rlSiemensTCP_fetch}, - {0,0} -}; +static int _proxy__wrap_new_rlSiemensTCP(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSiemensTCP); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSiemensTCP_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlSiemensTCP_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSiemensTCP_methods[]= { + { "getDefaultConnectBlock", _wrap_rlSiemensTCP_getDefaultConnectBlock}, + { "setConnectBlock", _wrap_rlSiemensTCP_setConnectBlock}, + { "getConnectBlock", _wrap_rlSiemensTCP_getConnectBlock}, + { "write", _wrap_rlSiemensTCP_write}, + { "fetch", _wrap_rlSiemensTCP_fetch}, + {0,0} }; -static swig_lua_method swig_rlSiemensTCP_cls_methods[] = { +static swig_lua_method swig_rlSiemensTCP_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSiemensTCP_cls_constants[] = { + +static swig_lua_attribute swig_rlSiemensTCP_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSiemensTCP_Sf_SwigStatic_constants[]= { {SWIG_LUA_CONSTTAB_INT("ORG_DB", rlSiemensTCP::ORG_DB)}, {SWIG_LUA_CONSTTAB_INT("ORG_M", rlSiemensTCP::ORG_M)}, {SWIG_LUA_CONSTTAB_INT("ORG_E", rlSiemensTCP::ORG_E)}, @@ -23929,9 +25644,24 @@ static swig_lua_const_info swig_rlSiemensTCP_cls_constants[] = { {SWIG_LUA_CONSTTAB_INT("WriteByte", rlSiemensTCP::WriteByte)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSiemensTCP_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSiemensTCP_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSiemensTCP_Sf_SwigStatic = { + "rlSiemensTCP", + swig_rlSiemensTCP_Sf_SwigStatic_methods, + swig_rlSiemensTCP_Sf_SwigStatic_attributes, + swig_rlSiemensTCP_Sf_SwigStatic_constants, + swig_rlSiemensTCP_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSiemensTCP_bases[] = {0,0}; static const char *swig_rlSiemensTCP_base_names[] = {"rlSocket *",0}; -static swig_lua_class _wrap_class_rlSiemensTCP = { "rlSiemensTCP", &SWIGTYPE_p_rlSiemensTCP,_wrap_new_rlSiemensTCP, swig_delete_rlSiemensTCP, swig_rlSiemensTCP_methods, swig_rlSiemensTCP_attributes, { "rlSiemensTCP", swig_rlSiemensTCP_cls_methods, swig_rlSiemensTCP_cls_attributes, swig_rlSiemensTCP_cls_constants }, swig_rlSiemensTCP_bases, swig_rlSiemensTCP_base_names }; +static swig_lua_class _wrap_class_rlSiemensTCP = { "rlSiemensTCP", "rlSiemensTCP", &SWIGTYPE_p_rlSiemensTCP,_proxy__wrap_new_rlSiemensTCP, swig_delete_rlSiemensTCP, swig_rlSiemensTCP_methods, swig_rlSiemensTCP_attributes, &swig_rlSiemensTCP_Sf_SwigStatic, swig_rlSiemensTCP_meta, swig_rlSiemensTCP_bases, swig_rlSiemensTCP_base_names }; static int _wrap_new_rlSpawn(lua_State* L) { int SWIG_arg = 0; @@ -24369,36 +26099,60 @@ static void swig_delete_rlSpawn(void *obj) { rlSpawn *arg1 = (rlSpawn *) obj; delete arg1; } -static swig_lua_method swig_rlSpawn_methods[] = { - {"spawn", _wrap_rlSpawn_spawn}, - {"readLine", _wrap_rlSpawn_readLine}, - {"getchar", _wrap_rlSpawn_getchar}, - {"select", _wrap_rlSpawn_select}, - {"writeString", _wrap_rlSpawn_writeString}, - {"write", _wrap_rlSpawn_write}, - {"printf", _wrap_rlSpawn_printf}, - {"printAll", _wrap_rlSpawn_printAll}, - {"getFilepointer", _wrap_rlSpawn_getFilepointer}, - {"sigkill", _wrap_rlSpawn_sigkill}, - {"readJpegBuffer", _wrap_rlSpawn_readJpegBuffer}, - {0,0} -}; +static int _proxy__wrap_new_rlSpawn(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSpawn); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSpawn_attributes[] = { - { "pid", _wrap_rlSpawn_pid_get, _wrap_rlSpawn_pid_set}, + { "pid", _wrap_rlSpawn_pid_get, _wrap_rlSpawn_pid_set }, {0,0,0} }; -static swig_lua_attribute swig_rlSpawn_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSpawn_methods[]= { + { "spawn", _wrap_rlSpawn_spawn}, + { "readLine", _wrap_rlSpawn_readLine}, + { "getchar", _wrap_rlSpawn_getchar}, + { "select", _wrap_rlSpawn_select}, + { "writeString", _wrap_rlSpawn_writeString}, + { "write", _wrap_rlSpawn_write}, + { "printf", _wrap_rlSpawn_printf}, + { "printAll", _wrap_rlSpawn_printAll}, + { "getFilepointer", _wrap_rlSpawn_getFilepointer}, + { "sigkill", _wrap_rlSpawn_sigkill}, + { "readJpegBuffer", _wrap_rlSpawn_readJpegBuffer}, + {0,0} }; -static swig_lua_method swig_rlSpawn_cls_methods[] = { +static swig_lua_method swig_rlSpawn_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSpawn_cls_constants[] = { + +static swig_lua_attribute swig_rlSpawn_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSpawn_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSpawn_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSpawn_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSpawn_Sf_SwigStatic = { + "rlSpawn", + swig_rlSpawn_Sf_SwigStatic_methods, + swig_rlSpawn_Sf_SwigStatic_attributes, + swig_rlSpawn_Sf_SwigStatic_constants, + swig_rlSpawn_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSpawn_bases[] = {0}; static const char *swig_rlSpawn_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSpawn = { "rlSpawn", &SWIGTYPE_p_rlSpawn,_wrap_new_rlSpawn, swig_delete_rlSpawn, swig_rlSpawn_methods, swig_rlSpawn_attributes, { "rlSpawn", swig_rlSpawn_cls_methods, swig_rlSpawn_cls_attributes, swig_rlSpawn_cls_constants }, swig_rlSpawn_bases, swig_rlSpawn_base_names }; +static swig_lua_class _wrap_class_rlSpawn = { "rlSpawn", "rlSpawn", &SWIGTYPE_p_rlSpawn,_proxy__wrap_new_rlSpawn, swig_delete_rlSpawn, swig_rlSpawn_methods, swig_rlSpawn_attributes, &swig_rlSpawn_Sf_SwigStatic, swig_rlSpawn_meta, swig_rlSpawn_bases, swig_rlSpawn_base_names }; static int _wrap_new_rlSpreadsheetCell__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -24648,31 +26402,55 @@ static void swig_delete_rlSpreadsheetCell(void *obj) { rlSpreadsheetCell *arg1 = (rlSpreadsheetCell *) obj; delete arg1; } -static swig_lua_method swig_rlSpreadsheetCell_methods[] = { - {"text", _wrap_rlSpreadsheetCell_text}, - {"setText", _wrap_rlSpreadsheetCell_setText}, - {"printf", _wrap_rlSpreadsheetCell_printf}, - {"clear", _wrap_rlSpreadsheetCell_clear}, - {"setNextCell", _wrap_rlSpreadsheetCell_setNextCell}, - {"getNextCell", _wrap_rlSpreadsheetCell_getNextCell}, - {"exists", _wrap_rlSpreadsheetCell_exists}, - {0,0} -}; +static int _proxy__wrap_new_rlSpreadsheetCell(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSpreadsheetCell); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSpreadsheetCell_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlSpreadsheetCell_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSpreadsheetCell_methods[]= { + { "text", _wrap_rlSpreadsheetCell_text}, + { "setText", _wrap_rlSpreadsheetCell_setText}, + { "printf", _wrap_rlSpreadsheetCell_printf}, + { "clear", _wrap_rlSpreadsheetCell_clear}, + { "setNextCell", _wrap_rlSpreadsheetCell_setNextCell}, + { "getNextCell", _wrap_rlSpreadsheetCell_getNextCell}, + { "exists", _wrap_rlSpreadsheetCell_exists}, + {0,0} }; -static swig_lua_method swig_rlSpreadsheetCell_cls_methods[] = { +static swig_lua_method swig_rlSpreadsheetCell_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSpreadsheetCell_cls_constants[] = { + +static swig_lua_attribute swig_rlSpreadsheetCell_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSpreadsheetCell_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSpreadsheetCell_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSpreadsheetCell_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSpreadsheetCell_Sf_SwigStatic = { + "rlSpreadsheetCell", + swig_rlSpreadsheetCell_Sf_SwigStatic_methods, + swig_rlSpreadsheetCell_Sf_SwigStatic_attributes, + swig_rlSpreadsheetCell_Sf_SwigStatic_constants, + swig_rlSpreadsheetCell_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSpreadsheetCell_bases[] = {0}; static const char *swig_rlSpreadsheetCell_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSpreadsheetCell = { "rlSpreadsheetCell", &SWIGTYPE_p_rlSpreadsheetCell,_wrap_new_rlSpreadsheetCell, swig_delete_rlSpreadsheetCell, swig_rlSpreadsheetCell_methods, swig_rlSpreadsheetCell_attributes, { "rlSpreadsheetCell", swig_rlSpreadsheetCell_cls_methods, swig_rlSpreadsheetCell_cls_attributes, swig_rlSpreadsheetCell_cls_constants }, swig_rlSpreadsheetCell_bases, swig_rlSpreadsheetCell_base_names }; +static swig_lua_class _wrap_class_rlSpreadsheetCell = { "rlSpreadsheetCell", "rlSpreadsheetCell", &SWIGTYPE_p_rlSpreadsheetCell,_proxy__wrap_new_rlSpreadsheetCell, swig_delete_rlSpreadsheetCell, swig_rlSpreadsheetCell_methods, swig_rlSpreadsheetCell_attributes, &swig_rlSpreadsheetCell_Sf_SwigStatic, swig_rlSpreadsheetCell_meta, swig_rlSpreadsheetCell_bases, swig_rlSpreadsheetCell_base_names }; static int _wrap_new_rlSpreadsheetRow(lua_State* L) { int SWIG_arg = 0; @@ -25166,34 +26944,58 @@ static void swig_delete_rlSpreadsheetRow(void *obj) { rlSpreadsheetRow *arg1 = (rlSpreadsheetRow *) obj; delete arg1; } -static swig_lua_method swig_rlSpreadsheetRow_methods[] = { - {"text", _wrap_rlSpreadsheetRow_text}, - {"setText", _wrap_rlSpreadsheetRow_setText}, - {"printf", _wrap_rlSpreadsheetRow_printf}, - {"clear", _wrap_rlSpreadsheetRow_clear}, - {"setNextRow", _wrap_rlSpreadsheetRow_setNextRow}, - {"getNextRow", _wrap_rlSpreadsheetRow_getNextRow}, - {"getFirstCell", _wrap_rlSpreadsheetRow_getFirstCell}, - {"readRow", _wrap_rlSpreadsheetRow_readRow}, - {"writeRow", _wrap_rlSpreadsheetRow_writeRow}, - {"exists", _wrap_rlSpreadsheetRow_exists}, - {0,0} -}; +static int _proxy__wrap_new_rlSpreadsheetRow(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSpreadsheetRow); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSpreadsheetRow_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlSpreadsheetRow_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSpreadsheetRow_methods[]= { + { "text", _wrap_rlSpreadsheetRow_text}, + { "setText", _wrap_rlSpreadsheetRow_setText}, + { "printf", _wrap_rlSpreadsheetRow_printf}, + { "clear", _wrap_rlSpreadsheetRow_clear}, + { "setNextRow", _wrap_rlSpreadsheetRow_setNextRow}, + { "getNextRow", _wrap_rlSpreadsheetRow_getNextRow}, + { "getFirstCell", _wrap_rlSpreadsheetRow_getFirstCell}, + { "readRow", _wrap_rlSpreadsheetRow_readRow}, + { "writeRow", _wrap_rlSpreadsheetRow_writeRow}, + { "exists", _wrap_rlSpreadsheetRow_exists}, + {0,0} }; -static swig_lua_method swig_rlSpreadsheetRow_cls_methods[] = { +static swig_lua_method swig_rlSpreadsheetRow_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSpreadsheetRow_cls_constants[] = { + +static swig_lua_attribute swig_rlSpreadsheetRow_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSpreadsheetRow_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSpreadsheetRow_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSpreadsheetRow_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSpreadsheetRow_Sf_SwigStatic = { + "rlSpreadsheetRow", + swig_rlSpreadsheetRow_Sf_SwigStatic_methods, + swig_rlSpreadsheetRow_Sf_SwigStatic_attributes, + swig_rlSpreadsheetRow_Sf_SwigStatic_constants, + swig_rlSpreadsheetRow_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSpreadsheetRow_bases[] = {0}; static const char *swig_rlSpreadsheetRow_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSpreadsheetRow = { "rlSpreadsheetRow", &SWIGTYPE_p_rlSpreadsheetRow,_wrap_new_rlSpreadsheetRow, swig_delete_rlSpreadsheetRow, swig_rlSpreadsheetRow_methods, swig_rlSpreadsheetRow_attributes, { "rlSpreadsheetRow", swig_rlSpreadsheetRow_cls_methods, swig_rlSpreadsheetRow_cls_attributes, swig_rlSpreadsheetRow_cls_constants }, swig_rlSpreadsheetRow_bases, swig_rlSpreadsheetRow_base_names }; +static swig_lua_class _wrap_class_rlSpreadsheetRow = { "rlSpreadsheetRow", "rlSpreadsheetRow", &SWIGTYPE_p_rlSpreadsheetRow,_proxy__wrap_new_rlSpreadsheetRow, swig_delete_rlSpreadsheetRow, swig_rlSpreadsheetRow_methods, swig_rlSpreadsheetRow_attributes, &swig_rlSpreadsheetRow_Sf_SwigStatic, swig_rlSpreadsheetRow_meta, swig_rlSpreadsheetRow_bases, swig_rlSpreadsheetRow_base_names }; static int _wrap_new_rlSpreadsheetTable__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -25571,35 +27373,59 @@ static void swig_delete_rlSpreadsheetTable(void *obj) { rlSpreadsheetTable *arg1 = (rlSpreadsheetTable *) obj; delete arg1; } -static swig_lua_method swig_rlSpreadsheetTable_methods[] = { - {"text", _wrap_rlSpreadsheetTable_text}, - {"setText", _wrap_rlSpreadsheetTable_setText}, - {"printf", _wrap_rlSpreadsheetTable_printf}, - {"clear", _wrap_rlSpreadsheetTable_clear}, - {"read", _wrap_rlSpreadsheetTable_read}, - {"write", _wrap_rlSpreadsheetTable_write}, - {"setNextTable", _wrap_rlSpreadsheetTable_setNextTable}, - {"getNextTable", _wrap_rlSpreadsheetTable_getNextTable}, - {"getFirstRow", _wrap_rlSpreadsheetTable_getFirstRow}, - {"exists", _wrap_rlSpreadsheetTable_exists}, - {"setDelimitor", _wrap_rlSpreadsheetTable_setDelimitor}, - {0,0} -}; +static int _proxy__wrap_new_rlSpreadsheetTable(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSpreadsheetTable); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSpreadsheetTable_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlSpreadsheetTable_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSpreadsheetTable_methods[]= { + { "text", _wrap_rlSpreadsheetTable_text}, + { "setText", _wrap_rlSpreadsheetTable_setText}, + { "printf", _wrap_rlSpreadsheetTable_printf}, + { "clear", _wrap_rlSpreadsheetTable_clear}, + { "read", _wrap_rlSpreadsheetTable_read}, + { "write", _wrap_rlSpreadsheetTable_write}, + { "setNextTable", _wrap_rlSpreadsheetTable_setNextTable}, + { "getNextTable", _wrap_rlSpreadsheetTable_getNextTable}, + { "getFirstRow", _wrap_rlSpreadsheetTable_getFirstRow}, + { "exists", _wrap_rlSpreadsheetTable_exists}, + { "setDelimitor", _wrap_rlSpreadsheetTable_setDelimitor}, + {0,0} }; -static swig_lua_method swig_rlSpreadsheetTable_cls_methods[] = { +static swig_lua_method swig_rlSpreadsheetTable_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSpreadsheetTable_cls_constants[] = { + +static swig_lua_attribute swig_rlSpreadsheetTable_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSpreadsheetTable_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSpreadsheetTable_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSpreadsheetTable_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSpreadsheetTable_Sf_SwigStatic = { + "rlSpreadsheetTable", + swig_rlSpreadsheetTable_Sf_SwigStatic_methods, + swig_rlSpreadsheetTable_Sf_SwigStatic_attributes, + swig_rlSpreadsheetTable_Sf_SwigStatic_constants, + swig_rlSpreadsheetTable_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSpreadsheetTable_bases[] = {0}; static const char *swig_rlSpreadsheetTable_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSpreadsheetTable = { "rlSpreadsheetTable", &SWIGTYPE_p_rlSpreadsheetTable,_wrap_new_rlSpreadsheetTable, swig_delete_rlSpreadsheetTable, swig_rlSpreadsheetTable_methods, swig_rlSpreadsheetTable_attributes, { "rlSpreadsheetTable", swig_rlSpreadsheetTable_cls_methods, swig_rlSpreadsheetTable_cls_attributes, swig_rlSpreadsheetTable_cls_constants }, swig_rlSpreadsheetTable_bases, swig_rlSpreadsheetTable_base_names }; +static swig_lua_class _wrap_class_rlSpreadsheetTable = { "rlSpreadsheetTable", "rlSpreadsheetTable", &SWIGTYPE_p_rlSpreadsheetTable,_proxy__wrap_new_rlSpreadsheetTable, swig_delete_rlSpreadsheetTable, swig_rlSpreadsheetTable_methods, swig_rlSpreadsheetTable_attributes, &swig_rlSpreadsheetTable_Sf_SwigStatic, swig_rlSpreadsheetTable_meta, swig_rlSpreadsheetTable_bases, swig_rlSpreadsheetTable_base_names }; static int _wrap_new_rlSpreadsheetWorkbook__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -25935,33 +27761,57 @@ static void swig_delete_rlSpreadsheetWorkbook(void *obj) { rlSpreadsheetWorkbook *arg1 = (rlSpreadsheetWorkbook *) obj; delete arg1; } -static swig_lua_method swig_rlSpreadsheetWorkbook_methods[] = { - {"text", _wrap_rlSpreadsheetWorkbook_text}, - {"setText", _wrap_rlSpreadsheetWorkbook_setText}, - {"printf", _wrap_rlSpreadsheetWorkbook_printf}, - {"clear", _wrap_rlSpreadsheetWorkbook_clear}, - {"read", _wrap_rlSpreadsheetWorkbook_read}, - {"write", _wrap_rlSpreadsheetWorkbook_write}, - {"exists", _wrap_rlSpreadsheetWorkbook_exists}, - {"getFirstTable", _wrap_rlSpreadsheetWorkbook_getFirstTable}, - {"setDelimitor", _wrap_rlSpreadsheetWorkbook_setDelimitor}, - {0,0} -}; +static int _proxy__wrap_new_rlSpreadsheetWorkbook(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSpreadsheetWorkbook); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSpreadsheetWorkbook_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlSpreadsheetWorkbook_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSpreadsheetWorkbook_methods[]= { + { "text", _wrap_rlSpreadsheetWorkbook_text}, + { "setText", _wrap_rlSpreadsheetWorkbook_setText}, + { "printf", _wrap_rlSpreadsheetWorkbook_printf}, + { "clear", _wrap_rlSpreadsheetWorkbook_clear}, + { "read", _wrap_rlSpreadsheetWorkbook_read}, + { "write", _wrap_rlSpreadsheetWorkbook_write}, + { "exists", _wrap_rlSpreadsheetWorkbook_exists}, + { "getFirstTable", _wrap_rlSpreadsheetWorkbook_getFirstTable}, + { "setDelimitor", _wrap_rlSpreadsheetWorkbook_setDelimitor}, + {0,0} }; -static swig_lua_method swig_rlSpreadsheetWorkbook_cls_methods[] = { +static swig_lua_method swig_rlSpreadsheetWorkbook_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSpreadsheetWorkbook_cls_constants[] = { + +static swig_lua_attribute swig_rlSpreadsheetWorkbook_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSpreadsheetWorkbook_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSpreadsheetWorkbook_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSpreadsheetWorkbook_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSpreadsheetWorkbook_Sf_SwigStatic = { + "rlSpreadsheetWorkbook", + swig_rlSpreadsheetWorkbook_Sf_SwigStatic_methods, + swig_rlSpreadsheetWorkbook_Sf_SwigStatic_attributes, + swig_rlSpreadsheetWorkbook_Sf_SwigStatic_constants, + swig_rlSpreadsheetWorkbook_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSpreadsheetWorkbook_bases[] = {0}; static const char *swig_rlSpreadsheetWorkbook_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSpreadsheetWorkbook = { "rlSpreadsheetWorkbook", &SWIGTYPE_p_rlSpreadsheetWorkbook,_wrap_new_rlSpreadsheetWorkbook, swig_delete_rlSpreadsheetWorkbook, swig_rlSpreadsheetWorkbook_methods, swig_rlSpreadsheetWorkbook_attributes, { "rlSpreadsheetWorkbook", swig_rlSpreadsheetWorkbook_cls_methods, swig_rlSpreadsheetWorkbook_cls_attributes, swig_rlSpreadsheetWorkbook_cls_constants }, swig_rlSpreadsheetWorkbook_bases, swig_rlSpreadsheetWorkbook_base_names }; +static swig_lua_class _wrap_class_rlSpreadsheetWorkbook = { "rlSpreadsheetWorkbook", "rlSpreadsheetWorkbook", &SWIGTYPE_p_rlSpreadsheetWorkbook,_proxy__wrap_new_rlSpreadsheetWorkbook, swig_delete_rlSpreadsheetWorkbook, swig_rlSpreadsheetWorkbook_methods, swig_rlSpreadsheetWorkbook_attributes, &swig_rlSpreadsheetWorkbook_Sf_SwigStatic, swig_rlSpreadsheetWorkbook_meta, swig_rlSpreadsheetWorkbook_bases, swig_rlSpreadsheetWorkbook_base_names }; static int _wrap_rlCRLF_get(lua_State* L) { int SWIG_arg = 0; @@ -26065,6 +27915,30 @@ static int _wrap_new_rlString__SWIG_3(lua_State* L) { } +static int _wrap_new_rlString__SWIG_4(lua_State* L) { + int SWIG_arg = 0; + rlString *arg1 = 0 ; + rlString *result = 0 ; + + SWIG_check_num_args("rlString::rlString",1,1) + if(!lua_isuserdata(L,1)) SWIG_fail_arg("rlString::rlString",1,"rlString const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlString,0))){ + SWIG_fail_ptr("new_rlString",1,SWIGTYPE_p_rlString); + } + + result = (rlString *)new rlString((rlString const &)*arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_rlString,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_new_rlString(lua_State* L) { int argc; int argv[2]={ @@ -26103,6 +27977,20 @@ static int _wrap_new_rlString(lua_State* L) { return _wrap_new_rlString__SWIG_3(L); } } + if (argc == 1) { + int _v; + { + void *ptr; + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_rlString, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + return _wrap_new_rlString__SWIG_4(L); + } + } if (argc == 1) { int _v; { @@ -26118,7 +28006,8 @@ static int _wrap_new_rlString(lua_State* L) { " rlString::rlString(char const *)\n" " rlString::rlString()\n" " rlString::rlString(rlString &)\n" - " rlString::rlString(rlString *)\n"); + " rlString::rlString(rlString *)\n" + " rlString::rlString(rlString const &)\n"); lua_error(L);return 0; } @@ -26298,6 +28187,37 @@ static int _wrap_rlString___eq__SWIG_1(lua_State* L) { } +static int _wrap_rlString___eq__SWIG_2(lua_State* L) { + int SWIG_arg = 0; + rlString *arg1 = (rlString *) 0 ; + rlString *arg2 = 0 ; + int result; + + SWIG_check_num_args("rlString::operator ==",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlString::operator ==",1,"rlString *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("rlString::operator ==",2,"rlString const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlString,0))){ + SWIG_fail_ptr("rlString___eq",1,SWIGTYPE_p_rlString); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_rlString,0))){ + SWIG_fail_ptr("rlString___eq",2,SWIGTYPE_p_rlString); + } + + result = (int)(arg1)->operator ==((rlString const &)*arg2); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_rlString___eq(lua_State* L) { int argc; int argv[3]={ @@ -26329,6 +28249,30 @@ static int _wrap_rlString___eq(lua_State* L) { } } } + if (argc == 2) { + int _v; + { + void *ptr; + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_rlString, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + void *ptr; + if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_rlString, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + return _wrap_rlString___eq__SWIG_2(L); + } + } + } if (argc == 2) { int _v; { @@ -26352,12 +28296,13 @@ static int _wrap_rlString___eq(lua_State* L) { SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'rlString___eq'\n" " Possible C/C++ prototypes are:\n" " rlString::operator ==(char const *)\n" - " rlString::operator ==(rlString &)\n"); + " rlString::operator ==(rlString &)\n" + " rlString::operator ==(rlString const &)\n"); lua_error(L);return 0; } -static int _wrap_rlString_text(lua_State* L) { +static int _wrap_rlString_text__SWIG_0(lua_State* L) { int SWIG_arg = 0; rlString *arg1 = (rlString *) 0 ; char *result = 0 ; @@ -26381,6 +28326,74 @@ static int _wrap_rlString_text(lua_State* L) { } +static int _wrap_rlString_text__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + rlString *arg1 = (rlString *) 0 ; + char *result = 0 ; + + SWIG_check_num_args("rlString::text",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlString::text",1,"rlString const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlString,0))){ + SWIG_fail_ptr("rlString_text",1,SWIGTYPE_p_rlString); + } + + result = (char *)((rlString const *)arg1)->text(); + lua_pushstring(L,(const char *)result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_rlString_text(lua_State* L) { + int argc; + int argv[2]={ + 1,2 + }; + + argc = lua_gettop(L); + if (argc == 1) { + int _v; + { + void *ptr; + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_rlString, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + return _wrap_rlString_text__SWIG_0(L); + } + } + if (argc == 1) { + int _v; + { + void *ptr; + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_rlString, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + return _wrap_rlString_text__SWIG_1(L); + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'rlString_text'\n" + " Possible C/C++ prototypes are:\n" + " rlString::text()\n" + " rlString::text() const\n"); + lua_error(L);return 0; +} + + static int _wrap_rlString_setText(lua_State* L) { int SWIG_arg = 0; rlString *arg1 = (rlString *) 0 ; @@ -26933,45 +28946,71 @@ static void swig_delete_rlString(void *obj) { rlString *arg1 = (rlString *) obj; delete arg1; } -static swig_lua_method swig_rlString_methods[] = { - {"__add", _wrap_rlString___add}, - {"__eq", _wrap_rlString___eq}, - {"text", _wrap_rlString_text}, - {"setText", _wrap_rlString_setText}, - {"printf", _wrap_rlString_printf}, - {"strcpy", _wrap_rlString_strcpy}, - {"cat", _wrap_rlString_cat}, - {"upper", _wrap_rlString_upper}, - {"lower", _wrap_rlString_lower}, - {"startsWith", _wrap_rlString_startsWith}, - {"strnocasecmp", _wrap_rlString_strnocasecmp}, - {"strnnocasecmp", _wrap_rlString_strnnocasecmp}, - {"strstr", _wrap_rlString_strstr}, - {"strchr", _wrap_rlString_strchr}, - {"strrchr", _wrap_rlString_strrchr}, - {"removeQuotas", _wrap_rlString_removeQuotas}, - {"removeNewline", _wrap_rlString_removeNewline}, - {"read", _wrap_rlString_read}, - {"write", _wrap_rlString_write}, - {"toFilename", _wrap_rlString_toFilename}, - {"toDirname", _wrap_rlString_toDirname}, - {0,0} -}; +static int _proxy__wrap_new_rlString(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlString); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlString_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_rlString_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlString_methods[]= { + { "__add", _wrap_rlString___add}, + { "__eq", _wrap_rlString___eq}, + { "text", _wrap_rlString_text}, + { "setText", _wrap_rlString_setText}, + { "printf", _wrap_rlString_printf}, + { "strcpy", _wrap_rlString_strcpy}, + { "cat", _wrap_rlString_cat}, + { "upper", _wrap_rlString_upper}, + { "lower", _wrap_rlString_lower}, + { "startsWith", _wrap_rlString_startsWith}, + { "strnocasecmp", _wrap_rlString_strnocasecmp}, + { "strnnocasecmp", _wrap_rlString_strnnocasecmp}, + { "strstr", _wrap_rlString_strstr}, + { "strchr", _wrap_rlString_strchr}, + { "strrchr", _wrap_rlString_strrchr}, + { "removeQuotas", _wrap_rlString_removeQuotas}, + { "removeNewline", _wrap_rlString_removeNewline}, + { "read", _wrap_rlString_read}, + { "write", _wrap_rlString_write}, + { "toFilename", _wrap_rlString_toFilename}, + { "toDirname", _wrap_rlString_toDirname}, + {0,0} }; -static swig_lua_method swig_rlString_cls_methods[] = { +static swig_lua_method swig_rlString_meta[] = { + { "__add", _wrap_rlString___add}, + { "__eq", _wrap_rlString___eq}, {0,0} }; -static swig_lua_const_info swig_rlString_cls_constants[] = { + +static swig_lua_attribute swig_rlString_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlString_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlString_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlString_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlString_Sf_SwigStatic = { + "rlString", + swig_rlString_Sf_SwigStatic_methods, + swig_rlString_Sf_SwigStatic_attributes, + swig_rlString_Sf_SwigStatic_constants, + swig_rlString_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlString_bases[] = {0}; static const char *swig_rlString_base_names[] = {0}; -static swig_lua_class _wrap_class_rlString = { "rlString", &SWIGTYPE_p_rlString,_wrap_new_rlString, swig_delete_rlString, swig_rlString_methods, swig_rlString_attributes, { "rlString", swig_rlString_cls_methods, swig_rlString_cls_attributes, swig_rlString_cls_constants }, swig_rlString_bases, swig_rlString_base_names }; +static swig_lua_class _wrap_class_rlString = { "rlString", "rlString", &SWIGTYPE_p_rlString,_proxy__wrap_new_rlString, swig_delete_rlString, swig_rlString_methods, swig_rlString_attributes, &swig_rlString_Sf_SwigStatic, swig_rlString_meta, swig_rlString_bases, swig_rlString_base_names }; static int _wrap_new_rlSvgPosition__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -27613,37 +29652,61 @@ static void swig_delete_rlSvgPosition(void *obj) { rlSvgPosition *arg1 = (rlSvgPosition *) obj; delete arg1; } -static swig_lua_method swig_rlSvgPosition_methods[] = { - {"setInit", _wrap_rlSvgPosition_setInit}, - {"move", _wrap_rlSvgPosition_move}, - {"moveRelative", _wrap_rlSvgPosition_moveRelative}, - {"scale", _wrap_rlSvgPosition_scale}, - {"scaleRelative", _wrap_rlSvgPosition_scaleRelative}, - {"rotate", _wrap_rlSvgPosition_rotate}, - {0,0} -}; +static int _proxy__wrap_new_rlSvgPosition(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSvgPosition); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSvgPosition_attributes[] = { - { "sx", _wrap_rlSvgPosition_sx_get, _wrap_rlSvgPosition_sx_set}, - { "alpha", _wrap_rlSvgPosition_alpha_get, _wrap_rlSvgPosition_alpha_set}, - { "x0", _wrap_rlSvgPosition_x0_get, _wrap_rlSvgPosition_x0_set}, - { "y0", _wrap_rlSvgPosition_y0_get, _wrap_rlSvgPosition_y0_set}, - { "cx", _wrap_rlSvgPosition_cx_get, _wrap_rlSvgPosition_cx_set}, - { "cy", _wrap_rlSvgPosition_cy_get, _wrap_rlSvgPosition_cy_set}, - { "init", _wrap_rlSvgPosition_init_get, _wrap_rlSvgPosition_init_set}, + { "sx", _wrap_rlSvgPosition_sx_get, _wrap_rlSvgPosition_sx_set }, + { "alpha", _wrap_rlSvgPosition_alpha_get, _wrap_rlSvgPosition_alpha_set }, + { "x0", _wrap_rlSvgPosition_x0_get, _wrap_rlSvgPosition_x0_set }, + { "y0", _wrap_rlSvgPosition_y0_get, _wrap_rlSvgPosition_y0_set }, + { "cx", _wrap_rlSvgPosition_cx_get, _wrap_rlSvgPosition_cx_set }, + { "cy", _wrap_rlSvgPosition_cy_get, _wrap_rlSvgPosition_cy_set }, + { "init", _wrap_rlSvgPosition_init_get, _wrap_rlSvgPosition_init_set }, {0,0,0} }; -static swig_lua_attribute swig_rlSvgPosition_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSvgPosition_methods[]= { + { "setInit", _wrap_rlSvgPosition_setInit}, + { "move", _wrap_rlSvgPosition_move}, + { "moveRelative", _wrap_rlSvgPosition_moveRelative}, + { "scale", _wrap_rlSvgPosition_scale}, + { "scaleRelative", _wrap_rlSvgPosition_scaleRelative}, + { "rotate", _wrap_rlSvgPosition_rotate}, + {0,0} }; -static swig_lua_method swig_rlSvgPosition_cls_methods[] = { +static swig_lua_method swig_rlSvgPosition_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSvgPosition_cls_constants[] = { + +static swig_lua_attribute swig_rlSvgPosition_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSvgPosition_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSvgPosition_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSvgPosition_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSvgPosition_Sf_SwigStatic = { + "rlSvgPosition", + swig_rlSvgPosition_Sf_SwigStatic_methods, + swig_rlSvgPosition_Sf_SwigStatic_attributes, + swig_rlSvgPosition_Sf_SwigStatic_constants, + swig_rlSvgPosition_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSvgPosition_bases[] = {0}; static const char *swig_rlSvgPosition_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSvgPosition = { "rlSvgPosition", &SWIGTYPE_p_rlSvgPosition,_wrap_new_rlSvgPosition, swig_delete_rlSvgPosition, swig_rlSvgPosition_methods, swig_rlSvgPosition_attributes, { "rlSvgPosition", swig_rlSvgPosition_cls_methods, swig_rlSvgPosition_cls_attributes, swig_rlSvgPosition_cls_constants }, swig_rlSvgPosition_bases, swig_rlSvgPosition_base_names }; +static swig_lua_class _wrap_class_rlSvgPosition = { "rlSvgPosition", "rlSvgPosition", &SWIGTYPE_p_rlSvgPosition,_proxy__wrap_new_rlSvgPosition, swig_delete_rlSvgPosition, swig_rlSvgPosition_methods, swig_rlSvgPosition_attributes, &swig_rlSvgPosition_Sf_SwigStatic, swig_rlSvgPosition_meta, swig_rlSvgPosition_bases, swig_rlSvgPosition_base_names }; static int _wrap_new_rlSvgAnimator(lua_State* L) { int SWIG_arg = 0; @@ -29002,62 +31065,86 @@ static void swig_delete_rlSvgAnimator(void *obj) { rlSvgAnimator *arg1 = (rlSvgAnimator *) obj; delete arg1; } -static swig_lua_method swig_rlSvgAnimator_methods[] = { - {"setSocket", _wrap_rlSvgAnimator_setSocket}, - {"setId", _wrap_rlSvgAnimator_setId}, - {"read", _wrap_rlSvgAnimator_read}, - {"writeSocket", _wrap_rlSvgAnimator_writeSocket}, - {"svgPrintf", _wrap_rlSvgAnimator_svgPrintf}, - {"svgRecursivePrintf", _wrap_rlSvgAnimator_svgRecursivePrintf}, - {"svgSearchAndReplace", _wrap_rlSvgAnimator_svgSearchAndReplace}, - {"svgRecursiveSearchAndReplace", _wrap_rlSvgAnimator_svgRecursiveSearchAndReplace}, - {"svgTextPrintf", _wrap_rlSvgAnimator_svgTextPrintf}, - {"svgRemoveStyleOption", _wrap_rlSvgAnimator_svgRemoveStyleOption}, - {"svgRecursiveRemoveStyleOption", _wrap_rlSvgAnimator_svgRecursiveRemoveStyleOption}, - {"svgChangeStyleOption", _wrap_rlSvgAnimator_svgChangeStyleOption}, - {"svgRecursiveChangeStyleOption", _wrap_rlSvgAnimator_svgRecursiveChangeStyleOption}, - {"svgSetStyleOption", _wrap_rlSvgAnimator_svgSetStyleOption}, - {"svgRecursiveSetStyleOption", _wrap_rlSvgAnimator_svgRecursiveSetStyleOption}, - {"show", _wrap_rlSvgAnimator_show}, - {"setMatrix", _wrap_rlSvgAnimator_setMatrix}, - {"setMainObject", _wrap_rlSvgAnimator_setMainObject}, - {"mainObject", _wrap_rlSvgAnimator_mainObject}, - {"setXY0", _wrap_rlSvgAnimator_setXY0}, - {"x0", _wrap_rlSvgAnimator_x0}, - {"y0", _wrap_rlSvgAnimator_y0}, - {"setMouseXY0", _wrap_rlSvgAnimator_setMouseXY0}, - {"mouseX0", _wrap_rlSvgAnimator_mouseX0}, - {"mouseY0", _wrap_rlSvgAnimator_mouseY0}, - {"setMouseXY1", _wrap_rlSvgAnimator_setMouseXY1}, - {"mouseX1", _wrap_rlSvgAnimator_mouseX1}, - {"mouseY1", _wrap_rlSvgAnimator_mouseY1}, - {"setScale", _wrap_rlSvgAnimator_setScale}, - {"scale", _wrap_rlSvgAnimator_scale}, - {"zoomCenter", _wrap_rlSvgAnimator_zoomCenter}, - {"zoomRect", _wrap_rlSvgAnimator_zoomRect}, - {"setMainObjectMatrix", _wrap_rlSvgAnimator_setMainObjectMatrix}, - {"setWindowSize", _wrap_rlSvgAnimator_setWindowSize}, - {"windowWidth", _wrap_rlSvgAnimator_windowWidth}, - {"windowHeight", _wrap_rlSvgAnimator_windowHeight}, - {"moveMainObject", _wrap_rlSvgAnimator_moveMainObject}, - {0,0} -}; +static int _proxy__wrap_new_rlSvgAnimator(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSvgAnimator); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlSvgAnimator_attributes[] = { - { "isModified", _wrap_rlSvgAnimator_isModified_get, _wrap_rlSvgAnimator_isModified_set}, + { "isModified", _wrap_rlSvgAnimator_isModified_get, _wrap_rlSvgAnimator_isModified_set }, {0,0,0} }; -static swig_lua_attribute swig_rlSvgAnimator_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlSvgAnimator_methods[]= { + { "setSocket", _wrap_rlSvgAnimator_setSocket}, + { "setId", _wrap_rlSvgAnimator_setId}, + { "read", _wrap_rlSvgAnimator_read}, + { "writeSocket", _wrap_rlSvgAnimator_writeSocket}, + { "svgPrintf", _wrap_rlSvgAnimator_svgPrintf}, + { "svgRecursivePrintf", _wrap_rlSvgAnimator_svgRecursivePrintf}, + { "svgSearchAndReplace", _wrap_rlSvgAnimator_svgSearchAndReplace}, + { "svgRecursiveSearchAndReplace", _wrap_rlSvgAnimator_svgRecursiveSearchAndReplace}, + { "svgTextPrintf", _wrap_rlSvgAnimator_svgTextPrintf}, + { "svgRemoveStyleOption", _wrap_rlSvgAnimator_svgRemoveStyleOption}, + { "svgRecursiveRemoveStyleOption", _wrap_rlSvgAnimator_svgRecursiveRemoveStyleOption}, + { "svgChangeStyleOption", _wrap_rlSvgAnimator_svgChangeStyleOption}, + { "svgRecursiveChangeStyleOption", _wrap_rlSvgAnimator_svgRecursiveChangeStyleOption}, + { "svgSetStyleOption", _wrap_rlSvgAnimator_svgSetStyleOption}, + { "svgRecursiveSetStyleOption", _wrap_rlSvgAnimator_svgRecursiveSetStyleOption}, + { "show", _wrap_rlSvgAnimator_show}, + { "setMatrix", _wrap_rlSvgAnimator_setMatrix}, + { "setMainObject", _wrap_rlSvgAnimator_setMainObject}, + { "mainObject", _wrap_rlSvgAnimator_mainObject}, + { "setXY0", _wrap_rlSvgAnimator_setXY0}, + { "x0", _wrap_rlSvgAnimator_x0}, + { "y0", _wrap_rlSvgAnimator_y0}, + { "setMouseXY0", _wrap_rlSvgAnimator_setMouseXY0}, + { "mouseX0", _wrap_rlSvgAnimator_mouseX0}, + { "mouseY0", _wrap_rlSvgAnimator_mouseY0}, + { "setMouseXY1", _wrap_rlSvgAnimator_setMouseXY1}, + { "mouseX1", _wrap_rlSvgAnimator_mouseX1}, + { "mouseY1", _wrap_rlSvgAnimator_mouseY1}, + { "setScale", _wrap_rlSvgAnimator_setScale}, + { "scale", _wrap_rlSvgAnimator_scale}, + { "zoomCenter", _wrap_rlSvgAnimator_zoomCenter}, + { "zoomRect", _wrap_rlSvgAnimator_zoomRect}, + { "setMainObjectMatrix", _wrap_rlSvgAnimator_setMainObjectMatrix}, + { "setWindowSize", _wrap_rlSvgAnimator_setWindowSize}, + { "windowWidth", _wrap_rlSvgAnimator_windowWidth}, + { "windowHeight", _wrap_rlSvgAnimator_windowHeight}, + { "moveMainObject", _wrap_rlSvgAnimator_moveMainObject}, + {0,0} }; -static swig_lua_method swig_rlSvgAnimator_cls_methods[] = { +static swig_lua_method swig_rlSvgAnimator_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlSvgAnimator_cls_constants[] = { + +static swig_lua_attribute swig_rlSvgAnimator_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlSvgAnimator_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlSvgAnimator_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlSvgAnimator_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSvgAnimator_Sf_SwigStatic = { + "rlSvgAnimator", + swig_rlSvgAnimator_Sf_SwigStatic_methods, + swig_rlSvgAnimator_Sf_SwigStatic_attributes, + swig_rlSvgAnimator_Sf_SwigStatic_constants, + swig_rlSvgAnimator_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlSvgAnimator_bases[] = {0}; static const char *swig_rlSvgAnimator_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSvgAnimator = { "rlSvgAnimator", &SWIGTYPE_p_rlSvgAnimator,_wrap_new_rlSvgAnimator, swig_delete_rlSvgAnimator, swig_rlSvgAnimator_methods, swig_rlSvgAnimator_attributes, { "rlSvgAnimator", swig_rlSvgAnimator_cls_methods, swig_rlSvgAnimator_cls_attributes, swig_rlSvgAnimator_cls_constants }, swig_rlSvgAnimator_bases, swig_rlSvgAnimator_base_names }; +static swig_lua_class _wrap_class_rlSvgAnimator = { "rlSvgAnimator", "rlSvgAnimator", &SWIGTYPE_p_rlSvgAnimator,_proxy__wrap_new_rlSvgAnimator, swig_delete_rlSvgAnimator, swig_rlSvgAnimator_methods, swig_rlSvgAnimator_attributes, &swig_rlSvgAnimator_Sf_SwigStatic, swig_rlSvgAnimator_meta, swig_rlSvgAnimator_bases, swig_rlSvgAnimator_base_names }; static int _wrap_new_rlSvgCat(lua_State* L) { int SWIG_arg = 0; @@ -29121,1190 +31208,7 @@ static int _wrap_rlSvgCat_open__SWIG_1(lua_State* L) { } arg2 = (char *)lua_tostring(L, 2); - result = (int)(arg1)->open((char const *)arg2); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlSvgCat_open(lua_State* L) { - int argc; - int argv[4]={ - 1,2,3,4 - }; - - argc = lua_gettop(L); - if (argc == 2) { - int _v; - { - void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_rlSvgCat, 0)) { - _v = 0; - } else { - _v = 1; - } - } - if (_v) { - { - _v = SWIG_lua_isnilstring(L,argv[1]); - } - if (_v) { - return _wrap_rlSvgCat_open__SWIG_1(L); - } - } - } - if (argc == 3) { - int _v; - { - void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_rlSvgCat, 0)) { - _v = 0; - } else { - _v = 1; - } - } - if (_v) { - { - _v = SWIG_lua_isnilstring(L,argv[1]); - } - if (_v) { - { - _v = SWIG_lua_isnilstring(L,argv[2]); - } - if (_v) { - return _wrap_rlSvgCat_open__SWIG_0(L); - } - } - } - } - - SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'rlSvgCat_open'\n" - " Possible C/C++ prototypes are:\n" - " rlSvgCat::open(char const *,char const *)\n" - " rlSvgCat::open(char const *)\n"); - lua_error(L);return 0; -} - - -static int _wrap_rlSvgCat_reopenSocket(lua_State* L) { - int SWIG_arg = 0; - rlSvgCat *arg1 = (rlSvgCat *) 0 ; - char *arg2 = (char *) 0 ; - int arg3 ; - int result; - - SWIG_check_num_args("rlSvgCat::reopenSocket",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlSvgCat::reopenSocket",1,"rlSvgCat *"); - if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("rlSvgCat::reopenSocket",2,"char const *"); - if(!lua_isnumber(L,3)) SWIG_fail_arg("rlSvgCat::reopenSocket",3,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlSvgCat,0))){ - SWIG_fail_ptr("rlSvgCat_reopenSocket",1,SWIGTYPE_p_rlSvgCat); - } - - arg2 = (char *)lua_tostring(L, 2); - arg3 = (int)lua_tonumber(L, 3); - result = (int)(arg1)->reopenSocket((char const *)arg2,arg3); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlSvgCat_cat(lua_State* L) { - int SWIG_arg = 0; - rlSvgCat *arg1 = (rlSvgCat *) 0 ; - - SWIG_check_num_args("rlSvgCat::cat",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlSvgCat::cat",1,"rlSvgCat *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlSvgCat,0))){ - SWIG_fail_ptr("rlSvgCat_cat",1,SWIGTYPE_p_rlSvgCat); - } - - (arg1)->cat(); - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlSvgCat_close(lua_State* L) { - int SWIG_arg = 0; - rlSvgCat *arg1 = (rlSvgCat *) 0 ; - - SWIG_check_num_args("rlSvgCat::close",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlSvgCat::close",1,"rlSvgCat *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlSvgCat,0))){ - SWIG_fail_ptr("rlSvgCat_close",1,SWIGTYPE_p_rlSvgCat); - } - - (arg1)->close(); - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static void swig_delete_rlSvgCat(void *obj) { -rlSvgCat *arg1 = (rlSvgCat *) obj; -delete arg1; -} -static swig_lua_method swig_rlSvgCat_methods[] = { - {"open", _wrap_rlSvgCat_open}, - {"reopenSocket", _wrap_rlSvgCat_reopenSocket}, - {"cat", _wrap_rlSvgCat_cat}, - {"close", _wrap_rlSvgCat_close}, - {0,0} -}; -static swig_lua_attribute swig_rlSvgCat_attributes[] = { - {0,0,0} -}; -static swig_lua_attribute swig_rlSvgCat_cls_attributes[] = { - {0,0,0} -}; -static swig_lua_method swig_rlSvgCat_cls_methods[] = { - {0,0} -}; -static swig_lua_const_info swig_rlSvgCat_cls_constants[] = { - {0,0,0,0,0,0} -}; -static swig_lua_class *swig_rlSvgCat_bases[] = {0}; -static const char *swig_rlSvgCat_base_names[] = {0}; -static swig_lua_class _wrap_class_rlSvgCat = { "rlSvgCat", &SWIGTYPE_p_rlSvgCat,_wrap_new_rlSvgCat, swig_delete_rlSvgCat, swig_rlSvgCat_methods, swig_rlSvgCat_attributes, { "rlSvgCat", swig_rlSvgCat_cls_methods, swig_rlSvgCat_cls_attributes, swig_rlSvgCat_cls_constants }, swig_rlSvgCat_bases, swig_rlSvgCat_base_names }; - -static int _wrap_new_rlTime__SWIG_0(lua_State* L) { - int SWIG_arg = 0; - int arg1 ; - int arg2 ; - int arg3 ; - int arg4 ; - int arg5 ; - int arg6 ; - int arg7 ; - rlTime *result = 0 ; - - SWIG_check_num_args("rlTime::rlTime",7,7) - if(!lua_isnumber(L,1)) SWIG_fail_arg("rlTime::rlTime",1,"int"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::rlTime",2,"int"); - if(!lua_isnumber(L,3)) SWIG_fail_arg("rlTime::rlTime",3,"int"); - if(!lua_isnumber(L,4)) SWIG_fail_arg("rlTime::rlTime",4,"int"); - if(!lua_isnumber(L,5)) SWIG_fail_arg("rlTime::rlTime",5,"int"); - if(!lua_isnumber(L,6)) SWIG_fail_arg("rlTime::rlTime",6,"int"); - if(!lua_isnumber(L,7)) SWIG_fail_arg("rlTime::rlTime",7,"int"); - arg1 = (int)lua_tonumber(L, 1); - arg2 = (int)lua_tonumber(L, 2); - arg3 = (int)lua_tonumber(L, 3); - arg4 = (int)lua_tonumber(L, 4); - arg5 = (int)lua_tonumber(L, 5); - arg6 = (int)lua_tonumber(L, 6); - arg7 = (int)lua_tonumber(L, 7); - result = (rlTime *)new rlTime(arg1,arg2,arg3,arg4,arg5,arg6,arg7); - SWIG_NewPointerObj(L,result,SWIGTYPE_p_rlTime,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_rlTime__SWIG_1(lua_State* L) { - int SWIG_arg = 0; - int arg1 ; - int arg2 ; - int arg3 ; - int arg4 ; - int arg5 ; - int arg6 ; - rlTime *result = 0 ; - - SWIG_check_num_args("rlTime::rlTime",6,6) - if(!lua_isnumber(L,1)) SWIG_fail_arg("rlTime::rlTime",1,"int"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::rlTime",2,"int"); - if(!lua_isnumber(L,3)) SWIG_fail_arg("rlTime::rlTime",3,"int"); - if(!lua_isnumber(L,4)) SWIG_fail_arg("rlTime::rlTime",4,"int"); - if(!lua_isnumber(L,5)) SWIG_fail_arg("rlTime::rlTime",5,"int"); - if(!lua_isnumber(L,6)) SWIG_fail_arg("rlTime::rlTime",6,"int"); - arg1 = (int)lua_tonumber(L, 1); - arg2 = (int)lua_tonumber(L, 2); - arg3 = (int)lua_tonumber(L, 3); - arg4 = (int)lua_tonumber(L, 4); - arg5 = (int)lua_tonumber(L, 5); - arg6 = (int)lua_tonumber(L, 6); - result = (rlTime *)new rlTime(arg1,arg2,arg3,arg4,arg5,arg6); - SWIG_NewPointerObj(L,result,SWIGTYPE_p_rlTime,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_rlTime__SWIG_2(lua_State* L) { - int SWIG_arg = 0; - int arg1 ; - int arg2 ; - int arg3 ; - int arg4 ; - int arg5 ; - rlTime *result = 0 ; - - SWIG_check_num_args("rlTime::rlTime",5,5) - if(!lua_isnumber(L,1)) SWIG_fail_arg("rlTime::rlTime",1,"int"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::rlTime",2,"int"); - if(!lua_isnumber(L,3)) SWIG_fail_arg("rlTime::rlTime",3,"int"); - if(!lua_isnumber(L,4)) SWIG_fail_arg("rlTime::rlTime",4,"int"); - if(!lua_isnumber(L,5)) SWIG_fail_arg("rlTime::rlTime",5,"int"); - arg1 = (int)lua_tonumber(L, 1); - arg2 = (int)lua_tonumber(L, 2); - arg3 = (int)lua_tonumber(L, 3); - arg4 = (int)lua_tonumber(L, 4); - arg5 = (int)lua_tonumber(L, 5); - result = (rlTime *)new rlTime(arg1,arg2,arg3,arg4,arg5); - SWIG_NewPointerObj(L,result,SWIGTYPE_p_rlTime,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_rlTime__SWIG_3(lua_State* L) { - int SWIG_arg = 0; - int arg1 ; - int arg2 ; - int arg3 ; - int arg4 ; - rlTime *result = 0 ; - - SWIG_check_num_args("rlTime::rlTime",4,4) - if(!lua_isnumber(L,1)) SWIG_fail_arg("rlTime::rlTime",1,"int"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::rlTime",2,"int"); - if(!lua_isnumber(L,3)) SWIG_fail_arg("rlTime::rlTime",3,"int"); - if(!lua_isnumber(L,4)) SWIG_fail_arg("rlTime::rlTime",4,"int"); - arg1 = (int)lua_tonumber(L, 1); - arg2 = (int)lua_tonumber(L, 2); - arg3 = (int)lua_tonumber(L, 3); - arg4 = (int)lua_tonumber(L, 4); - result = (rlTime *)new rlTime(arg1,arg2,arg3,arg4); - SWIG_NewPointerObj(L,result,SWIGTYPE_p_rlTime,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_rlTime__SWIG_4(lua_State* L) { - int SWIG_arg = 0; - int arg1 ; - int arg2 ; - int arg3 ; - rlTime *result = 0 ; - - SWIG_check_num_args("rlTime::rlTime",3,3) - if(!lua_isnumber(L,1)) SWIG_fail_arg("rlTime::rlTime",1,"int"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::rlTime",2,"int"); - if(!lua_isnumber(L,3)) SWIG_fail_arg("rlTime::rlTime",3,"int"); - arg1 = (int)lua_tonumber(L, 1); - arg2 = (int)lua_tonumber(L, 2); - arg3 = (int)lua_tonumber(L, 3); - result = (rlTime *)new rlTime(arg1,arg2,arg3); - SWIG_NewPointerObj(L,result,SWIGTYPE_p_rlTime,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_rlTime__SWIG_5(lua_State* L) { - int SWIG_arg = 0; - int arg1 ; - int arg2 ; - rlTime *result = 0 ; - - SWIG_check_num_args("rlTime::rlTime",2,2) - if(!lua_isnumber(L,1)) SWIG_fail_arg("rlTime::rlTime",1,"int"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::rlTime",2,"int"); - arg1 = (int)lua_tonumber(L, 1); - arg2 = (int)lua_tonumber(L, 2); - result = (rlTime *)new rlTime(arg1,arg2); - SWIG_NewPointerObj(L,result,SWIGTYPE_p_rlTime,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_rlTime__SWIG_6(lua_State* L) { - int SWIG_arg = 0; - int arg1 ; - rlTime *result = 0 ; - - SWIG_check_num_args("rlTime::rlTime",1,1) - if(!lua_isnumber(L,1)) SWIG_fail_arg("rlTime::rlTime",1,"int"); - arg1 = (int)lua_tonumber(L, 1); - result = (rlTime *)new rlTime(arg1); - SWIG_NewPointerObj(L,result,SWIGTYPE_p_rlTime,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_rlTime__SWIG_7(lua_State* L) { - int SWIG_arg = 0; - rlTime *result = 0 ; - - SWIG_check_num_args("rlTime::rlTime",0,0) - result = (rlTime *)new rlTime(); - SWIG_NewPointerObj(L,result,SWIGTYPE_p_rlTime,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_rlTime(lua_State* L) { - int argc; - int argv[8]={ - 1,2,3,4,5,6,7,8 - }; - - argc = lua_gettop(L); - if (argc == 0) { - return _wrap_new_rlTime__SWIG_7(L); - } - if (argc == 1) { - int _v; - { - _v = lua_isnumber(L,argv[0]); - } - if (_v) { - return _wrap_new_rlTime__SWIG_6(L); - } - } - if (argc == 2) { - int _v; - { - _v = lua_isnumber(L,argv[0]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[1]); - } - if (_v) { - return _wrap_new_rlTime__SWIG_5(L); - } - } - } - if (argc == 3) { - int _v; - { - _v = lua_isnumber(L,argv[0]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[1]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[2]); - } - if (_v) { - return _wrap_new_rlTime__SWIG_4(L); - } - } - } - } - if (argc == 4) { - int _v; - { - _v = lua_isnumber(L,argv[0]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[1]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[2]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[3]); - } - if (_v) { - return _wrap_new_rlTime__SWIG_3(L); - } - } - } - } - } - if (argc == 5) { - int _v; - { - _v = lua_isnumber(L,argv[0]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[1]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[2]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[3]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[4]); - } - if (_v) { - return _wrap_new_rlTime__SWIG_2(L); - } - } - } - } - } - } - if (argc == 6) { - int _v; - { - _v = lua_isnumber(L,argv[0]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[1]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[2]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[3]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[4]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[5]); - } - if (_v) { - return _wrap_new_rlTime__SWIG_1(L); - } - } - } - } - } - } - } - if (argc == 7) { - int _v; - { - _v = lua_isnumber(L,argv[0]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[1]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[2]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[3]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[4]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[5]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[6]); - } - if (_v) { - return _wrap_new_rlTime__SWIG_0(L); - } - } - } - } - } - } - } - } - - SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_rlTime'\n" - " Possible C/C++ prototypes are:\n" - " rlTime::rlTime(int,int,int,int,int,int,int)\n" - " rlTime::rlTime(int,int,int,int,int,int)\n" - " rlTime::rlTime(int,int,int,int,int)\n" - " rlTime::rlTime(int,int,int,int)\n" - " rlTime::rlTime(int,int,int)\n" - " rlTime::rlTime(int,int)\n" - " rlTime::rlTime(int)\n" - " rlTime::rlTime()\n"); - lua_error(L);return 0; -} - - -static int _wrap_rlTime_getTimeString(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - char *result = 0 ; - - SWIG_check_num_args("rlTime::getTimeString",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::getTimeString",1,"rlTime *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_getTimeString",1,SWIGTYPE_p_rlTime); - } - - result = (char *)(arg1)->getTimeString(); - lua_pushstring(L,(const char *)result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_getIsoTimeString(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - char *result = 0 ; - - SWIG_check_num_args("rlTime::getIsoTimeString",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::getIsoTimeString",1,"rlTime *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_getIsoTimeString",1,SWIGTYPE_p_rlTime); - } - - result = (char *)(arg1)->getIsoTimeString(); - lua_pushstring(L,(const char *)result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_getLocalTime(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - - SWIG_check_num_args("rlTime::getLocalTime",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::getLocalTime",1,"rlTime *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_getLocalTime",1,SWIGTYPE_p_rlTime); - } - - (arg1)->getLocalTime(); - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_getFileModificationTime(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - char *arg2 = (char *) 0 ; - int result; - - SWIG_check_num_args("rlTime::getFileModificationTime",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::getFileModificationTime",1,"rlTime *"); - if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("rlTime::getFileModificationTime",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_getFileModificationTime",1,SWIGTYPE_p_rlTime); - } - - arg2 = (char *)lua_tostring(L, 2); - result = (int)(arg1)->getFileModificationTime((char const *)arg2); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_setTimeFromString(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - char *arg2 = (char *) 0 ; - - SWIG_check_num_args("rlTime::setTimeFromString",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::setTimeFromString",1,"rlTime *"); - if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("rlTime::setTimeFromString",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_setTimeFromString",1,SWIGTYPE_p_rlTime); - } - - arg2 = (char *)lua_tostring(L, 2); - (arg1)->setTimeFromString((char const *)arg2); - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_setTimeFromIsoString(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - char *arg2 = (char *) 0 ; - - SWIG_check_num_args("rlTime::setTimeFromIsoString",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::setTimeFromIsoString",1,"rlTime *"); - if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("rlTime::setTimeFromIsoString",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_setTimeFromIsoString",1,SWIGTYPE_p_rlTime); - } - - arg2 = (char *)lua_tostring(L, 2); - (arg1)->setTimeFromIsoString((char const *)arg2); - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_setLocalTime(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - - SWIG_check_num_args("rlTime::setLocalTime",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::setLocalTime",1,"rlTime *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_setLocalTime",1,SWIGTYPE_p_rlTime); - } - - (arg1)->setLocalTime(); - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_secondsSinceEpoche(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - double result; - - SWIG_check_num_args("rlTime::secondsSinceEpoche",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::secondsSinceEpoche",1,"rlTime *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_secondsSinceEpoche",1,SWIGTYPE_p_rlTime); - } - - result = (double)(arg1)->secondsSinceEpoche(); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime___add(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - rlTime *arg2 = 0 ; - rlTime result; - - SWIG_check_num_args("rlTime::operator +",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::operator +",1,"rlTime *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("rlTime::operator +",2,"rlTime &"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime___add",1,SWIGTYPE_p_rlTime); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime___add",2,SWIGTYPE_p_rlTime); - } - - result = (arg1)->operator +(*arg2); - { - rlTime * resultptr = new rlTime((const rlTime &) result); - SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_rlTime,1); SWIG_arg++; - } - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime___sub(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - rlTime *arg2 = 0 ; - rlTime result; - - SWIG_check_num_args("rlTime::operator -",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::operator -",1,"rlTime *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("rlTime::operator -",2,"rlTime &"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime___sub",1,SWIGTYPE_p_rlTime); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime___sub",2,SWIGTYPE_p_rlTime); - } - - result = (arg1)->operator -(*arg2); - { - rlTime * resultptr = new rlTime((const rlTime &) result); - SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_rlTime,1); SWIG_arg++; - } - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime___eq(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - rlTime *arg2 = 0 ; - int result; - - SWIG_check_num_args("rlTime::operator ==",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::operator ==",1,"rlTime *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("rlTime::operator ==",2,"rlTime &"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime___eq",1,SWIGTYPE_p_rlTime); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime___eq",2,SWIGTYPE_p_rlTime); - } - - result = (int)(arg1)->operator ==(*arg2); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime___lt(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - rlTime *arg2 = 0 ; - int result; - - SWIG_check_num_args("rlTime::operator <",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::operator <",1,"rlTime *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("rlTime::operator <",2,"rlTime &"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime___lt",1,SWIGTYPE_p_rlTime); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime___lt",2,SWIGTYPE_p_rlTime); - } - - result = (int)(arg1)->operator <(*arg2); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime___le(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - rlTime *arg2 = 0 ; - int result; - - SWIG_check_num_args("rlTime::operator <=",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::operator <=",1,"rlTime *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("rlTime::operator <=",2,"rlTime &"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime___le",1,SWIGTYPE_p_rlTime); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime___le",2,SWIGTYPE_p_rlTime); - } - - result = (int)(arg1)->operator <=(*arg2); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_year_set(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int arg2 ; - - SWIG_check_num_args("rlTime::year",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::year",1,"rlTime *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::year",2,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_year_set",1,SWIGTYPE_p_rlTime); - } - - arg2 = (int)lua_tonumber(L, 2); - if (arg1) (arg1)->year = arg2; - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_year_get(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int result; - - SWIG_check_num_args("rlTime::year",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::year",1,"rlTime *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_year_get",1,SWIGTYPE_p_rlTime); - } - - result = (int) ((arg1)->year); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_month_set(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int arg2 ; - - SWIG_check_num_args("rlTime::month",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::month",1,"rlTime *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::month",2,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_month_set",1,SWIGTYPE_p_rlTime); - } - - arg2 = (int)lua_tonumber(L, 2); - if (arg1) (arg1)->month = arg2; - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_month_get(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int result; - - SWIG_check_num_args("rlTime::month",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::month",1,"rlTime *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_month_get",1,SWIGTYPE_p_rlTime); - } - - result = (int) ((arg1)->month); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_day_set(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int arg2 ; - - SWIG_check_num_args("rlTime::day",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::day",1,"rlTime *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::day",2,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_day_set",1,SWIGTYPE_p_rlTime); - } - - arg2 = (int)lua_tonumber(L, 2); - if (arg1) (arg1)->day = arg2; - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_day_get(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int result; - - SWIG_check_num_args("rlTime::day",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::day",1,"rlTime *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_day_get",1,SWIGTYPE_p_rlTime); - } - - result = (int) ((arg1)->day); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_hour_set(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int arg2 ; - - SWIG_check_num_args("rlTime::hour",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::hour",1,"rlTime *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::hour",2,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_hour_set",1,SWIGTYPE_p_rlTime); - } - - arg2 = (int)lua_tonumber(L, 2); - if (arg1) (arg1)->hour = arg2; - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_hour_get(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int result; - - SWIG_check_num_args("rlTime::hour",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::hour",1,"rlTime *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_hour_get",1,SWIGTYPE_p_rlTime); - } - - result = (int) ((arg1)->hour); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_minute_set(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int arg2 ; - - SWIG_check_num_args("rlTime::minute",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::minute",1,"rlTime *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::minute",2,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_minute_set",1,SWIGTYPE_p_rlTime); - } - - arg2 = (int)lua_tonumber(L, 2); - if (arg1) (arg1)->minute = arg2; - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_rlTime_minute_get(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int result; - - SWIG_check_num_args("rlTime::minute",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::minute",1,"rlTime *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_minute_get",1,SWIGTYPE_p_rlTime); - } - - result = (int) ((arg1)->minute); + result = (int)(arg1)->open((char const *)arg2); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; @@ -30316,45 +31220,84 @@ static int _wrap_rlTime_minute_get(lua_State* L) { } -static int _wrap_rlTime_second_set(lua_State* L) { - int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int arg2 ; - - SWIG_check_num_args("rlTime::second",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::second",1,"rlTime *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::second",2,"int"); +static int _wrap_rlSvgCat_open(lua_State* L) { + int argc; + int argv[4]={ + 1,2,3,4 + }; - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_second_set",1,SWIGTYPE_p_rlTime); + argc = lua_gettop(L); + if (argc == 2) { + int _v; + { + void *ptr; + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_rlSvgCat, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = SWIG_lua_isnilstring(L,argv[1]); + } + if (_v) { + return _wrap_rlSvgCat_open__SWIG_1(L); + } + } + } + if (argc == 3) { + int _v; + { + void *ptr; + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_rlSvgCat, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = SWIG_lua_isnilstring(L,argv[1]); + } + if (_v) { + { + _v = SWIG_lua_isnilstring(L,argv[2]); + } + if (_v) { + return _wrap_rlSvgCat_open__SWIG_0(L); + } + } + } } - arg2 = (int)lua_tonumber(L, 2); - if (arg1) (arg1)->second = arg2; - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'rlSvgCat_open'\n" + " Possible C/C++ prototypes are:\n" + " rlSvgCat::open(char const *,char const *)\n" + " rlSvgCat::open(char const *)\n"); + lua_error(L);return 0; } -static int _wrap_rlTime_second_get(lua_State* L) { +static int _wrap_rlSvgCat_reopenSocket(lua_State* L) { int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; + rlSvgCat *arg1 = (rlSvgCat *) 0 ; + char *arg2 = (char *) 0 ; + int arg3 ; int result; - SWIG_check_num_args("rlTime::second",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::second",1,"rlTime *"); + SWIG_check_num_args("rlSvgCat::reopenSocket",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlSvgCat::reopenSocket",1,"rlSvgCat *"); + if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("rlSvgCat::reopenSocket",2,"char const *"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("rlSvgCat::reopenSocket",3,"int"); - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_second_get",1,SWIGTYPE_p_rlTime); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlSvgCat,0))){ + SWIG_fail_ptr("rlSvgCat_reopenSocket",1,SWIGTYPE_p_rlSvgCat); } - result = (int) ((arg1)->second); + arg2 = (char *)lua_tostring(L, 2); + arg3 = (int)lua_tonumber(L, 3); + result = (int)(arg1)->reopenSocket((char const *)arg2,arg3); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; @@ -30366,21 +31309,18 @@ static int _wrap_rlTime_second_get(lua_State* L) { } -static int _wrap_rlTime_millisecond_set(lua_State* L) { +static int _wrap_rlSvgCat_cat(lua_State* L) { int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int arg2 ; + rlSvgCat *arg1 = (rlSvgCat *) 0 ; - SWIG_check_num_args("rlTime::millisecond",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::millisecond",1,"rlTime *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("rlTime::millisecond",2,"int"); + SWIG_check_num_args("rlSvgCat::cat",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlSvgCat::cat",1,"rlSvgCat *"); - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_millisecond_set",1,SWIGTYPE_p_rlTime); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlSvgCat,0))){ + SWIG_fail_ptr("rlSvgCat_cat",1,SWIGTYPE_p_rlSvgCat); } - arg2 = (int)lua_tonumber(L, 2); - if (arg1) (arg1)->millisecond = arg2; + (arg1)->cat(); return SWIG_arg; @@ -30392,20 +31332,19 @@ static int _wrap_rlTime_millisecond_set(lua_State* L) { } -static int _wrap_rlTime_millisecond_get(lua_State* L) { +static int _wrap_rlSvgCat_close(lua_State* L) { int SWIG_arg = 0; - rlTime *arg1 = (rlTime *) 0 ; - int result; + rlSvgCat *arg1 = (rlSvgCat *) 0 ; - SWIG_check_num_args("rlTime::millisecond",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlTime::millisecond",1,"rlTime *"); + SWIG_check_num_args("rlSvgCat::close",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("rlSvgCat::close",1,"rlSvgCat *"); - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlTime,0))){ - SWIG_fail_ptr("rlTime_millisecond_get",1,SWIGTYPE_p_rlTime); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_rlSvgCat,0))){ + SWIG_fail_ptr("rlSvgCat_close",1,SWIGTYPE_p_rlSvgCat); } - result = (int) ((arg1)->millisecond); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + (arg1)->close(); + return SWIG_arg; if(0) SWIG_fail; @@ -30416,48 +31355,56 @@ static int _wrap_rlTime_millisecond_get(lua_State* L) { } -static void swig_delete_rlTime(void *obj) { -rlTime *arg1 = (rlTime *) obj; +static void swig_delete_rlSvgCat(void *obj) { +rlSvgCat *arg1 = (rlSvgCat *) obj; delete arg1; } -static swig_lua_method swig_rlTime_methods[] = { - {"getTimeString", _wrap_rlTime_getTimeString}, - {"getIsoTimeString", _wrap_rlTime_getIsoTimeString}, - {"getLocalTime", _wrap_rlTime_getLocalTime}, - {"getFileModificationTime", _wrap_rlTime_getFileModificationTime}, - {"setTimeFromString", _wrap_rlTime_setTimeFromString}, - {"setTimeFromIsoString", _wrap_rlTime_setTimeFromIsoString}, - {"setLocalTime", _wrap_rlTime_setLocalTime}, - {"secondsSinceEpoche", _wrap_rlTime_secondsSinceEpoche}, - {"__add", _wrap_rlTime___add}, - {"__sub", _wrap_rlTime___sub}, - {"__eq", _wrap_rlTime___eq}, - {"__lt", _wrap_rlTime___lt}, - {"__le", _wrap_rlTime___le}, +static int _proxy__wrap_new_rlSvgCat(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlSvgCat); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_rlSvgCat_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_rlSvgCat_methods[]= { + { "open", _wrap_rlSvgCat_open}, + { "reopenSocket", _wrap_rlSvgCat_reopenSocket}, + { "cat", _wrap_rlSvgCat_cat}, + { "close", _wrap_rlSvgCat_close}, {0,0} }; -static swig_lua_attribute swig_rlTime_attributes[] = { - { "year", _wrap_rlTime_year_get, _wrap_rlTime_year_set}, - { "month", _wrap_rlTime_month_get, _wrap_rlTime_month_set}, - { "day", _wrap_rlTime_day_get, _wrap_rlTime_day_set}, - { "hour", _wrap_rlTime_hour_get, _wrap_rlTime_hour_set}, - { "minute", _wrap_rlTime_minute_get, _wrap_rlTime_minute_set}, - { "second", _wrap_rlTime_second_get, _wrap_rlTime_second_set}, - { "millisecond", _wrap_rlTime_millisecond_get, _wrap_rlTime_millisecond_set}, - {0,0,0} +static swig_lua_method swig_rlSvgCat_meta[] = { + {0,0} }; -static swig_lua_attribute swig_rlTime_cls_attributes[] = { + +static swig_lua_attribute swig_rlSvgCat_Sf_SwigStatic_attributes[] = { {0,0,0} }; -static swig_lua_method swig_rlTime_cls_methods[] = { +static swig_lua_const_info swig_rlSvgCat_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_rlSvgCat_Sf_SwigStatic_methods[]= { {0,0} }; -static swig_lua_const_info swig_rlTime_cls_constants[] = { - {0,0,0,0,0,0} +static swig_lua_class* swig_rlSvgCat_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlSvgCat_Sf_SwigStatic = { + "rlSvgCat", + swig_rlSvgCat_Sf_SwigStatic_methods, + swig_rlSvgCat_Sf_SwigStatic_attributes, + swig_rlSvgCat_Sf_SwigStatic_constants, + swig_rlSvgCat_Sf_SwigStatic_classes, + 0 }; -static swig_lua_class *swig_rlTime_bases[] = {0}; -static const char *swig_rlTime_base_names[] = {0}; -static swig_lua_class _wrap_class_rlTime = { "rlTime", &SWIGTYPE_p_rlTime,_wrap_new_rlTime, swig_delete_rlTime, swig_rlTime_methods, swig_rlTime_attributes, { "rlTime", swig_rlTime_cls_methods, swig_rlTime_cls_attributes, swig_rlTime_cls_constants }, swig_rlTime_bases, swig_rlTime_base_names }; +static swig_lua_class *swig_rlSvgCat_bases[] = {0}; +static const char *swig_rlSvgCat_base_names[] = {0}; +static swig_lua_class _wrap_class_rlSvgCat = { "rlSvgCat", "rlSvgCat", &SWIGTYPE_p_rlSvgCat,_proxy__wrap_new_rlSvgCat, swig_delete_rlSvgCat, swig_rlSvgCat_methods, swig_rlSvgCat_attributes, &swig_rlSvgCat_Sf_SwigStatic, swig_rlSvgCat_meta, swig_rlSvgCat_bases, swig_rlSvgCat_base_names }; static int _wrap_new_rlWebcam(lua_State* L) { int SWIG_arg = 0; @@ -31190,36 +32137,60 @@ static void swig_delete_rlWebcam(void *obj) { rlWebcam *arg1 = (rlWebcam *) obj; delete arg1; } -static swig_lua_method swig_rlWebcam_methods[] = { - {"setUrl", _wrap_rlWebcam_setUrl}, - {"disconnect", _wrap_rlWebcam_disconnect}, - {"getSnapshot", _wrap_rlWebcam_getSnapshot}, - {"getFrame", _wrap_rlWebcam_getFrame}, - {"getFrameBuffer", _wrap_rlWebcam_getFrameBuffer}, - {"getUrl", _wrap_rlWebcam_getUrl}, - {"getHost", _wrap_rlWebcam_getHost}, - {"getPort", _wrap_rlWebcam_getPort}, - {"getPath", _wrap_rlWebcam_getPath}, - {0,0} -}; +static int _proxy__wrap_new_rlWebcam(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_rlWebcam); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_rlWebcam_attributes[] = { - { "debug", _wrap_rlWebcam_debug_get, _wrap_rlWebcam_debug_set}, - { "filename", _wrap_rlWebcam_filename_get, _wrap_rlWebcam_filename_set}, - { "sock", _wrap_rlWebcam_sock_get, _wrap_rlWebcam_sock_set}, + { "debug", _wrap_rlWebcam_debug_get, _wrap_rlWebcam_debug_set }, + { "filename", _wrap_rlWebcam_filename_get, _wrap_rlWebcam_filename_set }, + { "sock", _wrap_rlWebcam_sock_get, _wrap_rlWebcam_sock_set }, {0,0,0} }; -static swig_lua_attribute swig_rlWebcam_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_rlWebcam_methods[]= { + { "setUrl", _wrap_rlWebcam_setUrl}, + { "disconnect", _wrap_rlWebcam_disconnect}, + { "getSnapshot", _wrap_rlWebcam_getSnapshot}, + { "getFrame", _wrap_rlWebcam_getFrame}, + { "getFrameBuffer", _wrap_rlWebcam_getFrameBuffer}, + { "getUrl", _wrap_rlWebcam_getUrl}, + { "getHost", _wrap_rlWebcam_getHost}, + { "getPort", _wrap_rlWebcam_getPort}, + { "getPath", _wrap_rlWebcam_getPath}, + {0,0} }; -static swig_lua_method swig_rlWebcam_cls_methods[] = { +static swig_lua_method swig_rlWebcam_meta[] = { {0,0} }; -static swig_lua_const_info swig_rlWebcam_cls_constants[] = { + +static swig_lua_attribute swig_rlWebcam_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_rlWebcam_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_rlWebcam_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_rlWebcam_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_rlWebcam_Sf_SwigStatic = { + "rlWebcam", + swig_rlWebcam_Sf_SwigStatic_methods, + swig_rlWebcam_Sf_SwigStatic_attributes, + swig_rlWebcam_Sf_SwigStatic_constants, + swig_rlWebcam_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_rlWebcam_bases[] = {0}; static const char *swig_rlWebcam_base_names[] = {0}; -static swig_lua_class _wrap_class_rlWebcam = { "rlWebcam", &SWIGTYPE_p_rlWebcam,_wrap_new_rlWebcam, swig_delete_rlWebcam, swig_rlWebcam_methods, swig_rlWebcam_attributes, { "rlWebcam", swig_rlWebcam_cls_methods, swig_rlWebcam_cls_attributes, swig_rlWebcam_cls_constants }, swig_rlWebcam_bases, swig_rlWebcam_base_names }; +static swig_lua_class _wrap_class_rlWebcam = { "rlWebcam", "rlWebcam", &SWIGTYPE_p_rlWebcam,_proxy__wrap_new_rlWebcam, swig_delete_rlWebcam, swig_rlWebcam_methods, swig_rlWebcam_attributes, &swig_rlWebcam_Sf_SwigStatic, swig_rlWebcam_meta, swig_rlWebcam_bases, swig_rlWebcam_base_names }; static int _wrap_rlsleep(lua_State* L) { int SWIG_arg = 0; @@ -31240,73 +32211,12 @@ static int _wrap_rlsleep(lua_State* L) { } -#ifdef __cplusplus -} -#endif - -static const struct luaL_Reg swig_commands[] = { - { "rlwsa", _wrap_rlwsa}, - { "rlScoketWrite", _wrap_rlScoketWrite}, - { "rlSetDebugPrintf", _wrap_rlSetDebugPrintf}, - { "rlDebugPrintf", _wrap_rlDebugPrintf}, - { "rlInputAvailable", _wrap_rlInputAvailable}, - { "rlLastLinePrintf", _wrap_rlLastLinePrintf}, - { "rlpass", _wrap_rlpass}, - { "rlstrncpy", _wrap_rlstrncpy}, - { "rlstrlinecpy", _wrap_rlstrlinecpy}, - { "rlsnprintf", _wrap_rlsnprintf}, - { "rlSetSigtermHandler", _wrap_rlSetSigtermHandler}, - { "rlFindFile", _wrap_rlFindFile}, - { "rlGetInifile", _wrap_rlGetInifile}, - { "rlSwapShort", _wrap_rlSwapShort}, - { "rlEib1", _wrap_rlEib1}, - { "rlEib2", _wrap_rlEib2}, - { "rlLon1", _wrap_rlLon1}, - { "rlLon2", _wrap_rlLon2}, - { "rlProfibus1", _wrap_rlProfibus1}, - { "rlProfibus2", _wrap_rlProfibus2}, - { "rlCan1", _wrap_rlCan1}, - { "rlCan2", _wrap_rlCan2}, - { "rlBrowser", _wrap_rlBrowser}, - { "rlsystem", _wrap_rlsystem}, - { "rlSubmitPvserver",_wrap_rlSubmitPvserver}, - { "rlOption", _wrap_rlOption}, - { "rlIntOption", _wrap_rlIntOption}, - { "rlFloatOption", _wrap_rlFloatOption}, - { "rlTextOption", _wrap_rlTextOption}, - { "rlCopyTextfile", _wrap_rlCopyTextfile}, - { "rlupper", _wrap_rlupper}, - { "rllower", _wrap_rllower}, - { "rlStartsWith", _wrap_rlStartsWith}, - { "rlEndsWith", _wrap_rlEndsWith}, - { "rlStrMatch", _wrap_rlStrMatch}, - { "rlFRead", _wrap_rlFRead}, - { "rlFWrite", _wrap_rlFWrite}, - { "rlWriteFile", _wrap_rlWriteFile}, - { "rlMkdir",_wrap_rlMkdir}, - { "rlBitSet", _wrap_rlBitSet}, - { "rlBitClear", _wrap_rlBitClear}, - { "rlBitChange", _wrap_rlBitChange}, - { "rlBitTest", _wrap_rlBitTest}, - { "rlPushToDoubleBuffer", _wrap_rlPushToDoubleBuffer}, - { "rlPushToFloatBuffer", _wrap_rlPushToFloatBuffer}, - { "rlEventInit", _wrap_rlEventInit}, - { "rlSetEventLocation", _wrap_rlSetEventLocation}, - { "rlEventPrintf", _wrap_rlEventPrintf}, - { "rlSetTranslator",_wrap_rlSetTranslator}, - { "rltranslate",_wrap_rltranslate}, - { "rltranslate2",_wrap_rltranslate2}, - { "rlsleep", _wrap_rlsleep}, - {0,0} -}; - -static swig_lua_var_info swig_variables[] = { +static swig_lua_attribute swig_SwigModule_attributes[] = { { "rlevent_name", _wrap_rlevent_name_get, SWIG_Lua_set_immutable }, { "rlCRLF", _wrap_rlCRLF_get, SWIG_Lua_set_immutable }, {0,0,0} }; - -static swig_lua_const_info swig_constants[] = { +static swig_lua_const_info swig_SwigModule_constants[]= { {SWIG_LUA_CONSTTAB_INT("rl_PRINTF_LENGTH", 4096)}, {SWIG_LUA_CONSTTAB_INT("rl_PRINTF_LENGTH_SPREADSHEET", 4096)}, {SWIG_LUA_CONSTTAB_INT("BIT0", 1)}, @@ -31473,6 +32383,126 @@ static swig_lua_const_info swig_constants[] = { {SWIG_LUA_CONSTTAB_INT("rlSiemensTCP_WriteByte", rlSiemensTCP::WriteByte)}, {0,0,0,0,0,0} }; +static swig_lua_method swig_SwigModule_methods[]= { + { "rlwsa", _wrap_rlwsa}, + { "rlScoketWrite", _wrap_rlScoketWrite}, + { "rlSetDebugPrintf", _wrap_rlSetDebugPrintf}, + { "rlDebugPrintf", _wrap_rlDebugPrintf}, + { "rlInputAvailable", _wrap_rlInputAvailable}, + { "rlLastLinePrintf", _wrap_rlLastLinePrintf}, + { "rlpass", _wrap_rlpass}, + { "rlstrncpy", _wrap_rlstrncpy}, + { "rlstrlinecpy", _wrap_rlstrlinecpy}, + { "rlsnprintf", _wrap_rlsnprintf}, + { "rlSetSigtermHandler", _wrap_rlSetSigtermHandler}, + { "rlFindFile", _wrap_rlFindFile}, + { "rlGetInifile", _wrap_rlGetInifile}, + { "rlSwapShort", _wrap_rlSwapShort}, + { "rlEib1", _wrap_rlEib1}, + { "rlEib2", _wrap_rlEib2}, + { "rlLon1", _wrap_rlLon1}, + { "rlLon2", _wrap_rlLon2}, + { "rlProfibus1", _wrap_rlProfibus1}, + { "rlProfibus2", _wrap_rlProfibus2}, + { "rlCan1", _wrap_rlCan1}, + { "rlCan2", _wrap_rlCan2}, + { "rlBrowser", _wrap_rlBrowser}, + { "rlsystem", _wrap_rlsystem}, + { "rlSubmitPvserver", _wrap_rlSubmitPvserver}, + { "rlOption", _wrap_rlOption}, + { "rlIntOption", _wrap_rlIntOption}, + { "rlFloatOption", _wrap_rlFloatOption}, + { "rlTextOption", _wrap_rlTextOption}, + { "rlCopyTextfile", _wrap_rlCopyTextfile}, + { "rlupper", _wrap_rlupper}, + { "rllower", _wrap_rllower}, + { "rlStartsWith", _wrap_rlStartsWith}, + { "rlEndsWith", _wrap_rlEndsWith}, + { "rlStrMatch", _wrap_rlStrMatch}, + { "rlFRead", _wrap_rlFRead}, + { "rlFWrite", _wrap_rlFWrite}, + { "rlWriteFile", _wrap_rlWriteFile}, + { "rlMkdir", _wrap_rlMkdir}, + { "rlBitSet", _wrap_rlBitSet}, + { "rlBitClear", _wrap_rlBitClear}, + { "rlBitChange", _wrap_rlBitChange}, + { "rlBitTest", _wrap_rlBitTest}, + { "rlPushToDoubleBuffer", _wrap_rlPushToDoubleBuffer}, + { "rlPushToFloatBuffer", _wrap_rlPushToFloatBuffer}, + { "rlEventInit", _wrap_rlEventInit}, + { "rlSetEventLocation", _wrap_rlSetEventLocation}, + { "rlEventPrintf", _wrap_rlEventPrintf}, + { "rlSetTranslator", _wrap_rlSetTranslator}, + { "rltranslate", _wrap_rltranslate}, + { "rltranslate2", _wrap_rltranslate2}, + { "rlsleep", _wrap_rlsleep}, + {0,0} +}; +static swig_lua_class* swig_SwigModule_classes[]= { +&_wrap_class_THREAD_PARAM, +&_wrap_class_rlThread, +&_wrap_class_rlMutex, +&_wrap_class_rlSemaphore, +&_wrap_class_rlSharedMemory, +&_wrap_class_rlIpAdr, +&_wrap_class_rlUdpSocket, +&_wrap_class_rlSocket, +&_wrap_class_rl3964R, +&_wrap_class_rlCommandlineInterface, +&_wrap_class_rlDataAcquisition, +&_wrap_class_rlDataAcquisitionProvider, +&_wrap_class_rlDataProvider, +&_wrap_class_rlDataProviderClient, +&_wrap_class_rlDataProviderThreads, +&_wrap_class_rlEventLogServer, +&_wrap_class_rlEventLogServerThreads, +&_wrap_class_rlFifo, +&_wrap_class_rlFileLines, +&_wrap_class_rlFileLoad, +&_wrap_class_rlHistoryLogLine, +&_wrap_class_rlHistoryLogger, +&_wrap_class_rlHistoryReaderLine, +&_wrap_class_rlHistoryReader, +&_wrap_class_rlIniFile, +&_wrap_class_rlInterpreter, +&_wrap_class_rlMailbox, +&_wrap_class_rlModbusClient, +&_wrap_class_rlModbus, +&_wrap_class_rlOpcXmlDa, +&_wrap_class_rlPcontrol, +&_wrap_class_rlPlcState, +&_wrap_class_rlPlcMem, +&_wrap_class_rlPPIClient, +&_wrap_class_rlSerial, +&_wrap_class_rlSiemensTCPClient, +&_wrap_class_rlSiemensTCP, +&_wrap_class_rlSpawn, +&_wrap_class_rlSpreadsheetCell, +&_wrap_class_rlSpreadsheetRow, +&_wrap_class_rlSpreadsheetTable, +&_wrap_class_rlSpreadsheetWorkbook, +&_wrap_class_rlString, +&_wrap_class_rlSvgPosition, +&_wrap_class_rlSvgAnimator, +&_wrap_class_rlSvgCat, +&_wrap_class_rlWebcam, + 0 +}; +static swig_lua_namespace* swig_SwigModule_namespaces[] = { + 0 +}; + +static swig_lua_namespace swig_SwigModule = { + "rllib", + swig_SwigModule_methods, + swig_SwigModule_attributes, + swig_SwigModule_constants, + swig_SwigModule_classes, + swig_SwigModule_namespaces +}; +#ifdef __cplusplus +} +#endif /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ @@ -31500,9 +32530,9 @@ static void *_p_rlSiemensTCPClientTo_p_rlSharedMemory(void *x, int *SWIGUNUSEDPA static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_THREAD_PARAM = {"_p_THREAD_PARAM", "THREAD_PARAM *", 0, 0, (void*)&_wrap_class_THREAD_PARAM, 0}; static swig_type_info _swigt__p_WSEMAPHORE = {"_p_WSEMAPHORE", "WSEMAPHORE *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p__rlFileLines_ = {"_p__rlFileLines_", "rlFileLines *|_rlFileLines_ *", 0, 0, (void*)&_wrap_class__rlFileLines_, 0}; -static swig_type_info _swigt__p__rlHistoryLogLine_ = {"_p__rlHistoryLogLine_", "_rlHistoryLogLine_ *|rlHistoryLogLine *", 0, 0, (void*)&_wrap_class__rlHistoryLogLine_, 0}; -static swig_type_info _swigt__p__rlHistoryReaderLine_ = {"_p__rlHistoryReaderLine_", "rlHistoryReaderLine *|_rlHistoryReaderLine_ *", 0, 0, (void*)&_wrap_class__rlHistoryReaderLine_, 0}; +static swig_type_info _swigt__p__rlFileLines_ = {"_p__rlFileLines_", "rlFileLines *|_rlFileLines_ *", 0, 0, (void*)&_wrap_class_rlFileLines, 0}; +static swig_type_info _swigt__p__rlHistoryLogLine_ = {"_p__rlHistoryLogLine_", "_rlHistoryLogLine_ *|rlHistoryLogLine *", 0, 0, (void*)&_wrap_class_rlHistoryLogLine, 0}; +static swig_type_info _swigt__p__rlHistoryReaderLine_ = {"_p__rlHistoryReaderLine_", "rlHistoryReaderLine *|_rlHistoryReaderLine_ *", 0, 0, (void*)&_wrap_class_rlHistoryReaderLine, 0}; static swig_type_info _swigt__p_a_4__char = {"_p_a_4__char", "char (*)[4]", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_f_p_q_const__unsigned_char_int__void = {"_p_f_p_q_const__unsigned_char_int__void", "void (*)(unsigned char const *,int)", 0, 0, (void*)0, 0}; @@ -31557,11 +32587,12 @@ static swig_type_info _swigt__p_rlSvgCat = {"_p_rlSvgCat", "rlSvgCat *", 0, 0, ( static swig_type_info _swigt__p_rlSvgPosition = {"_p_rlSvgPosition", "rlSvgPosition *", 0, 0, (void*)&_wrap_class_rlSvgPosition, 0}; static swig_type_info _swigt__p_rlSvgPosition__rlPositionInit = {"_p_rlSvgPosition__rlPositionInit", "rlSvgPosition::rlPositionInit *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_rlThread = {"_p_rlThread", "rlThread *", 0, 0, (void*)&_wrap_class_rlThread, 0}; -static swig_type_info _swigt__p_rlTime = {"_p_rlTime", "rlTime *", 0, 0, (void*)&_wrap_class_rlTime, 0}; +static swig_type_info _swigt__p_rlTime = {"_p_rlTime", "rlTime *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_rlUdpSocket = {"_p_rlUdpSocket", "rlUdpSocket *", 0, 0, (void*)&_wrap_class_rlUdpSocket, 0}; static swig_type_info _swigt__p_rlWebcam = {"_p_rlWebcam", "rlWebcam *", 0, 0, (void*)&_wrap_class_rlWebcam, 0}; static swig_type_info _swigt__p_short = {"_p_short", "short *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_sockaddr_in = {"_p_sockaddr_in", "sockaddr_in *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__shared_ptrT_rlSharedMemory__LockUserAddr_t = {"_p_std__shared_ptrT_rlSharedMemory__LockUserAddr_t", "std::shared_ptr< rlSharedMemory::LockUserAddr > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *", 0, 0, (void*)0, 0}; @@ -31633,6 +32664,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_rlWebcam, &_swigt__p_short, &_swigt__p_sockaddr_in, + &_swigt__p_std__shared_ptrT_rlSharedMemory__LockUserAddr_t, &_swigt__p_unsigned_char, &_swigt__p_unsigned_int, &_swigt__p_unsigned_short, @@ -31704,6 +32736,7 @@ static swig_cast_info _swigc__p_rlUdpSocket[] = { {&_swigt__p_rlUdpSocket, 0, 0 static swig_cast_info _swigc__p_rlWebcam[] = { {&_swigt__p_rlWebcam, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_sockaddr_in[] = { {&_swigt__p_sockaddr_in, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__shared_ptrT_rlSharedMemory__LockUserAddr_t[] = { {&_swigt__p_std__shared_ptrT_rlSharedMemory__LockUserAddr_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}}; @@ -31775,6 +32808,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_rlWebcam, _swigc__p_short, _swigc__p_sockaddr_in, + _swigc__p_std__shared_ptrT_rlSharedMemory__LockUserAddr_t, _swigc__p_unsigned_char, _swigc__p_unsigned_int, _swigc__p_unsigned_short, @@ -31797,7 +32831,7 @@ static swig_cast_info *swig_cast_initial[] = { * array with the correct data and linking the correct swig_cast_info * structures together. * - * The generated swig_type_info structures are assigned staticly to an initial + * The generated swig_type_info structures are assigned statically to an initial * array. We just loop through that array, and handle each type individually. * First we lookup if this type has been already loaded, and if so, use the * loaded structure instead of the generated one. Then we have to fill in the @@ -31841,7 +32875,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found, init; + int init; /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { @@ -31860,22 +32894,18 @@ SWIG_InitializeModule(void *clientdata) { /* This is the first module loaded for this interpreter */ /* so set the swig module into the interpreter */ SWIG_SetModule(clientdata, &swig_module); - module_head = &swig_module; } else { /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - found=0; iter=module_head; do { if (iter==&swig_module) { - found=1; - break; + /* Our module is already in the list, so there's nothing more to do. */ + return; } iter=iter->next; } while (iter!= module_head); - /* if the is found in the list, then all is done and we may leave */ - if (found) return; - /* otherwise we must add out module into the list */ + /* otherwise we must add our module into the list */ swig_module.next = module_head->next; module_head->next = &swig_module; } @@ -32039,27 +33069,18 @@ SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ { #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */ int i; + int globalRegister = 0; /* start with global table */ lua_pushglobaltable (L); - /* SWIG's internal initalisation */ + /* SWIG's internal initialisation */ SWIG_InitializeModule((void*)L); SWIG_PropagateClientData(); #endif -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE) /* add a global fn */ SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); - SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal); - /* begin the module (its a table with the same name as the module) */ - SWIG_Lua_module_begin(L,SWIG_name); - /* add commands/functions */ - for (i = 0; swig_commands[i].name; i++){ - SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func); - } - /* add variables */ - for (i = 0; swig_variables[i].name; i++){ - SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set); - } + SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal); #endif #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) @@ -32069,17 +33090,34 @@ SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); } } - /* additional registration structs & classes in lua */ +#ifdef SWIG_LUA_MODULE_GLOBAL + globalRegister = 1; +#endif + + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + SWIG_Lua_namespace_register(L,&swig_SwigModule, globalRegister); +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) for (i = 0; swig_types[i]; i++){ if (swig_types[i]->clientdata){ - SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata)); + SWIG_Lua_elua_class_register_instance(L,(swig_lua_class*)(swig_types[i]->clientdata)); } } #endif -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) - /* constants */ - SWIG_Lua_InstallConstants(L,swig_constants); +#if defined(SWIG_LUA_ELUA_EMULATE) + lua_newtable(L); + SWIG_Lua_elua_emulate_register(L,swig_SwigModule.ns_methods); + SWIG_Lua_elua_emulate_register_clear(L); + if(globalRegister) { + lua_pushstring(L,swig_SwigModule.name); + lua_pushvalue(L,-2); + lua_rawset(L,-4); + } +#endif + #endif #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) diff --git a/language_bindings/language_binding_wrap_lua.cxx b/language_bindings/language_binding_wrap_lua.cxx index fa623dc1..cb086a19 100644 --- a/language_bindings/language_binding_wrap_lua.cxx +++ b/language_bindings/language_binding_wrap_lua.cxx @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 3.0.12 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -8,7 +8,11 @@ * interface file instead. * ----------------------------------------------------------------------------- */ + +#ifndef SWIGLUA #define SWIGLUA +#endif + #define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA #define SWIG_LUA_MODULE_GLOBAL @@ -103,9 +107,11 @@ template T SwigValueInit() { #endif /* exporting methods */ -#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif # endif #endif @@ -144,6 +150,19 @@ template T SwigValueInit() { # define _SCL_SECURE_NO_DEPRECATE #endif +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif /* ----------------------------------------------------------------------------- * swigrun.swg @@ -551,14 +570,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *iter = start; do { if (iter->size) { - register size_t l = 0; - register size_t r = iter->size - 1; + size_t l = 0; + size_t r = iter->size - 1; do { /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - register size_t i = (l + r) >> 1; + size_t i = (l + r) >> 1; const char *iname = iter->types[i]->name; if (iname) { - register int compare = strcmp(name, iname); + int compare = strcmp(name, iname); if (compare == 0) { return iter->types[i]; } else if (compare < 0) { @@ -602,7 +621,7 @@ SWIG_TypeQueryModule(swig_module_info *start, of the str field (the human readable name) */ swig_module_info *iter = start; do { - register size_t i = 0; + size_t i = 0; for (; i < iter->size; ++i) { if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) return iter->types[i]; @@ -621,10 +640,10 @@ SWIG_TypeQueryModule(swig_module_info *start, SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz) { static const char hex[17] = "0123456789abcdef"; - register const unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; for (; u != eu; ++u) { - register unsigned char uu = *u; + unsigned char uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } @@ -636,22 +655,22 @@ SWIG_PackData(char *c, void *ptr, size_t sz) { */ SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - register unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; for (; u != eu; ++u) { - register char d = *(c++); - register unsigned char uu; + char d = *(c++); + unsigned char uu; if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); + uu = (unsigned char)((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); + uu = (unsigned char)((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); + uu |= (unsigned char)(d - '0'); else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); + uu |= (unsigned char)(d - ('a'-10)); else return (char *) 0; *u = uu; @@ -747,23 +766,110 @@ extern "C" { # error SWIG_LUA_TARGET not defined #endif +#if defined(SWIG_LUA_ELUA_EMULATE) + +struct swig_elua_entry; + +typedef struct swig_elua_key { + int type; + union { + const char* strkey; + lua_Number numkey; + } key; +} swig_elua_key; + +typedef struct swig_elua_val { + int type; + union { + lua_Number number; + const struct swig_elua_entry *table; + const char *string; + lua_CFunction function; + struct { + char member; + long lvalue; + void *pvalue; + swig_type_info **ptype; + } userdata; + } value; +} swig_elua_val; + +typedef struct swig_elua_entry { + swig_elua_key key; + swig_elua_val value; +} swig_elua_entry; + +#define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} } +#define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} } +#define LNILKEY {LUA_TNIL, {.strkey = 0} } + +#define LNUMVAL(x) {LUA_TNUMBER, {.number = x} } +#define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} } +#define LROVAL(x) {LUA_TTABLE, {.table = x} } +#define LNILVAL {LUA_TNIL, {.string = 0} } +#define LSTRVAL(x) {LUA_TSTRING, {.string = x} } + +#define LUA_REG_TYPE swig_elua_entry + +#define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable" + +#define lua_pushrotable(L,p)\ + lua_newtable(L);\ + assert(p);\ + SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p)); + +#define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ + LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } } + +#define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\ + LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } } +#endif + #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) # define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C) # define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C) # define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C) # define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C) + /* Those two types of constants are not supported in elua */ + +#ifndef SWIG_LUA_CONSTTAB_POINTER +#warning eLua does not support pointers as constants. By default, nil will be used as value +#define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL +#endif + +#ifndef SWIG_LUA_CONSTTAB_BINARY +#warning eLua does not support pointers to member as constants. By default, nil will be used as value +#define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL +#endif #else /* SWIG_LUA_FLAVOR_LUA */ # define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0 # define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0 # define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0 # define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0 +# define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ + SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D +# define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\ + SWIG_LUA_BINARY, (char *)B, S, 0, (void *)C, &D #endif +#ifndef SWIG_LUA_ELUA_EMULATE #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) # define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING} # define LSTRVAL LRO_STRVAL #endif +#endif /* SWIG_LUA_ELUA_EMULATE*/ + +#ifndef SWIG_LUA_ELUA_EMULATE +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) + +#ifndef MIN_OPT_LEVEL +#define MIN_OPT_LEVEL 2 +#endif +#include "lrodefs.h" +#include "lrotable.h" +#endif +#endif /* SWIG_LUA_ELUA_EMULATE*/ /* ----------------------------------------------------------------------------- * compatibility defines * ----------------------------------------------------------------------------- */ @@ -790,6 +896,23 @@ extern "C" { # define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX) #endif +/* lua_absindex was introduced in Lua 5.2 */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +# define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) +#endif + +/* lua_rawsetp was introduced in Lua 5.2 */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +#define lua_rawsetp(L,index,ptr)\ + lua_pushlightuserdata(L,(void*)(ptr));\ + lua_insert(L,-2);\ + lua_rawset(L,index); + +#define lua_rawgetp(L,index,ptr)\ + lua_pushlightuserdata(L,(void*)(ptr));\ + lua_rawget(L,index); + +#endif /* -------------------------------------------------------------------------- * Helper functions for error handling @@ -839,6 +962,12 @@ typedef struct { lua_CFunction set; } swig_lua_var_info; +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +typedef const LUA_REG_TYPE swig_lua_method; +typedef const LUA_REG_TYPE swig_lua_const_info; +#else /* Normal lua */ +typedef luaL_Reg swig_lua_method; + /* Constant information structure */ typedef struct { int type; @@ -849,10 +978,7 @@ typedef struct { swig_type_info **ptype; } swig_lua_const_info; -typedef struct { - const char *name; - lua_CFunction method; -} swig_lua_method; +#endif typedef struct { const char *name; @@ -860,23 +986,28 @@ typedef struct { lua_CFunction setmethod; } swig_lua_attribute; -// Can be used to create namespaces. Currently used to -// wrap class static methods/variables/constants -typedef struct { + +struct swig_lua_class; +/* Can be used to create namespaces. Currently used to wrap class static methods/variables/constants */ +typedef struct swig_lua_namespace { const char *name; swig_lua_method *ns_methods; swig_lua_attribute *ns_attributes; swig_lua_const_info *ns_constants; + struct swig_lua_class **ns_classes; + struct swig_lua_namespace **ns_namespaces; } swig_lua_namespace; typedef struct swig_lua_class { - const char *name; + const char *name; /* Name that this class has in Lua */ + const char *fqname; /* Fully qualified name - Scope + class name */ swig_type_info **type; lua_CFunction constructor; void (*destructor)(void *); swig_lua_method *methods; swig_lua_attribute *attributes; - swig_lua_namespace cls_static; + swig_lua_namespace *cls_static; + swig_lua_method *metatable; /* 0 for -eluac */ struct swig_lua_class **bases; const char **base_names; } swig_lua_class; @@ -940,18 +1071,23 @@ typedef struct { lua_pushcfunction(L, f), \ lua_rawset(L,-3)) +#define SWIG_Lua_add_boolean(L,n,b) \ + (lua_pushstring(L, n), \ + lua_pushboolean(L, b), \ + lua_rawset(L,-3)) + /* special helper for allowing 'nil' for usertypes */ #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) #ifdef __cplusplus /* Special helper for member function pointers it gets the address, casts it, then dereferences it */ -//#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) +/*#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) */ #endif /* storing/access of swig_module_info */ SWIGRUNTIME swig_module_info * -SWIG_Lua_GetModule(lua_State* L) { +SWIG_Lua_GetModule(lua_State *L) { swig_module_info *ret = 0; lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); lua_rawget(L,LUA_REGISTRYINDEX); @@ -962,7 +1098,7 @@ SWIG_Lua_GetModule(lua_State* L) { } SWIGRUNTIME void -SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { +SWIG_Lua_SetModule(lua_State *L, swig_module_info *module) { /* add this all into the Lua registry: */ lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); lua_pushlightuserdata(L,(void*)module); @@ -976,7 +1112,7 @@ SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { /* this function is called when trying to set an immutable. default action is to print an error. This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ -SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L) +SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L) { /* there should be 1 param passed in: the new value */ #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE @@ -986,170 +1122,153 @@ SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L) return 0; /* should not return anything */ } -/* the module.get method used for getting linked data */ -SWIGINTERN int SWIG_Lua_module_get(lua_State* L) -{ -/* there should be 2 params passed in - (1) table (not the meta table) - (2) string name of the attribute - printf("SWIG_Lua_module_get %p(%s) '%s'\n", - lua_topointer(L,1),lua_typename(L,lua_type(L,1)), - lua_tostring(L,2)); -*/ - /* get the metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - assert(lua_isrotable(L,1)); /* just in case */ -#else - assert(lua_istable(L,1)); /* default Lua action */ -#endif - lua_getmetatable(L,1); /* get the metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - assert(lua_isrotable(L,-1)); /* just in case */ -#else - assert(lua_istable(L,-1)); -#endif - SWIG_Lua_get_table(L,".get"); /* get the .get table */ - lua_remove(L,3); /* remove metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - if (lua_isrotable(L,-1)) -#else - if (lua_istable(L,-1)) -#endif - { - /* look for the key in the .get table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,3); /* remove .get */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_call(L,0,1); - return 1; - } - lua_pop(L,1); /* remove the top */ - } - lua_pop(L,1); /* remove the .get */ - lua_pushnil(L); /* return a nil */ - return 1; -} +#ifdef SWIG_LUA_ELUA_EMULATE -/* the module.set method used for setting linked data */ -SWIGINTERN int SWIG_Lua_module_set(lua_State* L) +SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own); +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type); +static int swig_lua_elua_emulate_unique_key; + +/* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */ +SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table) { -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value -*/ - /* get the metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - assert(lua_isrotable(L,1)); /* just in case */ -#else - assert(lua_istable(L,1)); /* default Lua action */ -#endif - lua_getmetatable(L,1); /* get the metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - assert(lua_isrotable(L,-1)); /* just in case */ -#else + int i, table_parsed, parsed_tables_array, target_table; assert(lua_istable(L,-1)); -#endif - SWIG_Lua_get_table(L,".set"); /* get the .set table */ - lua_remove(L,4); /* remove metatable */ -#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) - if (lua_isrotable(L,-1)) -#else - if (lua_istable(L,-1)) -#endif + target_table = lua_gettop(L); + /* Get the registry where we put all parsed tables to avoid loops */ + lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); + if(lua_isnil(L,-1)) { + lua_pop(L,1); + lua_newtable(L); + lua_pushvalue(L,-1); + lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key)); + } + parsed_tables_array = lua_gettop(L); + lua_pushvalue(L,target_table); + lua_rawsetp(L, parsed_tables_array, table); + table_parsed = 0; + const int SWIGUNUSED pairs_start = lua_gettop(L); + for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++) { - /* look for the key in the .set table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,4); /* remove .set */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,3); /* value */ - lua_call(L,1,0); - return 0; + const swig_elua_entry *entry = table + i; + int is_metatable = 0; + switch(entry->key.type) { + case LUA_TSTRING: + lua_pushstring(L,entry->key.key.strkey); + if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0) + is_metatable = 1; + break; + case LUA_TNUMBER: + lua_pushnumber(L,entry->key.key.numkey); + break; + case LUA_TNIL: + lua_pushnil(L); + break; + default: + assert(0); } -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) - else { - return 0; // Exits stoically if an invalid key is initialized. + switch(entry->value.type) { + case LUA_TSTRING: + lua_pushstring(L,entry->value.value.string); + break; + case LUA_TNUMBER: + lua_pushnumber(L,entry->value.value.number); + break; + case LUA_TFUNCTION: + lua_pushcfunction(L,entry->value.value.function); + break; + case LUA_TTABLE: + lua_rawgetp(L,parsed_tables_array, entry->value.value.table); + table_parsed = !lua_isnil(L,-1); + if(!table_parsed) { + lua_pop(L,1); /*remove nil */ + lua_newtable(L); + SWIG_Lua_elua_emulate_register(L,entry->value.value.table); + } + if(is_metatable) { + assert(lua_istable(L,-1)); + lua_pushvalue(L,-1); + lua_setmetatable(L,target_table); + } + + break; + case LUA_TUSERDATA: + if(entry->value.value.userdata.member) + SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue, + entry->value.value.userdata.lvalue, + *(entry->value.value.userdata.ptype)); + else + SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue, + *(entry->value.value.userdata.ptype),0); + break; + case LUA_TNIL: + lua_pushnil(L); + break; + default: + assert(0); } -#endif + assert(lua_gettop(L) == pairs_start + 2); + lua_rawset(L,target_table); } - lua_settop(L,3); /* reset back to start */ - /* we now have the table, key & new value, so just set directly */ - lua_rawset(L,1); /* add direct */ - return 0; + lua_pop(L,1); /* Removing parsed tables storage */ + assert(lua_gettop(L) == target_table); } -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) -/* registering a module in lua. Pushes the module table on the stack. */ -SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name) +SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L) { - assert(lua_istable(L,-1)); /* just in case */ - lua_pushstring(L,name); - lua_newtable(L); /* the table */ - /* add meta table */ - lua_newtable(L); /* the meta table */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set); - lua_pushstring(L,".get"); - lua_newtable(L); /* the .get table */ - lua_rawset(L,-3); /* add .get into metatable */ - lua_pushstring(L,".set"); - lua_newtable(L); /* the .set table */ - lua_rawset(L,-3); /* add .set into metatable */ - lua_setmetatable(L,-2); /* sets meta table in module */ -#ifdef SWIG_LUA_MODULE_GLOBAL - /* If requested, install the module directly into the global namespace. */ - lua_rawset(L,-3); /* add module into parent */ - SWIG_Lua_get_table(L,name); /* get the table back out */ -#else - /* Do not install the module table as global name. The stack top has - the module table with the name below. We pop the top and replace - the name with it. */ - lua_replace(L,-2); -#endif + lua_pushnil(L); + lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); } -/* ending the register */ -SWIGINTERN void SWIG_Lua_module_end(lua_State* L) -{ - lua_pop(L,1); /* tidy stack (remove module) */ -} +SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L); -/* adding a linked variable to the module */ -SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) +SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L) { - assert(lua_istable(L,-1)); /* just in case */ - lua_getmetatable(L,-1); /* get the metatable */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); /* should be a table: */ - SWIG_Lua_add_function(L,name,getFn); - lua_pop(L,1); /* tidy stack (remove table) */ - if (setFn) /* if there is a set fn */ - { - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - assert(lua_istable(L,-1)); /* should be a table: */ - SWIG_Lua_add_function(L,name,setFn); - lua_pop(L,1); /* tidy stack (remove table) */ + SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1); + SWIG_Lua_get_class_registry(L); + lua_getfield(L,-1,"lua_getmetatable"); + lua_remove(L,-2); /* remove the registry*/ + assert(!lua_isnil(L,-1)); + lua_pushvalue(L,1); + assert(lua_gettop(L) == 3); /* object | function | object again */ + lua_call(L,1,1); + if(!lua_isnil(L,-1)) /*There is an ordinary metatable */ + return 1; + /*if it is a table, then emulate elua behaviour - check for __metatable attribute of a table*/ + assert(lua_gettop(L) == 2); + if(lua_istable(L,-2)) { + lua_pop(L,1); /*remove the nil*/ + lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY); } - lua_pop(L,1); /* tidy stack (remove meta) */ + assert(lua_gettop(L) == 2); + return 1; + +fail: + lua_error(L); + return 0; } -#endif -/* adding a function module */ -SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn) +SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L) { - SWIG_Lua_add_function(L,name,fn); + SWIG_Lua_get_class_registry(L); + lua_pushglobaltable(L); + lua_pushstring(L,"lua_getmetatable"); + lua_getfield(L,-2,"getmetatable"); + assert(!lua_isnil(L,-1)); + lua_rawset(L,-4); + lua_pushstring(L, "getmetatable"); + lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable); + lua_rawset(L,-3); + lua_pop(L,2); + } +/* END OF REMOVE */ +#endif /* ----------------------------------------------------------------------------- - * global variable support code: namespaces + * global variable support code: namespaces and modules (which are the same thing) * ----------------------------------------------------------------------------- */ -SWIGINTERN int SWIG_Lua_namespace_get(lua_State* L) +SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L) { /* there should be 2 params passed in (1) table (not the meta table) @@ -1186,7 +1305,7 @@ SWIGINTERN int SWIG_Lua_namespace_get(lua_State* L) return 0; } -SWIGINTERN int SWIG_Lua_namespace_set(lua_State* L) +SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L) { /* there should be 3 params passed in (1) table (not the meta table) @@ -1213,46 +1332,70 @@ SWIGINTERN int SWIG_Lua_namespace_set(lua_State* L) lua_pop(L,1); /* remove the value */ } lua_pop(L,1); /* remove the value .set table */ + lua_pop(L,1); /* remote metatable */ + lua_rawset(L,-3); return 0; } -SWIGINTERN void SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]); // forward declaration -SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn); // forward declaration +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ +SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]); /* forward declaration */ +SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn); /* forward declaration */ +SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss); /* helper function - register namespace methods and attributes into namespace */ -SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L, swig_lua_namespace* ns) +SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns) { - int i = 0; + int i; + /* There must be namespace table (not metatable) at the top of the stack */ assert(lua_istable(L,-1)); - /* There must be table at the top of the stack */ SWIG_Lua_InstallConstants(L, ns->ns_constants); + /* add methods to the namespace/module table */ + for(i=0;ns->ns_methods[i].name;i++){ + SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].func); + } lua_getmetatable(L,-1); /* add fns */ for(i=0;ns->ns_attributes[i].name;i++){ - SWIG_Lua_add_class_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); - } - - /* add methods to the metatable */ - SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ - assert(lua_istable(L,-1)); /* just in case */ - for(i=0;ns->ns_methods[i].name;i++){ - SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].method); + SWIG_Lua_add_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); } - lua_pop(L,1); /* clear stack - remove metatble */ lua_pop(L,1); return 0; } -/* helper function. creates namespace table and add it to module table */ -SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns) +/* Register all classes in the namespace */ +SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns) +{ + swig_lua_class **classes; + + /* There must be a module/namespace table at the top of the stack */ + assert(lua_istable(L,-1)); + + classes = ns->ns_classes; + + if( classes != 0 ) { + while(*classes != 0) { + SWIG_Lua_class_register(L, *classes); + classes++; + } + } +} + +/* Helper function. Creates namespace table and adds it to module table + if 'reg' is true, then will register namespace table to parent one (must be on top of the stack + when function is called). + Function always returns newly registered table on top of the stack. +*/ +SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg) { - assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table */ + swig_lua_namespace **sub_namespace; + /* 1 argument - table on the top of the stack */ + const int SWIGUNUSED begin = lua_gettop(L); + assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */ lua_checkstack(L,5); - lua_pushstring(L, ns->name); lua_newtable(L); /* namespace itself */ lua_newtable(L); /* metatable for namespace */ @@ -1274,117 +1417,348 @@ SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns) SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set); lua_setmetatable(L,-2); /* set metatable */ - lua_rawset(L,-3); /* add namespace to module table */ - return 0; + + /* Register all functions, variables etc */ + SWIG_Lua_add_namespace_details(L,ns); + /* Register classes */ + SWIG_Lua_add_namespace_classes(L,ns); + + sub_namespace = ns->ns_namespaces; + if( sub_namespace != 0) { + while(*sub_namespace != 0) { + SWIG_Lua_namespace_register(L, *sub_namespace, 1); + lua_pop(L,1); /* removing sub-namespace table */ + sub_namespace++; + } + } + + if (reg) { + lua_pushstring(L,ns->name); + lua_pushvalue(L,-2); + lua_rawset(L,-4); /* add namespace to module table */ + } + assert(lua_gettop(L) == begin+1); } +#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ + /* ----------------------------------------------------------------------------- * global variable support code: classes * ----------------------------------------------------------------------------- */ -/* the class.get method, performs the lookup of class attributes */ -SWIGINTERN int SWIG_Lua_class_get(lua_State* L) +SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname); + +typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret); + +SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type, + int first_arg, swig_lua_base_iterator_func func, int *const ret) +{ + /* first_arg - position of the object in stack. Everything that is above are arguments + * and is passed to every evocation of the func */ + int last_arg = lua_gettop(L);/* position of last argument */ + int original_metatable = last_arg + 1; + size_t bases_count; + int result = SWIG_ERROR; + int bases_table; + (void)swig_type; + lua_getmetatable(L,first_arg); + + /* initialise base search */ +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + SWIG_Lua_get_table(L,".bases"); + assert(lua_istable(L,-1)); + bases_count = lua_rawlen(L,-1); + bases_table = lua_gettop(L); +#else + /* In elua .bases table doesn't exist. Use table from swig_lua_class */ + (void)bases_table; + assert(swig_type!=0); + swig_module_info *module=SWIG_GetModule(L); + swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases; + const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names; + bases_count = 0; + for(;base_names[bases_count]; + bases_count++);/* get length of bases */ +#endif + + if(ret) + *ret = 0; + if(bases_count>0) + { + int to_remove; + size_t i; + int j; + int subcall_last_arg; + int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */ + int valid = 1; + swig_type_info *base_swig_type = 0; + for(j=first_arg;j<=last_arg;j++) + lua_pushvalue(L,j); + subcall_last_arg = lua_gettop(L); + + /* Trick: temporarily replacing original metatable with metatable for base class and call getter */ + for(i=0;ifqname); + base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]); + assert(base_swig_type != 0); + } +#endif + + if(!valid) + continue; + assert(lua_isuserdata(L, subcall_first_arg)); + assert(lua_istable(L,-1)); + lua_setmetatable(L,subcall_first_arg); /* Set new metatable */ + assert(lua_gettop(L) == subcall_last_arg); + result = func(L, base_swig_type,subcall_first_arg, ret); /* Forward call */ + if(result != SWIG_ERROR) { + break; + } + } + /* Restore original metatable */ + lua_pushvalue(L,original_metatable); + lua_setmetatable(L,first_arg); + /* Clear - remove everything between last_arg and subcall_last_arg including */ + to_remove = subcall_last_arg - last_arg; + for(j=0;jtype; + result = SWIG_Lua_class_do_get(L,type,1,&ret); + if(result == SWIG_OK) + return ret; + + result = SWIG_Lua_class_do_get_item(L,type,1,&ret); + if(result == SWIG_OK) + return ret; + + return 0; } -/* the class.set method, performs the lookup of class attributes */ -SWIGINTERN int SWIG_Lua_class_set(lua_State* L) +/* helper for the class.set method, performs the lookup of class attributes + * It returns error code. Number of function return values is passed inside 'ret' + */ +SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret) { /* there should be 3 params passed in (1) table (not the meta table) (2) string name of the attribute (3) any for the new value -printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n", - lua_topointer(L,1),lua_typename(L,lua_type(L,1)), - lua_tostring(L,2), - lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/ + */ - assert(lua_isuserdata(L,1)); /* just in case */ - lua_getmetatable(L,1); /* get the meta table */ + int bases_search_result; + int substack_start = lua_gettop(L) - 3; + lua_checkstack(L,5); + assert(lua_isuserdata(L,substack_start+1)); /* just in case */ + lua_getmetatable(L,substack_start+1); /* get the meta table */ assert(lua_istable(L,-1)); /* just in case */ + if(ret) + *ret = 0; /* it is setter - number of return values is always 0 */ SWIG_Lua_get_table(L,".set"); /* find the .set table */ if (lua_istable(L,-1)) { /* look for the key in the .set table */ - lua_pushvalue(L,2); /* key */ + lua_pushvalue(L,substack_start+2); /* key */ lua_rawget(L,-2); + lua_remove(L,-2); /* tidy stack, remove .set table */ if (lua_iscfunction(L,-1)) { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* userdata */ - lua_pushvalue(L,3); /* value */ + lua_pushvalue(L,substack_start+1); /* userdata */ + lua_pushvalue(L,substack_start+3); /* value */ lua_call(L,2,0); - return 0; + lua_remove(L,substack_start+4); /*remove metatable*/ + return SWIG_OK; } lua_pop(L,1); /* remove the value */ + } else { + lua_pop(L,1); /* remove the answer for .set table request*/ } - lua_pop(L,1); /* remove the value .set table */ /* NEW: looks for the __setitem() fn this is a user provided set fn */ SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ if (lua_iscfunction(L,-1)) /* if its there */ { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* the userdata */ - lua_pushvalue(L,2); /* the parameter */ - lua_pushvalue(L,3); /* the value */ + lua_pushvalue(L,substack_start+1); /* the userdata */ + lua_pushvalue(L,substack_start+2); /* the parameter */ + lua_pushvalue(L,substack_start+3); /* the value */ lua_call(L,3,0); /* 3 values in ,0 out */ lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; + return SWIG_OK; + } + lua_pop(L,1); /* remove value */ + + lua_pop(L,1); /* remove metatable */ + /* Search among bases */ + bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret); + if(ret) + assert(*ret == 0); + assert(lua_gettop(L) == substack_start + 3); + return bases_search_result; +} + +/* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly + * handles return values. + */ +SWIGINTERN int SWIG_Lua_class_set(lua_State *L) +{ +/* There should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value + */ + int ret = 0; + int result; + swig_lua_userdata *usr; + swig_type_info *type; + assert(lua_isuserdata(L,1)); + usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + type = usr->type; + result = SWIG_Lua_class_do_set(L,type,1,&ret); + if(result != SWIG_OK) { + SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method."); + lua_error(L); + } else { + assert(ret==0); } return 0; } /* the class.destruct method called by the interpreter */ -SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L) +SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L) { /* there should be 1 params passed in (1) userdata (not the meta table) */ - swig_lua_userdata* usr; - swig_lua_class* clss; + swig_lua_userdata *usr; + swig_lua_class *clss; assert(lua_isuserdata(L,-1)); /* just in case */ usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ /* if must be destroyed & has a destructor */ @@ -1400,31 +1774,30 @@ SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L) } /* the class.__tostring method called by the interpreter and print */ -SWIGINTERN int SWIG_Lua_class_tostring(lua_State* L) +SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L) { /* there should be 1 param passed in (1) userdata (not the metatable) */ + const char *className; + void* userData; assert(lua_isuserdata(L,1)); /* just in case */ - unsigned long userData = (unsigned long)lua_touserdata(L,1); /* get the userdata address for later */ + userData = lua_touserdata(L,1); /* get the userdata address for later */ lua_getmetatable(L,1); /* get the meta table */ assert(lua_istable(L,-1)); /* just in case */ - + lua_getfield(L, -1, ".type"); - const char* className = lua_tostring(L, -1); - - char output[256]; - sprintf(output, "<%s userdata: %lX>", className, userData); - - lua_pushstring(L, (const char*)output); + className = lua_tostring(L, -1); + + lua_pushfstring(L, "<%s userdata: %p>", className, userData); return 1; } /* to manually disown some userdata */ -SWIGINTERN int SWIG_Lua_class_disown(lua_State* L) +SWIGINTERN int SWIG_Lua_class_disown(lua_State *L) { /* there should be 1 params passed in (1) userdata (not the meta table) */ - swig_lua_userdata* usr; + swig_lua_userdata *usr; assert(lua_isuserdata(L,-1)); /* just in case */ usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ @@ -1432,25 +1805,69 @@ SWIGINTERN int SWIG_Lua_class_disown(lua_State* L) return 0; } -/* Constructor proxy. Used when class name entry in module is not class constructor, -but special table instead. */ -SWIGINTERN int SWIG_Lua_constructor_proxy(lua_State* L) +/* lua callable function to compare userdata's value +the issue is that two userdata may point to the same thing +but to lua, they are different objects */ +SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L) { - /* unlimited number of parameters - First one is our proxy table and we should remove it - Other we should pass to real constructor - */ - assert(lua_istable(L,1)); - lua_pushstring(L,".constructor"); - lua_rawget(L,1); - assert(!lua_isnil(L,-1)); - lua_replace(L,1); /* replace our table with real constructor */ - lua_call(L,lua_gettop(L)-1,1); - return 1; -} + int result; + swig_lua_userdata *usr1,*usr2; + if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ + return 0; /* nil reply */ + usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ + /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ + result=(usr1->ptr==usr2->ptr); + lua_pushboolean(L,result); + return 1; +} + +/* populate table at the top of the stack with metamethods that ought to be inherited */ +SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L) +{ + SWIG_Lua_add_boolean(L, "__add", 1); + SWIG_Lua_add_boolean(L, "__sub", 1); + SWIG_Lua_add_boolean(L, "__mul", 1); + SWIG_Lua_add_boolean(L, "__div", 1); + SWIG_Lua_add_boolean(L, "__mod", 1); + SWIG_Lua_add_boolean(L, "__pow", 1); + SWIG_Lua_add_boolean(L, "__unm", 1); + SWIG_Lua_add_boolean(L, "__len", 1 ); + SWIG_Lua_add_boolean(L, "__concat", 1 ); + SWIG_Lua_add_boolean(L, "__eq", 1); + SWIG_Lua_add_boolean(L, "__lt", 1); + SWIG_Lua_add_boolean(L, "__le", 1); + SWIG_Lua_add_boolean(L, "__call", 1); + SWIG_Lua_add_boolean(L, "__tostring", 1); + SWIG_Lua_add_boolean(L, "__gc", 0); +} + +/* creates the swig registry */ +SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L) +{ + /* create main SWIG registry table */ + lua_pushstring(L,"SWIG"); + lua_newtable(L); + /* populate it with some predefined data */ -/* gets the swig class registry (or creates it) */ -SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L) + /* .library table. Placeholder */ + lua_pushstring(L,".library"); + lua_newtable(L); + { + /* list of metamethods that class inherits from its bases */ + lua_pushstring(L,"inheritable_metamethods"); + lua_newtable(L); + /* populate with list of metamethods */ + SWIG_Lua_populate_inheritable_metamethods(L); + lua_rawset(L,-3); + } + lua_rawset(L,-3); + + lua_rawset(L,LUA_REGISTRYINDEX); +} + +/* gets the swig registry (or creates it) */ +SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L) { /* add this all into the swig registry: */ lua_pushstring(L,"SWIG"); @@ -1458,17 +1875,29 @@ SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L) if (!lua_istable(L,-1)) /* not there */ { /* must be first time, so add it */ lua_pop(L,1); /* remove the result */ - lua_pushstring(L,"SWIG"); - lua_newtable(L); - lua_rawset(L,LUA_REGISTRYINDEX); + SWIG_Lua_create_class_registry(L); /* then get it */ lua_pushstring(L,"SWIG"); lua_rawget(L,LUA_REGISTRYINDEX); } } -/* helper fn to get the classes metatable from the register */ -SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname) +SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L) +{ + SWIG_Lua_get_class_registry(L); + lua_pushstring(L, ".library"); + lua_rawget(L,-2); + assert( !lua_isnil(L,-1) ); + lua_pushstring(L, "inheritable_metamethods"); + lua_rawget(L,-2); + + /* Remove class registry and library table */ + lua_remove(L,-2); + lua_remove(L,-2); +} + +/* Helper function to get the classes metatable from the register */ +SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname) { SWIG_Lua_get_class_registry(L); /* get the registry */ lua_pushstring(L,cname); /* get the name */ @@ -1476,8 +1905,96 @@ SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname) lua_remove(L,-2); /* tidy up (remove registry) */ } +/* Set up the base classes pointers. +Each class structure has a list of pointers to the base class structures. +This function fills them. +It cannot be done at compile time, as this will not work with hireachies +spread over more than one swig file. +Therefore it must be done at runtime, querying the SWIG type system. +*/ +SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss) +{ + int i=0; + swig_module_info *module=SWIG_GetModule(L); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* not found yet */ + { + /* lookup and cache the base class */ + swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); + if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; + } + } +} + +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) +/* Merges two tables */ +SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source) +{ + /* iterating */ + lua_pushnil(L); + while (lua_next(L,source) != 0) { + /* -1 - value, -2 - index */ + /* have to copy to assign */ + lua_pushvalue(L,-2); /* copy of index */ + lua_pushvalue(L,-2); /* copy of value */ + lua_rawset(L, target); + lua_pop(L,1); + /* only key is left */ + } +} + +/* Merges two tables with given name. original - index of target metatable, base - index of source metatable */ +SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base) +{ + /* push original[name], then base[name] */ + lua_pushstring(L,name); + lua_rawget(L,original); + int original_table = lua_gettop(L); + lua_pushstring(L,name); + lua_rawget(L,base); + int base_table = lua_gettop(L); + SWIG_Lua_merge_tables_by_index(L, original_table, base_table); + /* clearing stack */ + lua_pop(L,2); +} + +/* Function takes all symbols from base and adds it to derived class. It's just a helper. */ +SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls) +{ + /* There is one parameter - original, i.e. 'derived' class metatable */ + assert(lua_istable(L,-1)); + int original = lua_gettop(L); + SWIG_Lua_get_class_metatable(L,base_cls->fqname); + int base = lua_gettop(L); + SWIG_Lua_merge_tables(L, ".fn", original, base ); + SWIG_Lua_merge_tables(L, ".set", original, base ); + SWIG_Lua_merge_tables(L, ".get", original, base ); + lua_pop(L,1); +} + +/* Function squashes all symbols from 'clss' bases into itself */ +SWIGINTERN void SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss) +{ + int i; + SWIG_Lua_get_class_metatable(L,clss->fqname); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* Somehow it's not found. Skip it */ + continue; + /* Thing is: all bases are already registered. Thus they have already executed + * this function. So we just need to squash them into us, because their bases + * are already squashed into them. No need for recursion here! + */ + SWIG_Lua_class_squash_base(L, clss->bases[i]); + } + lua_pop(L,1); /*tidy stack*/ +} +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ /* helper add a variable to a registered class */ -SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) +SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn) { assert(lua_istable(L,-1)); /* just in case */ SWIG_Lua_get_table(L,".get"); /* find the .get table */ @@ -1494,7 +2011,7 @@ SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_C } /* helper to recursively add class static details (static attributes, operations and constants) */ -SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State* L, swig_lua_class* clss) +SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss) { int i = 0; /* The class namespace table must be on the top of the stack */ @@ -1505,72 +2022,269 @@ SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State* L, swig_lua_class* SWIG_Lua_add_class_static_details(L,clss->bases[i]); } - SWIG_Lua_add_namespace_details(L, &clss->cls_static); + SWIG_Lua_add_namespace_details(L, clss->cls_static); } +SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */ + /* helper to recursively add class details (attributes & operations) */ -SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss) +SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss) { int i; - /* call all the base classes first: we can then override these later: */ + size_t bases_count = 0; + /* Add bases to .bases table */ + SWIG_Lua_get_table(L,".bases"); + assert(lua_istable(L,-1)); /* just in case */ for(i=0;clss->bases[i];i++) { - SWIG_Lua_add_class_details(L,clss->bases[i]); - } - /* add fns */ + SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); + /* Base class must be already registered */ + assert(lua_istable(L,-1)); + lua_rawseti(L,-2,i+1); /* In lua indexing starts from 1 */ + bases_count++; + } + assert(lua_rawlen(L,-1) == bases_count); + lua_pop(L,1); /* remove .bases table */ + /* add attributes */ for(i=0;clss->attributes[i].name;i++){ - SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); + SWIG_Lua_add_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); } /* add methods to the metatable */ SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ assert(lua_istable(L,-1)); /* just in case */ for(i=0;clss->methods[i].name;i++){ - SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].func); } lua_pop(L,1); /* tidy stack (remove table) */ - /* add operator overloads - these look ANY method which start with "__" and assume they - are operator overloads & add them to the metatable - (this might mess up is someone defines a method __gc (the destructor)*/ - for(i=0;clss->methods[i].name;i++){ - if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){ - SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + /* add operator overloads + This adds methods from metatable array to metatable. Can mess up garbage + collectind if someone defines __gc method + */ + if(clss->metatable) { + for(i=0;clss->metatable[i].name;i++) { + SWIG_Lua_add_function(L,clss->metatable[i].name,clss->metatable[i].func); } } + +#if !defined(SWIG_LUA_SQUASH_BASES) + /* Adding metamethods that are defined in base classes. If bases were squashed + * then it is obviously unnecessary + */ + SWIG_Lua_add_class_user_metamethods(L, clss); +#endif } -/* set up the base classes pointers. -Each class structure has a list of pointers to the base class structures. -This function fills them. -It cannot be done at compile time, as this will not work with hireachies -spread over more than one swig file. -Therefore it must be done at runtime, querying the SWIG type system. +/* Helpers to add user defined class metamedhods - __add, __sub etc. The helpers are needed + for the following issue: Lua runtime checks for metamethod existence with rawget function + ignoring our SWIG-provided __index and __newindex functions. Thus our inheritance-aware method + search algorithm doesn't work in such case. (Not to say that Lua runtime queries metamethod directly + in metatable and not in object). + Current solution is this: if somewhere in hierarchy metamethod __x is defined, then all descendants + are automatically given a special proxy __x that calls the real __x method. + Obvious idea - to copy __x instead of creating __x-proxy is wrong because if someone changes __x in runtime, + those changes must be reflected in all descendants. */ -SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss) + +SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/ + +/* The real function that resolves a metamethod. + * Function searches given class and all it's bases(recursively) for first instance of something that is + * not equal to SWIG_Lua_resolve_metatmethod. (Almost always this 'something' is actual metamethod implementation + * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the + * answer. + * Returns 1 if found, 0 otherwise. + * clss is class which metatable we will search for method + * metamethod_name_idx is index in L where metamethod name (as string) lies + * skip_check allows to skip searching metamethod in givel clss and immideatelly go to searching in bases. skip_check + * is not caried to subsequent recursive calls - false is always passed. It is set to true only at first call from + * SWIG_Lua_resolve_metamethod + * */ +SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx, + int skip_check) { - int i=0; - swig_module_info* module=SWIG_GetModule(L); - for(i=0;clss->base_names[i];i++) + /* This function is called recursively */ + int result = 0; + int i = 0; + + if (!skip_check) { + SWIG_Lua_get_class_metatable(L, clss->fqname); + lua_pushvalue(L, metamethod_name_idx); + lua_rawget(L,-2); + /* If this is cfunction and it is equal to SWIG_Lua_resolve_metamethod then + * this isn't the function we are looking for :) + * lua_tocfunction will return NULL if not cfunction + */ + if (!lua_isnil(L,-1) && lua_tocfunction(L,-1) != SWIG_Lua_resolve_metamethod ) { + lua_remove(L,-2); /* removing class metatable */ + return 1; + } + lua_pop(L,2); /* remove class metatable and query result */ + } + + /* Forwarding calls to bases */ + for(i=0;clss->bases[i];i++) { - if (clss->bases[i]==0) /* not found yet */ - { - /* lookup and cache the base class */ - swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); - if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; + result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0); + if (result) + break; + } + + return result; +} + +/* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method + * and calls it */ +SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L) +{ + int numargs; + int metamethod_name_idx; + const swig_lua_class* clss; + int result; + + lua_checkstack(L,5); + numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */ + + /* Get upvalues from closure */ + lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/ + metamethod_name_idx = lua_gettop(L); + + lua_pushvalue(L, lua_upvalueindex(2)); + clss = (const swig_lua_class*)(lua_touserdata(L,-1)); + lua_pop(L,1); /* remove lightuserdata with clss from stack */ + + /* Actual work */ + result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1); + if (!result) { + SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation."); + lua_error(L); + return 0; + } + + lua_remove(L,-2); /* remove metamethod key */ + lua_insert(L,1); /* move function to correct position */ + lua_call(L, numargs, LUA_MULTRET); + return lua_gettop(L); /* return all results */ +} + + +/* If given metamethod must be present in given class, then creates appropriate proxy + * Returns 1 if successfully added, 0 if not added because no base class has it, -1 + * if method is defined in the class metatable itself + */ +SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index) +{ + int key_index; + int success = 0; + int i = 0; + + /* metamethod name - on the top of the stack */ + assert(lua_isstring(L,-1)); + + key_index = lua_gettop(L); + + /* Check whether method is already defined in metatable */ + lua_pushvalue(L,key_index); /* copy of the key */ + lua_gettable(L,metatable_index); + if( !lua_isnil(L,-1) ) { + lua_pop(L,1); + return -1; + } + lua_pop(L,1); + + /* Iterating over immediate bases */ + for(i=0;clss->bases[i];i++) + { + const swig_lua_class *base = clss->bases[i]; + SWIG_Lua_get_class_metatable(L, base->fqname); + lua_pushvalue(L, key_index); + lua_rawget(L, -2); + if( !lua_isnil(L,-1) ) { + lua_pushvalue(L, key_index); + + /* Add proxy function */ + lua_pushvalue(L, key_index); /* first closure value is function name */ + lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */ + lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2); + + lua_rawset(L, metatable_index); + success = 1; + } + lua_pop(L,1); /* remove function or nil */ + lua_pop(L,1); /* remove base class metatable */ + + if( success ) + break; + } + + return success; +} + +SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss) +{ + int metatable_index; + int metamethods_info_index; + int tostring_undefined; + int eq_undefined = 0; + + SWIG_Lua_get_class_metatable(L, clss->fqname); + metatable_index = lua_gettop(L); + SWIG_Lua_get_inheritable_metamethods(L); + assert(lua_istable(L,-1)); + metamethods_info_index = lua_gettop(L); + lua_pushnil(L); /* first key */ + while(lua_next(L, metamethods_info_index) != 0 ) { + /* key at index -2, value at index -1 */ + const int is_inheritable = lua_toboolean(L,-2); + lua_pop(L,1); /* remove value - we don't need it anymore */ + + if(is_inheritable) { /* if metamethod is inheritable */ + SWIG_Lua_add_class_user_metamethod(L,clss,metatable_index); } } + + lua_pop(L,1); /* remove inheritable metatmethods table */ + + /* Special handling for __tostring method */ + lua_pushstring(L, "__tostring"); + lua_pushvalue(L,-1); + lua_rawget(L,metatable_index); + tostring_undefined = lua_isnil(L,-1); + lua_pop(L,1); + if( tostring_undefined ) { + lua_pushcfunction(L, SWIG_Lua_class_tostring); + lua_rawset(L, metatable_index); + } else { + lua_pop(L,1); /* remove copy of the key */ + } + + /* Special handling for __eq method */ + lua_pushstring(L, "__eq"); + lua_pushvalue(L,-1); + lua_rawget(L,metatable_index); + eq_undefined = lua_isnil(L,-1); + lua_pop(L,1); + if( eq_undefined ) { + lua_pushcfunction(L, SWIG_Lua_class_equal); + lua_rawset(L, metatable_index); + } else { + lua_pop(L,1); /* remove copy of the key */ + } + /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[] + * a __getitem/__setitem method should be defined + */ + lua_pop(L,1); /* pop class metatable */ } /* Register class static methods,attributes etc as well as constructor proxy */ -SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* clss) +SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss) { + const int SWIGUNUSED begin = lua_gettop(L); lua_checkstack(L,5); /* just in case */ assert(lua_istable(L,-1)); /* just in case */ - assert(strcmp(clss->name, clss->cls_static.name) == 0); /* in class those 2 must be equal */ + assert(strcmp(clss->name, clss->cls_static->name) == 0); /* in class those 2 must be equal */ - SWIG_Lua_namespace_register(L,&clss->cls_static); + SWIG_Lua_namespace_register(L,clss->cls_static, 1); - SWIG_Lua_get_table(L,clss->name); // Get namespace table back assert(lua_istable(L,-1)); /* just in case */ /* add its constructor to module with the name of the class @@ -1579,10 +2293,9 @@ SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* cls (this overcomes the problem of pure virtual classes without constructors)*/ if (clss->constructor) { - SWIG_Lua_add_function(L,".constructor", clss->constructor); lua_getmetatable(L,-1); assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,"__call", SWIG_Lua_constructor_proxy); + SWIG_Lua_add_function(L,"__call", clss->constructor); lua_pop(L,1); } @@ -1591,19 +2304,60 @@ SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* cls /* clear stack */ lua_pop(L,1); + assert( lua_gettop(L) == begin ); } -/* performs the entire class registration process */ -SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss) +/* Performs the instance (non-static) class registration process. Metatable for class is created + * and added to the class registry. + */ +SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss) { - SWIG_Lua_class_register_static(L,clss); - + const int SWIGUNUSED begin = lua_gettop(L); + int i; + /* if name already there (class is already registered) then do nothing */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + lua_rawget(L,-2); + if(!lua_isnil(L,-1)) { + lua_pop(L,2); + assert(lua_gettop(L)==begin); + return; + } + lua_pop(L,2); /* tidy stack */ + /* Recursively initialize all bases */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_class_register_instance(L,clss->bases[i]); + } + /* Again, get registry and push name */ SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->name); /* get the name */ + lua_pushstring(L,clss->fqname); /* get the name */ lua_newtable(L); /* create the metatable */ +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + /* If squashing is requested, then merges all bases metatable into this one. + * It would get us all special methods: __getitem, __add etc. + * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away + */ + { + int new_metatable_index = lua_absindex(L,-1); + for(i=0;clss->bases[i];i++) + { + int base_metatable; + SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); + base_metatable = lua_absindex(L,-1); + SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable); + lua_pop(L,1); + } + } + /* And now we will overwrite all incorrectly set data */ +#endif /* add string of class name called ".type" */ lua_pushstring(L,".type"); - lua_pushstring(L,clss->name); + lua_pushstring(L,clss->fqname); + lua_rawset(L,-3); + /* add a table called bases */ + lua_pushstring(L,".bases"); + lua_newtable(L); lua_rawset(L,-3); /* add a table called ".get" */ lua_pushstring(L,".get"); @@ -1623,27 +2377,99 @@ SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss) SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); - /* add tostring method for better output */ - SWIG_Lua_add_function(L,"__tostring",SWIG_Lua_class_tostring); /* add it */ lua_rawset(L,-3); /* metatable into registry */ lua_pop(L,1); /* tidy stack (remove registry) */ + assert(lua_gettop(L) == begin); - SWIG_Lua_get_class_metatable(L,clss->name); - SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */ +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + /* Now merge all symbols from .fn, .set, .get etc from bases to our tables */ + SWIG_Lua_class_squash_bases(L,clss); +#endif + SWIG_Lua_get_class_metatable(L,clss->fqname); + SWIG_Lua_add_class_instance_details(L,clss); /* recursive adding of details (atts & ops) */ lua_pop(L,1); /* tidy stack (remove class metatable) */ + assert( lua_gettop(L) == begin ); +} + +SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss) +{ + int SWIGUNUSED begin; + assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */ + SWIG_Lua_class_register_instance(L,clss); + SWIG_Lua_class_register_static(L,clss); + + /* Add links from static part to instance part and vice versa */ + /* [SWIG registry] [Module] + * "MyClass" ----> [MyClass metatable] <===== "MyClass" -+> [static part] + * ".get" ----> ... | | getmetatable()----| + * ".set" ----> ... | | | + * ".static" --------------)----------------/ [static part metatable] + * | ".get" --> ... + * | ".set" --> .... + * |=============================== ".instance" + */ + begin = lua_gettop(L); + lua_pushstring(L,clss->cls_static->name); + lua_rawget(L,-2); /* get class static table */ + assert(lua_istable(L,-1)); + lua_getmetatable(L,-1); + assert(lua_istable(L,-1)); /* get class static metatable */ + lua_pushstring(L,".instance"); /* prepare key */ + + SWIG_Lua_get_class_metatable(L,clss->fqname); /* get class metatable */ + assert(lua_istable(L,-1)); + lua_pushstring(L,".static"); /* prepare key */ + lua_pushvalue(L, -4); /* push static class TABLE */ + assert(lua_istable(L,-1)); + lua_rawset(L,-3); /* assign static class table(!NOT metatable) as ".static" member of class metatable */ + lua_rawset(L,-3); /* assign class metatable as ".instance" member of class static METATABLE */ + lua_pop(L,2); + assert(lua_gettop(L) == begin); +} +#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss) +{ + const int SWIGUNUSED begin = lua_gettop(L); + int i; + /* if name already there (class is already registered) then do nothing */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + lua_rawget(L,-2); + if(!lua_isnil(L,-1)) { + lua_pop(L,2); + assert(lua_gettop(L)==begin); + return; + } + lua_pop(L,2); /* tidy stack */ + /* Recursively initialize all bases */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_elua_class_register_instance(L,clss->bases[i]); + } + /* Again, get registry and push name */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + assert(clss->metatable); + lua_pushrotable(L, (void*)(clss->metatable)); /* create the metatable */ + lua_rawset(L,-3); + lua_pop(L,1); + assert(lua_gettop(L) == begin); } +#endif /* elua && eluac */ /* ----------------------------------------------------------------------------- * Class/structure conversion fns * ----------------------------------------------------------------------------- */ /* helper to add metatable to new lua object */ -SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type) +SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L,swig_type_info *type) { if (type->clientdata) /* there is clientdata: so add the metatable */ { - SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name); + SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->fqname); if (lua_istable(L,-1)) { lua_setmetatable(L,-2); @@ -1656,9 +2482,9 @@ SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type) } /* pushes a new object into the lua stack */ -SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own) +SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own) { - swig_lua_userdata* usr; + swig_lua_userdata *usr; if (!ptr){ lua_pushnil(L); return; @@ -1668,15 +2494,15 @@ SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *t usr->type=type; usr->own=own; #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) - _SWIG_Lua_AddMetatable(L,type); /* add metatable */ + SWIG_Lua_AddMetatable(L,type); /* add metatable */ #endif } /* takes a object from the lua stack & converts it into an object of the correct type (if possible) */ -SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags) +SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type_info *type,int flags) { - swig_lua_userdata* usr; + swig_lua_userdata *usr; swig_cast_info *cast; if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */ usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ @@ -1703,9 +2529,9 @@ SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type return SWIG_ERROR; /* error */ } -SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags, - int argnum,const char* func_name){ - void* result; +SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State *L,int index,swig_type_info *type,int flags, + int argnum,const char *func_name){ + void *result; if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ luaL_error (L,"Error in %s, expected a %s at argument number %d\n", func_name,(type && type->str)?type->str:"void*",argnum); @@ -1714,21 +2540,21 @@ SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *typ } /* pushes a packed userdata. user for member fn pointers only */ -SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type) +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type) { - swig_lua_rawdata* raw; + swig_lua_rawdata *raw; assert(ptr); /* not acceptable to pass in a NULL value */ raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ raw->type=type; raw->own=0; memcpy(raw->data,ptr,size); /* copy the data */ - _SWIG_Lua_AddMetatable(L,type); /* add metatable */ + SWIG_Lua_AddMetatable(L,type); /* add metatable */ } /* converts a packed userdata. user for member fn pointers only */ -SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type) +SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type) { - swig_lua_rawdata* raw; + swig_lua_rawdata *raw; raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ if (!raw) return SWIG_ERROR; /* error */ if (type==0 || type==raw->type) /* void* or identical type */ @@ -1742,7 +2568,7 @@ SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t /* a function to get the typestring of a piece of data */ SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) { - swig_lua_userdata* usr; + swig_lua_userdata *usr; if (lua_isuserdata(L,tp)) { usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */ @@ -1754,29 +2580,12 @@ SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) } /* lua callable function to get the userdata's type */ -SWIGRUNTIME int SWIG_Lua_type(lua_State* L) +SWIGRUNTIME int SWIG_Lua_type(lua_State *L) { lua_pushstring(L,SWIG_Lua_typename(L,1)); return 1; } -/* lua callable function to compare userdata's value -the issue is that two userdata may point to the same thing -but to lua, they are different objects */ -SWIGRUNTIME int SWIG_Lua_equal(lua_State* L) -{ - int result; - swig_lua_userdata *usr1,*usr2; - if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ - return 0; /* nil reply */ - usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ - /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ - result=(usr1->ptr==usr2->ptr); - lua_pushboolean(L,result); - return 1; -} - /* ----------------------------------------------------------------------------- * global variable support code: class/struct typemap functions * ----------------------------------------------------------------------------- */ @@ -1784,13 +2593,13 @@ SWIGRUNTIME int SWIG_Lua_equal(lua_State* L) #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) /* Install Constants */ SWIGINTERN void -SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { +SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) { int i; for (i = 0; constants[i].type; i++) { switch(constants[i].type) { case SWIG_LUA_INT: lua_pushstring(L,constants[i].name); - lua_pushnumber(L,(lua_Number)constants[i].lvalue); + lua_pushinteger(L,(lua_Number)constants[i].lvalue); lua_rawset(L,-3); break; case SWIG_LUA_FLOAT: @@ -1800,7 +2609,10 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { break; case SWIG_LUA_CHAR: lua_pushstring(L,constants[i].name); - lua_pushfstring(L,"%c",(char)constants[i].lvalue); + { + char c = constants[i].lvalue; + lua_pushlstring(L,&c,1); + } lua_rawset(L,-3); break; case SWIG_LUA_STRING: @@ -1834,11 +2646,11 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { #endif /* Executes a C string in Lua which is a really simple way of calling lua from C Unfortunately lua keeps changing its APIs, so we need a conditional compile -In lua 5.0.X its lua_dostring() -In lua 5.1.X its luaL_dostring() +In lua 5.0.X it's lua_dostring() +In lua 5.1.X it's luaL_dostring() */ SWIGINTERN int -SWIG_Lua_dostring(lua_State *L, const char* str) { +SWIG_Lua_dostring(lua_State *L, const char *str) { int ok,top; if (str==0 || str[0]==0) return 0; /* nothing to do */ top=lua_gettop(L); /* save stack */ @@ -2121,27 +2933,51 @@ static void swig_delete_PARSE_EVENT_STRUCT(void *obj) { PARSE_EVENT_STRUCT *arg1 = (PARSE_EVENT_STRUCT *) obj; delete arg1; } -static swig_lua_method swig_PARSE_EVENT_STRUCT_methods[] = { - {0,0} -}; +static int _proxy__wrap_new_PARSE_EVENT_STRUCT(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_PARSE_EVENT_STRUCT); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_PARSE_EVENT_STRUCT_attributes[] = { - { "event", _wrap_PARSE_EVENT_STRUCT_event_get, _wrap_PARSE_EVENT_STRUCT_event_set}, - { "i", _wrap_PARSE_EVENT_STRUCT_i_get, _wrap_PARSE_EVENT_STRUCT_i_set}, - { "text", _wrap_PARSE_EVENT_STRUCT_text_get, _wrap_PARSE_EVENT_STRUCT_text_set}, + { "event", _wrap_PARSE_EVENT_STRUCT_event_get, _wrap_PARSE_EVENT_STRUCT_event_set }, + { "i", _wrap_PARSE_EVENT_STRUCT_i_get, _wrap_PARSE_EVENT_STRUCT_i_set }, + { "text", _wrap_PARSE_EVENT_STRUCT_text_get, _wrap_PARSE_EVENT_STRUCT_text_set }, {0,0,0} }; -static swig_lua_attribute swig_PARSE_EVENT_STRUCT_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_PARSE_EVENT_STRUCT_methods[]= { + {0,0} }; -static swig_lua_method swig_PARSE_EVENT_STRUCT_cls_methods[] = { +static swig_lua_method swig_PARSE_EVENT_STRUCT_meta[] = { {0,0} }; -static swig_lua_const_info swig_PARSE_EVENT_STRUCT_cls_constants[] = { + +static swig_lua_attribute swig_PARSE_EVENT_STRUCT_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_PARSE_EVENT_STRUCT_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_PARSE_EVENT_STRUCT_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_PARSE_EVENT_STRUCT_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_PARSE_EVENT_STRUCT_Sf_SwigStatic = { + "PARSE_EVENT_STRUCT", + swig_PARSE_EVENT_STRUCT_Sf_SwigStatic_methods, + swig_PARSE_EVENT_STRUCT_Sf_SwigStatic_attributes, + swig_PARSE_EVENT_STRUCT_Sf_SwigStatic_constants, + swig_PARSE_EVENT_STRUCT_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_PARSE_EVENT_STRUCT_bases[] = {0}; static const char *swig_PARSE_EVENT_STRUCT_base_names[] = {0}; -static swig_lua_class _wrap_class_PARSE_EVENT_STRUCT = { "PARSE_EVENT_STRUCT", &SWIGTYPE_p_PARSE_EVENT_STRUCT,_wrap_new_PARSE_EVENT_STRUCT, swig_delete_PARSE_EVENT_STRUCT, swig_PARSE_EVENT_STRUCT_methods, swig_PARSE_EVENT_STRUCT_attributes, { "PARSE_EVENT_STRUCT", swig_PARSE_EVENT_STRUCT_cls_methods, swig_PARSE_EVENT_STRUCT_cls_attributes, swig_PARSE_EVENT_STRUCT_cls_constants }, swig_PARSE_EVENT_STRUCT_bases, swig_PARSE_EVENT_STRUCT_base_names }; +static swig_lua_class _wrap_class_PARSE_EVENT_STRUCT = { "PARSE_EVENT_STRUCT", "PARSE_EVENT_STRUCT", &SWIGTYPE_p_PARSE_EVENT_STRUCT,_proxy__wrap_new_PARSE_EVENT_STRUCT, swig_delete_PARSE_EVENT_STRUCT, swig_PARSE_EVENT_STRUCT_methods, swig_PARSE_EVENT_STRUCT_attributes, &swig_PARSE_EVENT_STRUCT_Sf_SwigStatic, swig_PARSE_EVENT_STRUCT_meta, swig_PARSE_EVENT_STRUCT_bases, swig_PARSE_EVENT_STRUCT_base_names }; static int _wrap_PARAM_s_set(lua_State* L) { int SWIG_arg = 0; @@ -4498,13 +5334,22 @@ static int _wrap_PARAM_fhdltmp_get(lua_State* L) { } -static int _wrap_new_PARAM(lua_State* L) { +static int _wrap_PARAM_iclientsocket_set(lua_State* L) { int SWIG_arg = 0; - _PARAM_ *result = 0 ; + _PARAM_ *arg1 = (_PARAM_ *) 0 ; + int arg2 ; + + SWIG_check_num_args("_PARAM_::iclientsocket",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("_PARAM_::iclientsocket",1,"_PARAM_ *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("_PARAM_::iclientsocket",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__PARAM_,0))){ + SWIG_fail_ptr("PARAM_iclientsocket_set",1,SWIGTYPE_p__PARAM_); + } + + arg2 = (int)lua_tonumber(L, 2); + if (arg1) (arg1)->iclientsocket = arg2; - SWIG_check_num_args("_PARAM_::_PARAM_",0,0) - result = (_PARAM_ *)new _PARAM_(); - SWIG_NewPointerObj(L,result,SWIGTYPE_p__PARAM_,1); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -4515,73 +5360,241 @@ static int _wrap_new_PARAM(lua_State* L) { } -static void swig_delete_PARAM(void *obj) { -_PARAM_ *arg1 = (_PARAM_ *) obj; -delete arg1; -} -static swig_lua_method swig__PARAM__methods[] = { - {0,0} -}; -static swig_lua_attribute swig__PARAM__attributes[] = { - { "s", _wrap_PARAM_s_get, _wrap_PARAM_s_set}, - { "os", _wrap_PARAM_os_get, _wrap_PARAM_os_set}, - { "port", _wrap_PARAM_port_get, _wrap_PARAM_port_set}, - { "language", _wrap_PARAM_language_get, _wrap_PARAM_language_set}, - { "convert_units", _wrap_PARAM_convert_units_get, _wrap_PARAM_convert_units_set}, - { "fp", _wrap_PARAM_fp_get, _wrap_PARAM_fp_set}, - { "sleep", _wrap_PARAM_sleep_get, _wrap_PARAM_sleep_set}, - { "cleanup", _wrap_PARAM_cleanup_get, _wrap_PARAM_cleanup_set}, - { "app_data", _wrap_PARAM_app_data_get, _wrap_PARAM_app_data_set}, - { "user", _wrap_PARAM_user_get, _wrap_PARAM_user_set}, - { "clipboard", _wrap_PARAM_clipboard_get, _wrap_PARAM_clipboard_set}, - { "clipboard_length", _wrap_PARAM_clipboard_length_get, _wrap_PARAM_clipboard_length_set}, - { "modal", _wrap_PARAM_modal_get, _wrap_PARAM_modal_set}, - { "readData", _wrap_PARAM_readData_get, _wrap_PARAM_readData_set}, - { "showData", _wrap_PARAM_showData_get, _wrap_PARAM_showData_set}, - { "modal_d", _wrap_PARAM_modal_d_get, _wrap_PARAM_modal_d_set}, - { "modalUserData", _wrap_PARAM_modalUserData_get, _wrap_PARAM_modalUserData_set}, - { "parse_event_struct", _wrap_PARAM_parse_event_struct_get, _wrap_PARAM_parse_event_struct_set}, - { "x", _wrap_PARAM_x_get, _wrap_PARAM_x_set}, - { "y", _wrap_PARAM_y_get, _wrap_PARAM_y_set}, - { "nxy", _wrap_PARAM_nxy_get, _wrap_PARAM_nxy_set}, - { "url", _wrap_PARAM_url_get, _wrap_PARAM_url_set}, - { "initial_mask", _wrap_PARAM_initial_mask_get, _wrap_PARAM_initial_mask_set}, - { "file_prefix", _wrap_PARAM_file_prefix_get, _wrap_PARAM_file_prefix_set}, - { "free", _wrap_PARAM_free_get, _wrap_PARAM_free_set}, - { "version", _wrap_PARAM_version_get, _wrap_PARAM_version_set}, - { "pvserver_version", _wrap_PARAM_pvserver_version_get, _wrap_PARAM_pvserver_version_set}, - { "exit_on_bind_error", _wrap_PARAM_exit_on_bind_error_get, _wrap_PARAM_exit_on_bind_error_set}, - { "hello_counter", _wrap_PARAM_hello_counter_get, _wrap_PARAM_hello_counter_set}, - { "local_milliseconds", _wrap_PARAM_local_milliseconds_get, _wrap_PARAM_local_milliseconds_set}, - { "force_null_event", _wrap_PARAM_force_null_event_get, _wrap_PARAM_force_null_event_set}, - { "allow_pause", _wrap_PARAM_allow_pause_get, _wrap_PARAM_allow_pause_set}, - { "pause", _wrap_PARAM_pause_get, _wrap_PARAM_pause_set}, - { "my_pvlock_count", _wrap_PARAM_my_pvlock_count_get, _wrap_PARAM_my_pvlock_count_set}, - { "num_additional_widgets", _wrap_PARAM_num_additional_widgets_get, _wrap_PARAM_num_additional_widgets_set}, - { "mouse_x", _wrap_PARAM_mouse_x_get, _wrap_PARAM_mouse_x_set}, - { "mouse_y", _wrap_PARAM_mouse_y_get, _wrap_PARAM_mouse_y_set}, - { "mytext", _wrap_PARAM_mytext_get, _wrap_PARAM_mytext_set}, - { "communication_plugin", _wrap_PARAM_communication_plugin_get, _wrap_PARAM_communication_plugin_set}, - { "use_communication_plugin", _wrap_PARAM_use_communication_plugin_get, _wrap_PARAM_use_communication_plugin_set}, - { "lang_section", _wrap_PARAM_lang_section_get, _wrap_PARAM_lang_section_set}, - { "mytext2", _wrap_PARAM_mytext2_get, _wrap_PARAM_mytext2_set}, - { "http", _wrap_PARAM_http_get, _wrap_PARAM_http_set}, - { "fptmp", _wrap_PARAM_fptmp_get, _wrap_PARAM_fptmp_set}, - { "fhdltmp", _wrap_PARAM_fhdltmp_get, _wrap_PARAM_fhdltmp_set}, - {0,0,0} -}; -static swig_lua_attribute swig__PARAM__cls_attributes[] = { - {0,0,0} -}; -static swig_lua_method swig__PARAM__cls_methods[] = { - {0,0} -}; -static swig_lua_const_info swig__PARAM__cls_constants[] = { - {0,0,0,0,0,0} -}; -static swig_lua_class *swig__PARAM__bases[] = {0}; -static const char *swig__PARAM__base_names[] = {0}; -static swig_lua_class _wrap_class__PARAM_ = { "PARAM", &SWIGTYPE_p__PARAM_,_wrap_new_PARAM, swig_delete_PARAM, swig__PARAM__methods, swig__PARAM__attributes, { "PARAM", swig__PARAM__cls_methods, swig__PARAM__cls_attributes, swig__PARAM__cls_constants }, swig__PARAM__bases, swig__PARAM__base_names }; +static int _wrap_PARAM_iclientsocket_get(lua_State* L) { + int SWIG_arg = 0; + _PARAM_ *arg1 = (_PARAM_ *) 0 ; + int result; + + SWIG_check_num_args("_PARAM_::iclientsocket",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("_PARAM_::iclientsocket",1,"_PARAM_ *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__PARAM_,0))){ + SWIG_fail_ptr("PARAM_iclientsocket_get",1,SWIGTYPE_p__PARAM_); + } + + result = (int) ((arg1)->iclientsocket); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_PARAM_is_binary_set(lua_State* L) { + int SWIG_arg = 0; + _PARAM_ *arg1 = (_PARAM_ *) 0 ; + int arg2 ; + + SWIG_check_num_args("_PARAM_::is_binary",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("_PARAM_::is_binary",1,"_PARAM_ *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("_PARAM_::is_binary",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__PARAM_,0))){ + SWIG_fail_ptr("PARAM_is_binary_set",1,SWIGTYPE_p__PARAM_); + } + + arg2 = (int)lua_tonumber(L, 2); + if (arg1) (arg1)->is_binary = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_PARAM_is_binary_get(lua_State* L) { + int SWIG_arg = 0; + _PARAM_ *arg1 = (_PARAM_ *) 0 ; + int result; + + SWIG_check_num_args("_PARAM_::is_binary",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("_PARAM_::is_binary",1,"_PARAM_ *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__PARAM_,0))){ + SWIG_fail_ptr("PARAM_is_binary_get",1,SWIGTYPE_p__PARAM_); + } + + result = (int) ((arg1)->is_binary); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_PARAM_button_set(lua_State* L) { + int SWIG_arg = 0; + _PARAM_ *arg1 = (_PARAM_ *) 0 ; + int arg2 ; + + SWIG_check_num_args("_PARAM_::button",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("_PARAM_::button",1,"_PARAM_ *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("_PARAM_::button",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__PARAM_,0))){ + SWIG_fail_ptr("PARAM_button_set",1,SWIGTYPE_p__PARAM_); + } + + arg2 = (int)lua_tonumber(L, 2); + if (arg1) (arg1)->button = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_PARAM_button_get(lua_State* L) { + int SWIG_arg = 0; + _PARAM_ *arg1 = (_PARAM_ *) 0 ; + int result; + + SWIG_check_num_args("_PARAM_::button",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("_PARAM_::button",1,"_PARAM_ *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__PARAM_,0))){ + SWIG_fail_ptr("PARAM_button_get",1,SWIGTYPE_p__PARAM_); + } + + result = (int) ((arg1)->button); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_PARAM(lua_State* L) { + int SWIG_arg = 0; + _PARAM_ *result = 0 ; + + SWIG_check_num_args("_PARAM_::_PARAM_",0,0) + result = (_PARAM_ *)new _PARAM_(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p__PARAM_,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_PARAM(void *obj) { +_PARAM_ *arg1 = (_PARAM_ *) obj; +delete arg1; +} +static int _proxy__wrap_new_PARAM(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_PARAM); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_PARAM_attributes[] = { + { "s", _wrap_PARAM_s_get, _wrap_PARAM_s_set }, + { "os", _wrap_PARAM_os_get, _wrap_PARAM_os_set }, + { "port", _wrap_PARAM_port_get, _wrap_PARAM_port_set }, + { "language", _wrap_PARAM_language_get, _wrap_PARAM_language_set }, + { "convert_units", _wrap_PARAM_convert_units_get, _wrap_PARAM_convert_units_set }, + { "fp", _wrap_PARAM_fp_get, _wrap_PARAM_fp_set }, + { "sleep", _wrap_PARAM_sleep_get, _wrap_PARAM_sleep_set }, + { "cleanup", _wrap_PARAM_cleanup_get, _wrap_PARAM_cleanup_set }, + { "app_data", _wrap_PARAM_app_data_get, _wrap_PARAM_app_data_set }, + { "user", _wrap_PARAM_user_get, _wrap_PARAM_user_set }, + { "clipboard", _wrap_PARAM_clipboard_get, _wrap_PARAM_clipboard_set }, + { "clipboard_length", _wrap_PARAM_clipboard_length_get, _wrap_PARAM_clipboard_length_set }, + { "modal", _wrap_PARAM_modal_get, _wrap_PARAM_modal_set }, + { "readData", _wrap_PARAM_readData_get, _wrap_PARAM_readData_set }, + { "showData", _wrap_PARAM_showData_get, _wrap_PARAM_showData_set }, + { "modal_d", _wrap_PARAM_modal_d_get, _wrap_PARAM_modal_d_set }, + { "modalUserData", _wrap_PARAM_modalUserData_get, _wrap_PARAM_modalUserData_set }, + { "parse_event_struct", _wrap_PARAM_parse_event_struct_get, _wrap_PARAM_parse_event_struct_set }, + { "x", _wrap_PARAM_x_get, _wrap_PARAM_x_set }, + { "y", _wrap_PARAM_y_get, _wrap_PARAM_y_set }, + { "nxy", _wrap_PARAM_nxy_get, _wrap_PARAM_nxy_set }, + { "url", _wrap_PARAM_url_get, _wrap_PARAM_url_set }, + { "initial_mask", _wrap_PARAM_initial_mask_get, _wrap_PARAM_initial_mask_set }, + { "file_prefix", _wrap_PARAM_file_prefix_get, _wrap_PARAM_file_prefix_set }, + { "free", _wrap_PARAM_free_get, _wrap_PARAM_free_set }, + { "version", _wrap_PARAM_version_get, _wrap_PARAM_version_set }, + { "pvserver_version", _wrap_PARAM_pvserver_version_get, _wrap_PARAM_pvserver_version_set }, + { "exit_on_bind_error", _wrap_PARAM_exit_on_bind_error_get, _wrap_PARAM_exit_on_bind_error_set }, + { "hello_counter", _wrap_PARAM_hello_counter_get, _wrap_PARAM_hello_counter_set }, + { "local_milliseconds", _wrap_PARAM_local_milliseconds_get, _wrap_PARAM_local_milliseconds_set }, + { "force_null_event", _wrap_PARAM_force_null_event_get, _wrap_PARAM_force_null_event_set }, + { "allow_pause", _wrap_PARAM_allow_pause_get, _wrap_PARAM_allow_pause_set }, + { "pause", _wrap_PARAM_pause_get, _wrap_PARAM_pause_set }, + { "my_pvlock_count", _wrap_PARAM_my_pvlock_count_get, _wrap_PARAM_my_pvlock_count_set }, + { "num_additional_widgets", _wrap_PARAM_num_additional_widgets_get, _wrap_PARAM_num_additional_widgets_set }, + { "mouse_x", _wrap_PARAM_mouse_x_get, _wrap_PARAM_mouse_x_set }, + { "mouse_y", _wrap_PARAM_mouse_y_get, _wrap_PARAM_mouse_y_set }, + { "mytext", _wrap_PARAM_mytext_get, _wrap_PARAM_mytext_set }, + { "communication_plugin", _wrap_PARAM_communication_plugin_get, _wrap_PARAM_communication_plugin_set }, + { "use_communication_plugin", _wrap_PARAM_use_communication_plugin_get, _wrap_PARAM_use_communication_plugin_set }, + { "lang_section", _wrap_PARAM_lang_section_get, _wrap_PARAM_lang_section_set }, + { "mytext2", _wrap_PARAM_mytext2_get, _wrap_PARAM_mytext2_set }, + { "http", _wrap_PARAM_http_get, _wrap_PARAM_http_set }, + { "fptmp", _wrap_PARAM_fptmp_get, _wrap_PARAM_fptmp_set }, + { "fhdltmp", _wrap_PARAM_fhdltmp_get, _wrap_PARAM_fhdltmp_set }, + { "iclientsocket", _wrap_PARAM_iclientsocket_get, _wrap_PARAM_iclientsocket_set }, + { "is_binary", _wrap_PARAM_is_binary_get, _wrap_PARAM_is_binary_set }, + { "button", _wrap_PARAM_button_get, _wrap_PARAM_button_set }, + {0,0,0} +}; +static swig_lua_method swig_PARAM_methods[]= { + {0,0} +}; +static swig_lua_method swig_PARAM_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_PARAM_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_PARAM_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_PARAM_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_PARAM_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_PARAM_Sf_SwigStatic = { + "PARAM", + swig_PARAM_Sf_SwigStatic_methods, + swig_PARAM_Sf_SwigStatic_attributes, + swig_PARAM_Sf_SwigStatic_constants, + swig_PARAM_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_PARAM_bases[] = {0}; +static const char *swig_PARAM_base_names[] = {0}; +static swig_lua_class _wrap_class_PARAM = { "PARAM", "PARAM", &SWIGTYPE_p__PARAM_,_proxy__wrap_new_PARAM, swig_delete_PARAM, swig_PARAM_methods, swig_PARAM_attributes, &swig_PARAM_Sf_SwigStatic, swig_PARAM_meta, swig_PARAM_bases, swig_PARAM_base_names }; static int _wrap_null_string_get(lua_State* L) { int SWIG_arg = 0; @@ -5179,35 +6192,59 @@ static void swig_delete_IntegerArray(void *obj) { IntegerArray *arg1 = (IntegerArray *) obj; delete arg1; } -static swig_lua_method swig_IntegerArray_methods[] = { - {0,0} -}; +static int _proxy__wrap_new_IntegerArray(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_IntegerArray); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_IntegerArray_attributes[] = { - { "i", _wrap_IntegerArray_i_get, _wrap_IntegerArray_i_set}, - { "i0", _wrap_IntegerArray_i0_get, _wrap_IntegerArray_i0_set}, - { "i1", _wrap_IntegerArray_i1_get, _wrap_IntegerArray_i1_set}, - { "i2", _wrap_IntegerArray_i2_get, _wrap_IntegerArray_i2_set}, - { "i3", _wrap_IntegerArray_i3_get, _wrap_IntegerArray_i3_set}, - { "i4", _wrap_IntegerArray_i4_get, _wrap_IntegerArray_i4_set}, - { "i5", _wrap_IntegerArray_i5_get, _wrap_IntegerArray_i5_set}, - { "i6", _wrap_IntegerArray_i6_get, _wrap_IntegerArray_i6_set}, - { "i7", _wrap_IntegerArray_i7_get, _wrap_IntegerArray_i7_set}, - { "i8", _wrap_IntegerArray_i8_get, _wrap_IntegerArray_i8_set}, - { "i9", _wrap_IntegerArray_i9_get, _wrap_IntegerArray_i9_set}, + { "i", _wrap_IntegerArray_i_get, _wrap_IntegerArray_i_set }, + { "i0", _wrap_IntegerArray_i0_get, _wrap_IntegerArray_i0_set }, + { "i1", _wrap_IntegerArray_i1_get, _wrap_IntegerArray_i1_set }, + { "i2", _wrap_IntegerArray_i2_get, _wrap_IntegerArray_i2_set }, + { "i3", _wrap_IntegerArray_i3_get, _wrap_IntegerArray_i3_set }, + { "i4", _wrap_IntegerArray_i4_get, _wrap_IntegerArray_i4_set }, + { "i5", _wrap_IntegerArray_i5_get, _wrap_IntegerArray_i5_set }, + { "i6", _wrap_IntegerArray_i6_get, _wrap_IntegerArray_i6_set }, + { "i7", _wrap_IntegerArray_i7_get, _wrap_IntegerArray_i7_set }, + { "i8", _wrap_IntegerArray_i8_get, _wrap_IntegerArray_i8_set }, + { "i9", _wrap_IntegerArray_i9_get, _wrap_IntegerArray_i9_set }, {0,0,0} }; -static swig_lua_attribute swig_IntegerArray_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_IntegerArray_methods[]= { + {0,0} }; -static swig_lua_method swig_IntegerArray_cls_methods[] = { +static swig_lua_method swig_IntegerArray_meta[] = { {0,0} }; -static swig_lua_const_info swig_IntegerArray_cls_constants[] = { + +static swig_lua_attribute swig_IntegerArray_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_IntegerArray_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_IntegerArray_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_IntegerArray_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_IntegerArray_Sf_SwigStatic = { + "IntegerArray", + swig_IntegerArray_Sf_SwigStatic_methods, + swig_IntegerArray_Sf_SwigStatic_attributes, + swig_IntegerArray_Sf_SwigStatic_constants, + swig_IntegerArray_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_IntegerArray_bases[] = {0}; static const char *swig_IntegerArray_base_names[] = {0}; -static swig_lua_class _wrap_class_IntegerArray = { "IntegerArray", &SWIGTYPE_p_IntegerArray,_wrap_new_IntegerArray, swig_delete_IntegerArray, swig_IntegerArray_methods, swig_IntegerArray_attributes, { "IntegerArray", swig_IntegerArray_cls_methods, swig_IntegerArray_cls_attributes, swig_IntegerArray_cls_constants }, swig_IntegerArray_bases, swig_IntegerArray_base_names }; +static swig_lua_class _wrap_class_IntegerArray = { "IntegerArray", "IntegerArray", &SWIGTYPE_p_IntegerArray,_proxy__wrap_new_IntegerArray, swig_delete_IntegerArray, swig_IntegerArray_methods, swig_IntegerArray_attributes, &swig_IntegerArray_Sf_SwigStatic, swig_IntegerArray_meta, swig_IntegerArray_bases, swig_IntegerArray_base_names }; static int _wrap_FloatArray_f_set(lua_State* L) { int SWIG_arg = 0; @@ -5788,35 +6825,59 @@ static void swig_delete_FloatArray(void *obj) { FloatArray *arg1 = (FloatArray *) obj; delete arg1; } -static swig_lua_method swig_FloatArray_methods[] = { - {0,0} -}; +static int _proxy__wrap_new_FloatArray(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_FloatArray); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_FloatArray_attributes[] = { - { "f", _wrap_FloatArray_f_get, _wrap_FloatArray_f_set}, - { "f0", _wrap_FloatArray_f0_get, _wrap_FloatArray_f0_set}, - { "f1", _wrap_FloatArray_f1_get, _wrap_FloatArray_f1_set}, - { "f2", _wrap_FloatArray_f2_get, _wrap_FloatArray_f2_set}, - { "f3", _wrap_FloatArray_f3_get, _wrap_FloatArray_f3_set}, - { "f4", _wrap_FloatArray_f4_get, _wrap_FloatArray_f4_set}, - { "f5", _wrap_FloatArray_f5_get, _wrap_FloatArray_f5_set}, - { "f6", _wrap_FloatArray_f6_get, _wrap_FloatArray_f6_set}, - { "f7", _wrap_FloatArray_f7_get, _wrap_FloatArray_f7_set}, - { "f8", _wrap_FloatArray_f8_get, _wrap_FloatArray_f8_set}, - { "f9", _wrap_FloatArray_f9_get, _wrap_FloatArray_f9_set}, + { "f", _wrap_FloatArray_f_get, _wrap_FloatArray_f_set }, + { "f0", _wrap_FloatArray_f0_get, _wrap_FloatArray_f0_set }, + { "f1", _wrap_FloatArray_f1_get, _wrap_FloatArray_f1_set }, + { "f2", _wrap_FloatArray_f2_get, _wrap_FloatArray_f2_set }, + { "f3", _wrap_FloatArray_f3_get, _wrap_FloatArray_f3_set }, + { "f4", _wrap_FloatArray_f4_get, _wrap_FloatArray_f4_set }, + { "f5", _wrap_FloatArray_f5_get, _wrap_FloatArray_f5_set }, + { "f6", _wrap_FloatArray_f6_get, _wrap_FloatArray_f6_set }, + { "f7", _wrap_FloatArray_f7_get, _wrap_FloatArray_f7_set }, + { "f8", _wrap_FloatArray_f8_get, _wrap_FloatArray_f8_set }, + { "f9", _wrap_FloatArray_f9_get, _wrap_FloatArray_f9_set }, {0,0,0} }; -static swig_lua_attribute swig_FloatArray_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_FloatArray_methods[]= { + {0,0} }; -static swig_lua_method swig_FloatArray_cls_methods[] = { +static swig_lua_method swig_FloatArray_meta[] = { {0,0} }; -static swig_lua_const_info swig_FloatArray_cls_constants[] = { + +static swig_lua_attribute swig_FloatArray_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_FloatArray_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_FloatArray_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_FloatArray_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_FloatArray_Sf_SwigStatic = { + "FloatArray", + swig_FloatArray_Sf_SwigStatic_methods, + swig_FloatArray_Sf_SwigStatic_attributes, + swig_FloatArray_Sf_SwigStatic_constants, + swig_FloatArray_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_FloatArray_bases[] = {0}; static const char *swig_FloatArray_base_names[] = {0}; -static swig_lua_class _wrap_class_FloatArray = { "FloatArray", &SWIGTYPE_p_FloatArray,_wrap_new_FloatArray, swig_delete_FloatArray, swig_FloatArray_methods, swig_FloatArray_attributes, { "FloatArray", swig_FloatArray_cls_methods, swig_FloatArray_cls_attributes, swig_FloatArray_cls_constants }, swig_FloatArray_bases, swig_FloatArray_base_names }; +static swig_lua_class _wrap_class_FloatArray = { "FloatArray", "FloatArray", &SWIGTYPE_p_FloatArray,_proxy__wrap_new_FloatArray, swig_delete_FloatArray, swig_FloatArray_methods, swig_FloatArray_attributes, &swig_FloatArray_Sf_SwigStatic, swig_FloatArray_meta, swig_FloatArray_bases, swig_FloatArray_base_names }; static int _wrap_pvTime_millisecond_set(lua_State* L) { int SWIG_arg = 0; @@ -6189,31 +7250,55 @@ static void swig_delete_pvTime(void *obj) { pvTime *arg1 = (pvTime *) obj; delete arg1; } -static swig_lua_method swig_pvTime_methods[] = { - {0,0} -}; +static int _proxy__wrap_new_pvTime(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_pvTime); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_pvTime_attributes[] = { - { "millisecond", _wrap_pvTime_millisecond_get, _wrap_pvTime_millisecond_set}, - { "second", _wrap_pvTime_second_get, _wrap_pvTime_second_set}, - { "minute", _wrap_pvTime_minute_get, _wrap_pvTime_minute_set}, - { "hour", _wrap_pvTime_hour_get, _wrap_pvTime_hour_set}, - { "day", _wrap_pvTime_day_get, _wrap_pvTime_day_set}, - { "month", _wrap_pvTime_month_get, _wrap_pvTime_month_set}, - { "year", _wrap_pvTime_year_get, _wrap_pvTime_year_set}, + { "millisecond", _wrap_pvTime_millisecond_get, _wrap_pvTime_millisecond_set }, + { "second", _wrap_pvTime_second_get, _wrap_pvTime_second_set }, + { "minute", _wrap_pvTime_minute_get, _wrap_pvTime_minute_set }, + { "hour", _wrap_pvTime_hour_get, _wrap_pvTime_hour_set }, + { "day", _wrap_pvTime_day_get, _wrap_pvTime_day_set }, + { "month", _wrap_pvTime_month_get, _wrap_pvTime_month_set }, + { "year", _wrap_pvTime_year_get, _wrap_pvTime_year_set }, {0,0,0} }; -static swig_lua_attribute swig_pvTime_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_pvTime_methods[]= { + {0,0} }; -static swig_lua_method swig_pvTime_cls_methods[] = { +static swig_lua_method swig_pvTime_meta[] = { {0,0} }; -static swig_lua_const_info swig_pvTime_cls_constants[] = { + +static swig_lua_attribute swig_pvTime_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_pvTime_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_pvTime_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_pvTime_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_pvTime_Sf_SwigStatic = { + "pvTime", + swig_pvTime_Sf_SwigStatic_methods, + swig_pvTime_Sf_SwigStatic_attributes, + swig_pvTime_Sf_SwigStatic_constants, + swig_pvTime_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_pvTime_bases[] = {0}; static const char *swig_pvTime_base_names[] = {0}; -static swig_lua_class _wrap_class_pvTime = { "pvTime", &SWIGTYPE_p_pvTime,_wrap_new_pvTime, swig_delete_pvTime, swig_pvTime_methods, swig_pvTime_attributes, { "pvTime", swig_pvTime_cls_methods, swig_pvTime_cls_attributes, swig_pvTime_cls_constants }, swig_pvTime_bases, swig_pvTime_base_names }; +static swig_lua_class _wrap_class_pvTime = { "pvTime", "pvTime", &SWIGTYPE_p_pvTime,_proxy__wrap_new_pvTime, swig_delete_pvTime, swig_pvTime_methods, swig_pvTime_attributes, &swig_pvTime_Sf_SwigStatic, swig_pvTime_meta, swig_pvTime_bases, swig_pvTime_base_names }; static int _wrap_pvAddressTableItem_s_set(lua_State* L) { int SWIG_arg = 0; @@ -6394,27 +7479,51 @@ static void swig_delete_pvAddressTableItem(void *obj) { pvAddressTableItem *arg1 = (pvAddressTableItem *) obj; delete arg1; } -static swig_lua_method swig_pvAddressTableItem_methods[] = { - {0,0} -}; +static int _proxy__wrap_new_pvAddressTableItem(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_pvAddressTableItem); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_pvAddressTableItem_attributes[] = { - { "s", _wrap_pvAddressTableItem_s_get, _wrap_pvAddressTableItem_s_set}, - { "version", _wrap_pvAddressTableItem_version_get, _wrap_pvAddressTableItem_version_set}, - { "adr", _wrap_pvAddressTableItem_adr_get, _wrap_pvAddressTableItem_adr_set}, + { "s", _wrap_pvAddressTableItem_s_get, _wrap_pvAddressTableItem_s_set }, + { "version", _wrap_pvAddressTableItem_version_get, _wrap_pvAddressTableItem_version_set }, + { "adr", _wrap_pvAddressTableItem_adr_get, _wrap_pvAddressTableItem_adr_set }, {0,0,0} }; -static swig_lua_attribute swig_pvAddressTableItem_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_pvAddressTableItem_methods[]= { + {0,0} }; -static swig_lua_method swig_pvAddressTableItem_cls_methods[] = { +static swig_lua_method swig_pvAddressTableItem_meta[] = { {0,0} }; -static swig_lua_const_info swig_pvAddressTableItem_cls_constants[] = { + +static swig_lua_attribute swig_pvAddressTableItem_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_pvAddressTableItem_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_pvAddressTableItem_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_pvAddressTableItem_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_pvAddressTableItem_Sf_SwigStatic = { + "pvAddressTableItem", + swig_pvAddressTableItem_Sf_SwigStatic_methods, + swig_pvAddressTableItem_Sf_SwigStatic_attributes, + swig_pvAddressTableItem_Sf_SwigStatic_constants, + swig_pvAddressTableItem_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_pvAddressTableItem_bases[] = {0}; static const char *swig_pvAddressTableItem_base_names[] = {0}; -static swig_lua_class _wrap_class_pvAddressTableItem = { "pvAddressTableItem", &SWIGTYPE_p_pvAddressTableItem,_wrap_new_pvAddressTableItem, swig_delete_pvAddressTableItem, swig_pvAddressTableItem_methods, swig_pvAddressTableItem_attributes, { "pvAddressTableItem", swig_pvAddressTableItem_cls_methods, swig_pvAddressTableItem_cls_attributes, swig_pvAddressTableItem_cls_constants }, swig_pvAddressTableItem_bases, swig_pvAddressTableItem_base_names }; +static swig_lua_class _wrap_class_pvAddressTableItem = { "pvAddressTableItem", "pvAddressTableItem", &SWIGTYPE_p_pvAddressTableItem,_proxy__wrap_new_pvAddressTableItem, swig_delete_pvAddressTableItem, swig_pvAddressTableItem_methods, swig_pvAddressTableItem_attributes, &swig_pvAddressTableItem_Sf_SwigStatic, swig_pvAddressTableItem_meta, swig_pvAddressTableItem_bases, swig_pvAddressTableItem_base_names }; static int _wrap_pvAddressTable_adr_set(lua_State* L) { int SWIG_arg = 0; @@ -6495,25 +7604,49 @@ static void swig_delete_pvAddressTable(void *obj) { pvAddressTable *arg1 = (pvAddressTable *) obj; delete arg1; } -static swig_lua_method swig_pvAddressTable_methods[] = { - {0,0} -}; +static int _proxy__wrap_new_pvAddressTable(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_pvAddressTable); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_pvAddressTable_attributes[] = { - { "adr", _wrap_pvAddressTable_adr_get, _wrap_pvAddressTable_adr_set}, + { "adr", _wrap_pvAddressTable_adr_get, _wrap_pvAddressTable_adr_set }, {0,0,0} }; -static swig_lua_attribute swig_pvAddressTable_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_pvAddressTable_methods[]= { + {0,0} }; -static swig_lua_method swig_pvAddressTable_cls_methods[] = { +static swig_lua_method swig_pvAddressTable_meta[] = { {0,0} }; -static swig_lua_const_info swig_pvAddressTable_cls_constants[] = { + +static swig_lua_attribute swig_pvAddressTable_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_pvAddressTable_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_pvAddressTable_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_pvAddressTable_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_pvAddressTable_Sf_SwigStatic = { + "pvAddressTable", + swig_pvAddressTable_Sf_SwigStatic_methods, + swig_pvAddressTable_Sf_SwigStatic_attributes, + swig_pvAddressTable_Sf_SwigStatic_constants, + swig_pvAddressTable_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_pvAddressTable_bases[] = {0}; static const char *swig_pvAddressTable_base_names[] = {0}; -static swig_lua_class _wrap_class_pvAddressTable = { "pvAddressTable", &SWIGTYPE_p_pvAddressTable,_wrap_new_pvAddressTable, swig_delete_pvAddressTable, swig_pvAddressTable_methods, swig_pvAddressTable_attributes, { "pvAddressTable", swig_pvAddressTable_cls_methods, swig_pvAddressTable_cls_attributes, swig_pvAddressTable_cls_constants }, swig_pvAddressTable_bases, swig_pvAddressTable_base_names }; +static swig_lua_class _wrap_class_pvAddressTable = { "pvAddressTable", "pvAddressTable", &SWIGTYPE_p_pvAddressTable,_proxy__wrap_new_pvAddressTable, swig_delete_pvAddressTable, swig_pvAddressTable_methods, swig_pvAddressTable_attributes, &swig_pvAddressTable_Sf_SwigStatic, swig_pvAddressTable_meta, swig_pvAddressTable_bases, swig_pvAddressTable_base_names }; static int _wrap_glencode_set_param(lua_State* L) { int SWIG_arg = 0; @@ -14453,6 +15586,30 @@ static int _wrap_pvSaveDrawBuffer(lua_State* L) { } +static int _wrap_pvWaitpid(lua_State* L) { + int SWIG_arg = 0; + PARAM *arg1 = (PARAM *) 0 ; + int result; + + SWIG_check_num_args("pvWaitpid",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("pvWaitpid",1,"PARAM *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p__PARAM_,0))){ + SWIG_fail_ptr("pvWaitpid",1,SWIGTYPE_p__PARAM_); + } + + result = (int)pvWaitpid(arg1); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_pvText(lua_State* L) { int SWIG_arg = 0; PARAM *arg1 = (PARAM *) 0 ; @@ -17651,32 +18808,56 @@ static void swig_delete_glFont(void *obj) { glFont *arg1 = (glFont *) obj; delete arg1; } -static swig_lua_method swig_glFont_methods[] = { - {"read", _wrap_glFont_read}, - {"lineHeight", _wrap_glFont_lineHeight}, - {"charWidth", _wrap_glFont_charWidth}, - {"stringWidth", _wrap_glFont_stringWidth}, - {"drawString", _wrap_glFont_drawString}, - {"setZoom", _wrap_glFont_setZoom}, - {"setRotation", _wrap_glFont_setRotation}, - {"setFontSize", _wrap_glFont_setFontSize}, - {0,0} -}; +static int _proxy__wrap_new_glFont(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_glFont); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_glFont_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_glFont_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_glFont_methods[]= { + { "read", _wrap_glFont_read}, + { "lineHeight", _wrap_glFont_lineHeight}, + { "charWidth", _wrap_glFont_charWidth}, + { "stringWidth", _wrap_glFont_stringWidth}, + { "drawString", _wrap_glFont_drawString}, + { "setZoom", _wrap_glFont_setZoom}, + { "setRotation", _wrap_glFont_setRotation}, + { "setFontSize", _wrap_glFont_setFontSize}, + {0,0} }; -static swig_lua_method swig_glFont_cls_methods[] = { +static swig_lua_method swig_glFont_meta[] = { {0,0} }; -static swig_lua_const_info swig_glFont_cls_constants[] = { + +static swig_lua_attribute swig_glFont_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_glFont_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_glFont_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_glFont_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_glFont_Sf_SwigStatic = { + "glFont", + swig_glFont_Sf_SwigStatic_methods, + swig_glFont_Sf_SwigStatic_attributes, + swig_glFont_Sf_SwigStatic_constants, + swig_glFont_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_glFont_bases[] = {0}; static const char *swig_glFont_base_names[] = {0}; -static swig_lua_class _wrap_class_glFont = { "glFont", &SWIGTYPE_p_glFont,_wrap_new_glFont, swig_delete_glFont, swig_glFont_methods, swig_glFont_attributes, { "glFont", swig_glFont_cls_methods, swig_glFont_cls_attributes, swig_glFont_cls_constants }, swig_glFont_bases, swig_glFont_base_names }; +static swig_lua_class _wrap_class_glFont = { "glFont", "glFont", &SWIGTYPE_p_glFont,_proxy__wrap_new_glFont, swig_delete_glFont, swig_glFont_methods, swig_glFont_attributes, &swig_glFont_Sf_SwigStatic, swig_glFont_meta, swig_glFont_bases, swig_glFont_base_names }; static int _wrap_pvSendOpenGL__SWIG_0(lua_State* L) { int SWIG_arg = 0; @@ -28575,35 +29756,59 @@ static void swig_delete_pvWidgetIdManager(void *obj) { pvWidgetIdManager *arg1 = (pvWidgetIdManager *) obj; delete arg1; } -static swig_lua_method swig_pvWidgetIdManager_methods[] = { - {"init", _wrap_pvWidgetIdManager_init}, - {"newId", _wrap_pvWidgetIdManager_newId}, - {"deleteWidget", _wrap_pvWidgetIdManager_deleteWidget}, - {"id", _wrap_pvWidgetIdManager_id}, - {"isInMap", _wrap_pvWidgetIdManager_isInMap}, - {"firstId", _wrap_pvWidgetIdManager_firstId}, - {"nextId", _wrap_pvWidgetIdManager_nextId}, - {"endId", _wrap_pvWidgetIdManager_endId}, - {"name", _wrap_pvWidgetIdManager_name}, - {"idStart", _wrap_pvWidgetIdManager_idStart}, - {"readEnumFromMask", _wrap_pvWidgetIdManager_readEnumFromMask}, - {0,0} -}; +static int _proxy__wrap_new_pvWidgetIdManager(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_pvWidgetIdManager); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} static swig_lua_attribute swig_pvWidgetIdManager_attributes[] = { {0,0,0} }; -static swig_lua_attribute swig_pvWidgetIdManager_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_pvWidgetIdManager_methods[]= { + { "init", _wrap_pvWidgetIdManager_init}, + { "newId", _wrap_pvWidgetIdManager_newId}, + { "deleteWidget", _wrap_pvWidgetIdManager_deleteWidget}, + { "id", _wrap_pvWidgetIdManager_id}, + { "isInMap", _wrap_pvWidgetIdManager_isInMap}, + { "firstId", _wrap_pvWidgetIdManager_firstId}, + { "nextId", _wrap_pvWidgetIdManager_nextId}, + { "endId", _wrap_pvWidgetIdManager_endId}, + { "name", _wrap_pvWidgetIdManager_name}, + { "idStart", _wrap_pvWidgetIdManager_idStart}, + { "readEnumFromMask", _wrap_pvWidgetIdManager_readEnumFromMask}, + {0,0} }; -static swig_lua_method swig_pvWidgetIdManager_cls_methods[] = { +static swig_lua_method swig_pvWidgetIdManager_meta[] = { {0,0} }; -static swig_lua_const_info swig_pvWidgetIdManager_cls_constants[] = { + +static swig_lua_attribute swig_pvWidgetIdManager_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_pvWidgetIdManager_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_pvWidgetIdManager_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_pvWidgetIdManager_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_pvWidgetIdManager_Sf_SwigStatic = { + "pvWidgetIdManager", + swig_pvWidgetIdManager_Sf_SwigStatic_methods, + swig_pvWidgetIdManager_Sf_SwigStatic_attributes, + swig_pvWidgetIdManager_Sf_SwigStatic_constants, + swig_pvWidgetIdManager_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_pvWidgetIdManager_bases[] = {0}; static const char *swig_pvWidgetIdManager_base_names[] = {0}; -static swig_lua_class _wrap_class_pvWidgetIdManager = { "pvWidgetIdManager", &SWIGTYPE_p_pvWidgetIdManager,_wrap_new_pvWidgetIdManager, swig_delete_pvWidgetIdManager, swig_pvWidgetIdManager_methods, swig_pvWidgetIdManager_attributes, { "pvWidgetIdManager", swig_pvWidgetIdManager_cls_methods, swig_pvWidgetIdManager_cls_attributes, swig_pvWidgetIdManager_cls_constants }, swig_pvWidgetIdManager_bases, swig_pvWidgetIdManager_base_names }; +static swig_lua_class _wrap_class_pvWidgetIdManager = { "pvWidgetIdManager", "pvWidgetIdManager", &SWIGTYPE_p_pvWidgetIdManager,_proxy__wrap_new_pvWidgetIdManager, swig_delete_pvWidgetIdManager, swig_pvWidgetIdManager_methods, swig_pvWidgetIdManager_attributes, &swig_pvWidgetIdManager_Sf_SwigStatic, swig_pvWidgetIdManager_meta, swig_pvWidgetIdManager_bases, swig_pvWidgetIdManager_base_names }; static int _wrap_new_qtDatabase(lua_State* L) { int SWIG_arg = 0; @@ -29088,36 +30293,60 @@ static void swig_delete_qtDatabase(void *obj) { qtDatabase *arg1 = (qtDatabase *) obj; delete arg1; } -static swig_lua_method swig_qtDatabase_methods[] = { - {"open", _wrap_qtDatabase_open}, - {"close", _wrap_qtDatabase_close}, - {"query", _wrap_qtDatabase_query}, - {"populateTable", _wrap_qtDatabase_populateTable}, - {"recordFieldValue", _wrap_qtDatabase_recordFieldValue}, - {"dbQuery", _wrap_qtDatabase_dbQuery}, - {"dbRecordFieldValue", _wrap_qtDatabase_dbRecordFieldValue}, - {"nextRecord", _wrap_qtDatabase_nextRecord}, - {0,0} -}; -static swig_lua_attribute swig_qtDatabase_attributes[] = { - { "connectionName", _wrap_qtDatabase_connectionName_get, _wrap_qtDatabase_connectionName_set}, - { "db", _wrap_qtDatabase_db_get, _wrap_qtDatabase_db_set}, - { "result", _wrap_qtDatabase_result_get, _wrap_qtDatabase_result_set}, - { "error", _wrap_qtDatabase_error_get, _wrap_qtDatabase_error_set}, +static int _proxy__wrap_new_qtDatabase(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_qtDatabase); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_qtDatabase_attributes[] = { + { "connectionName", _wrap_qtDatabase_connectionName_get, _wrap_qtDatabase_connectionName_set }, + { "db", _wrap_qtDatabase_db_get, _wrap_qtDatabase_db_set }, + { "result", _wrap_qtDatabase_result_get, _wrap_qtDatabase_result_set }, + { "error", _wrap_qtDatabase_error_get, _wrap_qtDatabase_error_set }, {0,0,0} }; -static swig_lua_attribute swig_qtDatabase_cls_attributes[] = { - {0,0,0} +static swig_lua_method swig_qtDatabase_methods[]= { + { "open", _wrap_qtDatabase_open}, + { "close", _wrap_qtDatabase_close}, + { "query", _wrap_qtDatabase_query}, + { "populateTable", _wrap_qtDatabase_populateTable}, + { "recordFieldValue", _wrap_qtDatabase_recordFieldValue}, + { "dbQuery", _wrap_qtDatabase_dbQuery}, + { "dbRecordFieldValue", _wrap_qtDatabase_dbRecordFieldValue}, + { "nextRecord", _wrap_qtDatabase_nextRecord}, + {0,0} }; -static swig_lua_method swig_qtDatabase_cls_methods[] = { +static swig_lua_method swig_qtDatabase_meta[] = { {0,0} }; -static swig_lua_const_info swig_qtDatabase_cls_constants[] = { + +static swig_lua_attribute swig_qtDatabase_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_qtDatabase_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; +static swig_lua_method swig_qtDatabase_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_qtDatabase_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_qtDatabase_Sf_SwigStatic = { + "qtDatabase", + swig_qtDatabase_Sf_SwigStatic_methods, + swig_qtDatabase_Sf_SwigStatic_attributes, + swig_qtDatabase_Sf_SwigStatic_constants, + swig_qtDatabase_Sf_SwigStatic_classes, + 0 +}; static swig_lua_class *swig_qtDatabase_bases[] = {0}; static const char *swig_qtDatabase_base_names[] = {0}; -static swig_lua_class _wrap_class_qtDatabase = { "qtDatabase", &SWIGTYPE_p_qtDatabase,_wrap_new_qtDatabase, swig_delete_qtDatabase, swig_qtDatabase_methods, swig_qtDatabase_attributes, { "qtDatabase", swig_qtDatabase_cls_methods, swig_qtDatabase_cls_attributes, swig_qtDatabase_cls_constants }, swig_qtDatabase_bases, swig_qtDatabase_base_names }; +static swig_lua_class _wrap_class_qtDatabase = { "qtDatabase", "qtDatabase", &SWIGTYPE_p_qtDatabase,_proxy__wrap_new_qtDatabase, swig_delete_qtDatabase, swig_qtDatabase_methods, swig_qtDatabase_attributes, &swig_qtDatabase_Sf_SwigStatic, swig_qtDatabase_meta, swig_qtDatabase_bases, swig_qtDatabase_base_names }; static int _wrap_getParam(lua_State* L) { int SWIG_arg = 0; @@ -29158,545 +30387,94 @@ static int _wrap_pvQImageScript(lua_State* L) { SWIG_fail_ptr("pvQImageScript",1,SWIGTYPE_p__PARAM_); } - arg2 = (int)lua_tonumber(L, 2); - arg3 = (int)lua_tonumber(L, 3); - arg4 = (char *)lua_tostring(L, 4); - result = (int)pvQImageScript(arg1,arg2,arg3,(char const *)arg4); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_int(lua_State* L) { - int SWIG_arg = 0; - int arg1 ; - int *result = 0 ; - - SWIG_check_num_args("new_int",1,1) - if(!lua_isnumber(L,1)) SWIG_fail_arg("new_int",1,"int"); - arg1 = (int)lua_tonumber(L, 1); - result = (int *)new_int(arg1); - SWIG_NewPointerObj(L,result,SWIGTYPE_p_int,0); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_get_int(lua_State* L) { - int SWIG_arg = 0; - int *arg1 = (int *) 0 ; - int result; - - SWIG_check_num_args("get_int",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_int",1,"int *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_int,0))){ - SWIG_fail_ptr("get_int",1,SWIGTYPE_p_int); - } - - result = (int)get_int(arg1); - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_delete_int(lua_State* L) { - int SWIG_arg = 0; - int *arg1 = (int *) 0 ; - - SWIG_check_num_args("delete_int",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("delete_int",1,"int *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_int,0))){ - SWIG_fail_ptr("delete_int",1,SWIGTYPE_p_int); - } - - delete_int(arg1); - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -#ifdef __cplusplus -} -#endif - -static const struct luaL_Reg swig_commands[] = { - { "glencode_set_param", _wrap_glencode_set_param}, - { "pvlock", _wrap_pvlock}, - { "pvunlock", _wrap_pvunlock}, - { "pvsystem", _wrap_pvsystem}, - { "pvGetLocalTime", _wrap_pvGetLocalTime}, - { "pvIsAccessAllowed", _wrap_pvIsAccessAllowed}, - { "pvSendVersion", _wrap_pvSendVersion}, - { "pvXYAllocate", _wrap_pvXYAllocate}, - { "getIntegers", _wrap_getIntegers}, - { "getFloats", _wrap_getFloats}, - { "getTextFromText", _wrap_getTextFromText}, - { "pvSetXY", _wrap_pvSetXY}, - { "pvGetSocketPointer", _wrap_pvGetSocketPointer}, - { "pvInitInternal", _wrap_pvInitInternal}, - { "pvInit", _wrap_pvInit}, - { "pvAccept", _wrap_pvAccept}, - { "pvCreateThread", _wrap_pvCreateThread}, - { "pvGetInitialMask", _wrap_pvGetInitialMask}, - { "pvMain", _wrap_pvMain}, - { "pvSetCleanup", _wrap_pvSetCleanup}, - { "pvGetEvent", _wrap_pvGetEvent}, - { "pvPollEvent", _wrap_pvPollEvent}, - { "pvWait", _wrap_pvWait}, - { "pvGlUpdate", _wrap_pvGlUpdate}, - { "pvSleep", _wrap_pvSleep}, - { "pvWarning", _wrap_pvWarning}, - { "pvMainFatal", _wrap_pvMainFatal}, - { "pvThreadFatal", _wrap_pvThreadFatal}, - { "pvScreenHint", _wrap_pvScreenHint}, - { "pvSetMouseShape", _wrap_pvSetMouseShape}, - { "pvSetWhatsThis", _wrap_pvSetWhatsThis}, - { "pvWhatsThisPrintf", _wrap_pvWhatsThisPrintf}, - { "pvClientCommand",_wrap_pvClientCommand}, - { "pvWriteTextToFileAtClient", _wrap_pvWriteTextToFileAtClient}, - { "pvZoomMask", _wrap_pvZoomMask}, - { "pvSetManualUrl", _wrap_pvSetManualUrl}, - { "pvSelectLanguage", _wrap_pvSelectLanguage}, - { "pvStartDefinition", _wrap_pvStartDefinition}, - { "pvQWidget", _wrap_pvQWidget}, - { "pvQLayoutVbox", _wrap_pvQLayoutVbox}, - { "pvQLayoutHbox", _wrap_pvQLayoutHbox}, - { "pvQLayoutGrid", _wrap_pvQLayoutGrid}, - { "pvQLabel", _wrap_pvQLabel}, - { "pvQComboBox", _wrap_pvQComboBox}, - { "pvQLineEdit", _wrap_pvQLineEdit}, - { "pvQPushButton", _wrap_pvQPushButton}, - { "pvQLCDNumber", _wrap_pvQLCDNumber}, - { "pvQSlider", _wrap_pvQSlider}, - { "pvQButtonGroup", _wrap_pvQButtonGroup}, - { "pvQRadioButton", _wrap_pvQRadioButton}, - { "pvQCheckBox", _wrap_pvQCheckBox}, - { "pvQFrame", _wrap_pvQFrame}, - { "pvQDraw", _wrap_pvQDraw}, - { "pvQImage",_wrap_pvQImage}, - { "pvQGL", _wrap_pvQGL}, - { "pvQTabWidget", _wrap_pvQTabWidget}, - { "pvQToolBox", _wrap_pvQToolBox}, - { "pvQGroupBox", _wrap_pvQGroupBox}, - { "pvQListBox", _wrap_pvQListBox}, - { "pvQTable", _wrap_pvQTable}, - { "pvQSpinBox", _wrap_pvQSpinBox}, - { "pvQDial", _wrap_pvQDial}, - { "pvQProgressBar",_wrap_pvQProgressBar}, - { "pvQMultiLineEdit", _wrap_pvQMultiLineEdit}, - { "pvQTextBrowser", _wrap_pvQTextBrowser}, - { "pvQListView", _wrap_pvQListView}, - { "pvQIconView", _wrap_pvQIconView}, - { "pvQVtkTclWidget", _wrap_pvQVtkTclWidget}, - { "pvQwtPlotWidget", _wrap_pvQwtPlotWidget}, - { "pvQwtScale", _wrap_pvQwtScale}, - { "pvQwtThermo", _wrap_pvQwtThermo}, - { "pvQwtKnob", _wrap_pvQwtKnob}, - { "pvQwtCounter", _wrap_pvQwtCounter}, - { "pvQwtWheel", _wrap_pvQwtWheel}, - { "pvQwtSlider", _wrap_pvQwtSlider}, - { "pvQwtDial", _wrap_pvQwtDial}, - { "pvQwtCompass", _wrap_pvQwtCompass}, - { "pvQwtAnalogClock", _wrap_pvQwtAnalogClock}, - { "pvQDateEdit", _wrap_pvQDateEdit}, - { "pvQTimeEdit", _wrap_pvQTimeEdit}, - { "pvQDateTimeEdit", _wrap_pvQDateTimeEdit}, - { "pvQCustomWidget",_wrap_pvQCustomWidget}, - { "pvEndDefinition", _wrap_pvEndDefinition}, - { "pvAddWidgetOrLayout", _wrap_pvAddWidgetOrLayout}, - { "pvAddStretch", _wrap_pvAddStretch}, - { "pvTabOrder", _wrap_pvTabOrder}, - { "pvDeleteWidget", _wrap_pvDeleteWidget}, - { "pvSetCaption", _wrap_pvSetCaption}, - { "pvPlaySound", _wrap_pvPlaySound}, - { "pvBeep", _wrap_pvBeep}, - { "pvStatusMessage", _wrap_pvStatusMessage}, - { "pvToolTip", _wrap_pvToolTip}, - { "pvSetTextEx", _wrap_pvSetTextEx}, - { "pvSetText", _wrap_pvSetText}, - { "pvPrintf", _wrap_pvPrintf}, - { "pvSetStyleSheet", _wrap_pvSetStyleSheet}, - { "pvPrintfStyleSheet", _wrap_pvPrintfStyleSheet}, - { "pvSetMinValue", _wrap_pvSetMinValue}, - { "pvSetMaxValue", _wrap_pvSetMaxValue}, - { "pvSetValue", _wrap_pvSetValue}, - { "pvClear", _wrap_pvClear}, - { "pvChangeItem",_wrap_pvChangeItem}, - { "pvInsertItem",_wrap_pvInsertItem}, - { "pvRemoveItem", _wrap_pvRemoveItem}, - { "pvRemoveItemByName", _wrap_pvRemoveItemByName}, - { "pvAddColumn", _wrap_pvAddColumn}, - { "pvRemoveAllColumns", _wrap_pvRemoveAllColumns}, - { "pvSetTableText", _wrap_pvSetTableText}, - { "pvSetTableButton", _wrap_pvSetTableButton}, - { "pvSetTableCheckBox", _wrap_pvSetTableCheckBox}, - { "pvSetTableComboBox", _wrap_pvSetTableComboBox}, - { "pvSetTableLabel", _wrap_pvSetTableLabel}, - { "pvTablePrintf", _wrap_pvTablePrintf}, - { "pvSetTableTextAlignment", _wrap_pvSetTableTextAlignment}, - { "pvMysqldump", _wrap_pvMysqldump}, - { "pvCSVdump",_wrap_pvCSVdump}, - { "pvCSVcreate", _wrap_pvCSVcreate}, - { "pvCSV",_wrap_pvCSV}, - { "pvSetListViewText", _wrap_pvSetListViewText}, - { "pvListViewPrintf", _wrap_pvListViewPrintf}, - { "pvListViewSetSelected", _wrap_pvListViewSetSelected}, - { "pvListBoxSetSelected", _wrap_pvListBoxSetSelected}, - { "pvSetColumnWidth", _wrap_pvSetColumnWidth}, - { "pvSetRowHeight", _wrap_pvSetRowHeight}, - { "pvSetWordWrap", _wrap_pvSetWordWrap}, - { "pvSetPixmap",_wrap_pvSetPixmap}, - { "pvSetTablePixmap",_wrap_pvSetTablePixmap}, - { "pvSetSource", _wrap_pvSetSource}, - { "pvSetImage",_wrap_pvSetImage}, - { "pvSetBufferedJpgImage",_wrap_pvSetBufferedJpgImage}, - { "pvSetBufferTransparency", _wrap_pvSetBufferTransparency}, - { "pvSetBackgroundColor", _wrap_pvSetBackgroundColor}, - { "pvSetPaletteBackgroundColor", _wrap_pvSetPaletteBackgroundColor}, - { "pvSetPaletteForegroundColor", _wrap_pvSetPaletteForegroundColor}, - { "pvSetFontColor", _wrap_pvSetFontColor}, - { "pvSetFont", _wrap_pvSetFont}, - { "pvDisplayNum", _wrap_pvDisplayNum}, - { "pvDisplayFloat", _wrap_pvDisplayFloat}, - { "pvDisplayStr", _wrap_pvDisplayStr}, - { "pvAddTab", _wrap_pvAddTab}, - { "pvSetListViewPixmap",_wrap_pvSetListViewPixmap}, - { "pvRemoveListViewItem", _wrap_pvRemoveListViewItem}, - { "pvRemoveIconViewItem", _wrap_pvRemoveIconViewItem}, - { "pvSetIconViewItem",_wrap_pvSetIconViewItem}, - { "pvSetDateOrder", _wrap_pvSetDateOrder}, - { "pvSetDate", _wrap_pvSetDate}, - { "pvSetMinDate", _wrap_pvSetMinDate}, - { "pvSetMaxDate", _wrap_pvSetMaxDate}, - { "pvSetTime",_wrap_pvSetTime}, - { "pvSetMinTime",_wrap_pvSetMinTime}, - { "pvSetMaxTime",_wrap_pvSetMaxTime}, - { "pvEnsureCellVisible",_wrap_pvEnsureCellVisible}, - { "pvMoveCursor", _wrap_pvMoveCursor}, - { "pvScrollToAnchor", _wrap_pvScrollToAnchor}, - { "pvSetZoomFactor", _wrap_pvSetZoomFactor}, - { "pvPrintHtmlOnPrinter", _wrap_pvPrintHtmlOnPrinter}, - { "pvSetWidgetProperty", _wrap_pvSetWidgetProperty}, - { "pvPassThroughOneJpegFrame",_wrap_pvPassThroughOneJpegFrame}, - { "pvSendJpegFrame",_wrap_pvSendJpegFrame}, - { "pvSendRGBA",_wrap_pvSendRGBA}, - { "pvSaveDrawBuffer", _wrap_pvSaveDrawBuffer}, - { "pvText", _wrap_pvText}, - { "pvRequestJpeg", _wrap_pvRequestJpeg}, - { "pvRequestGeometry", _wrap_pvRequestGeometry}, - { "pvRequestParentWidgetId", _wrap_pvRequestParentWidgetId}, - { "pvSelection", _wrap_pvSelection}, - { "pvRequestSvgBoundsOnElement", _wrap_pvRequestSvgBoundsOnElement}, - { "pvRequestSvgMatrixForElement", _wrap_pvRequestSvgMatrixForElement}, - { "pvMoveContent", _wrap_pvMoveContent}, - { "pvSetGeometry", _wrap_pvSetGeometry}, - { "pvSetMinSize", _wrap_pvSetMinSize}, - { "pvSetMaxSize", _wrap_pvSetMaxSize}, - { "pvSetAlignment", _wrap_pvSetAlignment}, - { "pvSetChecked", _wrap_pvSetChecked}, - { "pvMove", _wrap_pvMove}, - { "pvResize", _wrap_pvResize}, - { "pvHide", _wrap_pvHide}, - { "pvShow", _wrap_pvShow}, - { "pvSetParent", _wrap_pvSetParent}, - { "pvSetMultiSelection", _wrap_pvSetMultiSelection}, - { "pvSetEchoMode", _wrap_pvSetEchoMode}, - { "pvSetEditable", _wrap_pvSetEditable}, - { "pvSetEnabled", _wrap_pvSetEnabled}, - { "pvSetFocus", _wrap_pvSetFocus}, - { "pvTableSetEnabled", _wrap_pvTableSetEnabled}, - { "pvTableSetHeaderResizeEnabled", _wrap_pvTableSetHeaderResizeEnabled}, - { "pvSetSorting", _wrap_pvSetSorting}, - { "pvSetTabPosition", _wrap_pvSetTabPosition}, - { "pvEnableTabBar", _wrap_pvEnableTabBar}, - { "pvSetNumRows", _wrap_pvSetNumRows}, - { "pvSetNumCols", _wrap_pvSetNumCols}, - { "pvInsertRows",_wrap_pvInsertRows}, - { "pvInsertColumns",_wrap_pvInsertColumns}, - { "pvRemoveRow", _wrap_pvRemoveRow}, - { "pvRemoveColumn", _wrap_pvRemoveColumn}, - { "pvSetCurrentItem", _wrap_pvSetCurrentItem}, - { "pvSetTimeEditDisplay", _wrap_pvSetTimeEditDisplay}, - { "pvListViewEnsureVisible", _wrap_pvListViewEnsureVisible}, - { "pvListViewSetOpen", _wrap_pvListViewSetOpen}, - { "pvListViewSetHidden", _wrap_pvListViewSetHidden}, - { "pvListViewSetStandardPopupMenu", _wrap_pvListViewSetStandardPopupMenu}, - { "pvSetStyle", _wrap_pvSetStyle}, - { "pvSetMovie", _wrap_pvSetMovie}, - { "pvMovieControl", _wrap_pvMovieControl}, - { "pvMovieSpeed", _wrap_pvMovieSpeed}, - { "pvAddTabIcon",_wrap_pvAddTabIcon}, - { "pvSetCellWidget", _wrap_pvSetCellWidget}, - { "pvSetContentsMargins", _wrap_pvSetContentsMargins}, - { "pvSetSpacing", _wrap_pvSetSpacing}, - { "pvVtkTcl", _wrap_pvVtkTcl}, - { "pvVtkTclPrintf", _wrap_pvVtkTclPrintf}, - { "pvVtkTclScript", _wrap_pvVtkTclScript}, - { "pvHyperlink", _wrap_pvHyperlink}, - { "pvSendUserEvent", _wrap_pvSendUserEvent}, - { "pvWriteFile", _wrap_pvWriteFile}, - { "pvCloseFile", _wrap_pvCloseFile}, - { "pvGetTextParam", _wrap_pvGetTextParam}, - { "pvGetText", _wrap_pvGetText}, - { "pvParseEventStruct", _wrap_pvParseEventStruct}, - { "pvParseEvent", _wrap_pvParseEvent}, - { "pvCopyToClipboard", _wrap_pvCopyToClipboard}, - { "pvPrint", _wrap_pvPrint}, - { "pvSave",_wrap_pvSave}, - { "pvSaveAsBmp", _wrap_pvSaveAsBmp}, - { "pvHtmlOrSvgDump", _wrap_pvHtmlOrSvgDump}, - { "pvRenderTreeDump", _wrap_pvRenderTreeDump}, - { "pvSendFile", _wrap_pvSendFile}, - { "pvDownloadFileAs", _wrap_pvDownloadFileAs}, - { "pvDownloadFile", _wrap_pvDownloadFile}, - { "pvSetMaxClientsPerIpAdr", _wrap_pvSetMaxClientsPerIpAdr}, - { "pvMaxClientsPerIpAdr", _wrap_pvMaxClientsPerIpAdr}, - { "pvSetMaxClients", _wrap_pvSetMaxClients}, - { "pvMaxClients", _wrap_pvMaxClients}, - { "pvGetAdrTableItem", _wrap_pvGetAdrTableItem}, - { "pvClearMessageQueue", _wrap_pvClearMessageQueue}, - { "pvtcpsend", _wrap_pvtcpsend}, - { "pvtcpsendstring", _wrap_pvtcpsendstring}, - { "pvtcpsend_binary", _wrap_pvtcpsend_binary}, - { "pvtcpreceive", _wrap_pvtcpreceive}, - { "pvtcpreceive_binary", _wrap_pvtcpreceive_binary}, - { "pvSendHttpChunks", _wrap_pvSendHttpChunks}, - { "pvSendHttpContentLength", _wrap_pvSendHttpContentLength}, - { "pvSendHttpResponseFile",_wrap_pvSendHttpResponseFile}, - { "pvSendHttpResponse", _wrap_pvSendHttpResponse}, - { "pvGlBegin", _wrap_pvGlBegin}, - { "pvSendOpenGL",_wrap_pvSendOpenGL}, - { "pvGlEnd", _wrap_pvGlEnd}, - { "pvFileDialog", _wrap_pvFileDialog}, - { "pvPopupMenu", _wrap_pvPopupMenu}, - { "pvMessageBox", _wrap_pvMessageBox}, - { "pvInputDialog", _wrap_pvInputDialog}, - { "pvRunModalDialog", _wrap_pvRunModalDialog}, - { "pvRunModalDialogScript", _wrap_pvRunModalDialogScript}, - { "pvTerminateModalDialog", _wrap_pvTerminateModalDialog}, - { "pvUpdateBaseWindow", _wrap_pvUpdateBaseWindow}, - { "pvUpdateBaseWindowOnOff", _wrap_pvUpdateBaseWindowOnOff}, - { "pvAddDockWidget",_wrap_pvAddDockWidget}, - { "pvDeleteDockWidget",_wrap_pvDeleteDockWidget}, - { "qpwSetCurveData", _wrap_qpwSetCurveData}, - { "qpwSetBufferedCurveData", _wrap_qpwSetBufferedCurveData}, - { "qpwReplot", _wrap_qpwReplot}, - { "qpwSetTitle", _wrap_qpwSetTitle}, - { "qpwSetCanvasBackground", _wrap_qpwSetCanvasBackground}, - { "qpwEnableOutline", _wrap_qpwEnableOutline}, - { "qpwSetOutlinePen", _wrap_qpwSetOutlinePen}, - { "qpwSetAutoLegend", _wrap_qpwSetAutoLegend}, - { "qpwEnableLegend", _wrap_qpwEnableLegend}, - { "qpwSetLegendPos", _wrap_qpwSetLegendPos}, - { "qpwSetLegendFrameStyle", _wrap_qpwSetLegendFrameStyle}, - { "qpwEnableGridXMin", _wrap_qpwEnableGridXMin}, - { "qpwSetGridMajPen", _wrap_qpwSetGridMajPen}, - { "qpwSetGridMinPen", _wrap_qpwSetGridMinPen}, - { "qpwEnableAxis", _wrap_qpwEnableAxis}, - { "qpwSetAxisTitle", _wrap_qpwSetAxisTitle}, - { "qpwSetAxisOptions", _wrap_qpwSetAxisOptions}, - { "qpwSetAxisMaxMajor", _wrap_qpwSetAxisMaxMajor}, - { "qpwSetAxisMaxMinor", _wrap_qpwSetAxisMaxMinor}, - { "qpwInsertCurve", _wrap_qpwInsertCurve}, - { "qpwRemoveCurve", _wrap_qpwRemoveCurve}, - { "qpwSetCurvePen",_wrap_qpwSetCurvePen}, - { "qpwSetCurveSymbol", _wrap_qpwSetCurveSymbol}, - { "qpwSetCurveYAxis", _wrap_qpwSetCurveYAxis}, - { "qpwInsertMarker", _wrap_qpwInsertMarker}, - { "qpwSetMarkerLineStyle", _wrap_qpwSetMarkerLineStyle}, - { "qpwSetMarkerPos", _wrap_qpwSetMarkerPos}, - { "qpwSetMarkerLabelAlign", _wrap_qpwSetMarkerLabelAlign}, - { "qpwSetMarkerPen", _wrap_qpwSetMarkerPen}, - { "qpwSetMarkerLabel", _wrap_qpwSetMarkerLabel}, - { "qpwSetMarkerFont", _wrap_qpwSetMarkerFont}, - { "qpwSetMarkerSymbol", _wrap_qpwSetMarkerSymbol}, - { "qpwInsertLineMarker", _wrap_qpwInsertLineMarker}, - { "qpwSetAxisScaleDraw", _wrap_qpwSetAxisScaleDraw}, - { "qpwSetAxisScale", _wrap_qpwSetAxisScale}, - { "pvSetZoomX", _wrap_pvSetZoomX}, - { "pvSetZoomY", _wrap_pvSetZoomY}, - { "gWriteFile", _wrap_gWriteFile}, - { "gCloseFile", _wrap_gCloseFile}, - { "gBeginDraw", _wrap_gBeginDraw}, - { "gBox", _wrap_gBox}, - { "gRect", _wrap_gRect}, - { "gEndDraw", _wrap_gEndDraw}, - { "gLineTo", _wrap_gLineTo}, - { "gBufferedLine", _wrap_gBufferedLine}, - { "gLine", _wrap_gLine}, - { "gMoveTo", _wrap_gMoveTo}, - { "gRightYAxis", _wrap_gRightYAxis}, - { "gSetColor", _wrap_gSetColor}, - { "gSetWidth", _wrap_gSetWidth}, - { "gSetStyle", _wrap_gSetStyle}, - { "gDrawArc", _wrap_gDrawArc}, - { "gDrawPie", _wrap_gDrawPie}, - { "gDrawPolygon", _wrap_gDrawPolygon}, - { "gSetFont", _wrap_gSetFont}, - { "gSetLinestyle", _wrap_gSetLinestyle}, - { "gText", _wrap_gText}, - { "gTextInAxis", _wrap_gTextInAxis}, - { "gSetFloatFormat", _wrap_gSetFloatFormat}, - { "gXAxis", _wrap_gXAxis}, - { "gYAxis", _wrap_gYAxis}, - { "gXGrid", _wrap_gXGrid}, - { "gYGrid", _wrap_gYGrid}, - { "gBoxWithText", _wrap_gBoxWithText}, - { "gComment", _wrap_gComment}, - { "gPlaySVG", _wrap_gPlaySVG}, - { "gSocketPlaySVG", _wrap_gSocketPlaySVG}, - { "gTranslate", _wrap_gTranslate}, - { "gRotate", _wrap_gRotate}, - { "gScale", _wrap_gScale}, - { "pvSetSelector", _wrap_pvSetSelector}, - { "pvPrintSvgOnPrinter", _wrap_pvPrintSvgOnPrinter}, - { "qwtScaleSetTitle", _wrap_qwtScaleSetTitle}, - { "qwtScaleSetTitleColor", _wrap_qwtScaleSetTitleColor}, - { "qwtScaleSetTitleFont", _wrap_qwtScaleSetTitleFont}, - { "qwtScaleSetTitleAlignment", _wrap_qwtScaleSetTitleAlignment}, - { "qwtScaleSetBorderDist", _wrap_qwtScaleSetBorderDist}, - { "qwtScaleSetBaselineDist", _wrap_qwtScaleSetBaselineDist}, - { "qwtScaleSetScaleDiv", _wrap_qwtScaleSetScaleDiv}, - { "qwtScaleSetLabelFormat", _wrap_qwtScaleSetLabelFormat}, - { "qwtScaleSetLabelAlignment", _wrap_qwtScaleSetLabelAlignment}, - { "qwtScaleSetLabelRotation", _wrap_qwtScaleSetLabelRotation}, - { "qwtScaleSetPosition", _wrap_qwtScaleSetPosition}, - { "qwtThermoSetScale", _wrap_qwtThermoSetScale}, - { "qwtThermoSetOrientation", _wrap_qwtThermoSetOrientation}, - { "qwtThermoSetBorderWidth", _wrap_qwtThermoSetBorderWidth}, - { "qwtThermoSetFillColor", _wrap_qwtThermoSetFillColor}, - { "qwtThermoSetAlarmColor", _wrap_qwtThermoSetAlarmColor}, - { "qwtThermoSetAlarmLevel", _wrap_qwtThermoSetAlarmLevel}, - { "qwtThermoSetAlarmEnabled", _wrap_qwtThermoSetAlarmEnabled}, - { "qwtThermoSetPipeWidth", _wrap_qwtThermoSetPipeWidth}, - { "qwtThermoSetRange",_wrap_qwtThermoSetRange}, - { "qwtThermoSetMargin", _wrap_qwtThermoSetMargin}, - { "qwtThermoSetValue", _wrap_qwtThermoSetValue}, - { "qwtKnobSetScale", _wrap_qwtKnobSetScale}, - { "qwtKnobSetMass", _wrap_qwtKnobSetMass}, - { "qwtKnobSetOrientation", _wrap_qwtKnobSetOrientation}, - { "qwtKnobSetReadOnly", _wrap_qwtKnobSetReadOnly}, - { "qwtKnobSetKnobWidth", _wrap_qwtKnobSetKnobWidth}, - { "qwtKnobSetTotalAngle", _wrap_qwtKnobSetTotalAngle}, - { "qwtKnobSetBorderWidth", _wrap_qwtKnobSetBorderWidth}, - { "qwtKnobSetSymbol", _wrap_qwtKnobSetSymbol}, - { "qwtKnobSetValue", _wrap_qwtKnobSetValue}, - { "qwtCounterSetStep", _wrap_qwtCounterSetStep}, - { "qwtCounterSetMinValue", _wrap_qwtCounterSetMinValue}, - { "qwtCounterSetMaxValue", _wrap_qwtCounterSetMaxValue}, - { "qwtCounterSetStepButton1", _wrap_qwtCounterSetStepButton1}, - { "qwtCounterSetStepButton2", _wrap_qwtCounterSetStepButton2}, - { "qwtCounterSetStepButton3", _wrap_qwtCounterSetStepButton3}, - { "qwtCounterSetNumButtons", _wrap_qwtCounterSetNumButtons}, - { "qwtCounterSetIncSteps", _wrap_qwtCounterSetIncSteps}, - { "qwtCounterSetValue", _wrap_qwtCounterSetValue}, - { "qwtWheelSetMass", _wrap_qwtWheelSetMass}, - { "qwtWheelSetOrientation", _wrap_qwtWheelSetOrientation}, - { "qwtWheelSetReadOnly", _wrap_qwtWheelSetReadOnly}, - { "qwtWheelSetTotalAngle", _wrap_qwtWheelSetTotalAngle}, - { "qwtWheelSetTickCnt", _wrap_qwtWheelSetTickCnt}, - { "qwtWheelSetViewAngle", _wrap_qwtWheelSetViewAngle}, - { "qwtWheelSetInternalBorder", _wrap_qwtWheelSetInternalBorder}, - { "qwtWheelSetWheelWidth", _wrap_qwtWheelSetWheelWidth}, - { "qwtWheelSetValue", _wrap_qwtWheelSetValue}, - { "qwtSliderSetScale", _wrap_qwtSliderSetScale}, - { "qwtSliderSetMass", _wrap_qwtSliderSetMass}, - { "qwtSliderSetOrientation", _wrap_qwtSliderSetOrientation}, - { "qwtSliderSetReadOnly", _wrap_qwtSliderSetReadOnly}, - { "qwtSliderSetBgStyle", _wrap_qwtSliderSetBgStyle}, - { "qwtSliderSetScalePos", _wrap_qwtSliderSetScalePos}, - { "qwtSliderSetThumbLength", _wrap_qwtSliderSetThumbLength}, - { "qwtSliderSetThumbWidth", _wrap_qwtSliderSetThumbWidth}, - { "qwtSliderSetBorderWidth", _wrap_qwtSliderSetBorderWidth}, - { "qwtSliderSetMargins", _wrap_qwtSliderSetMargins}, - { "qwtSliderSetValue", _wrap_qwtSliderSetValue}, - { "qwtCompassSetSimpleCompassRose",_wrap_qwtCompassSetSimpleCompassRose}, - { "qwtCompassSetRange",_wrap_qwtCompassSetRange}, - { "qwtCompassSetMass", _wrap_qwtCompassSetMass}, - { "qwtCompassSetReadOnly", _wrap_qwtCompassSetReadOnly}, - { "qwtCompassSetFrameShadow", _wrap_qwtCompassSetFrameShadow}, - { "qwtCompassShowBackground", _wrap_qwtCompassShowBackground}, - { "qwtCompassSetLineWidth", _wrap_qwtCompassSetLineWidth}, - { "qwtCompassSetMode", _wrap_qwtCompassSetMode}, - { "qwtCompassSetWrapping", _wrap_qwtCompassSetWrapping}, - { "qwtCompassSetScale", _wrap_qwtCompassSetScale}, - { "qwtCompassSetScaleArc", _wrap_qwtCompassSetScaleArc}, - { "qwtCompassSetOrigin", _wrap_qwtCompassSetOrigin}, - { "qwtCompassSetNeedle",_wrap_qwtCompassSetNeedle}, - { "qwtCompassSetValue", _wrap_qwtCompassSetValue}, - { "qwtDialSetRange",_wrap_qwtDialSetRange}, - { "qwtDialSetMass", _wrap_qwtDialSetMass}, - { "qwtDialSetReadOnly", _wrap_qwtDialSetReadOnly}, - { "qwtDialSetFrameShadow", _wrap_qwtDialSetFrameShadow}, - { "qwtDialShowBackground", _wrap_qwtDialShowBackground}, - { "qwtDialSetLineWidth", _wrap_qwtDialSetLineWidth}, - { "qwtDialSetMode", _wrap_qwtDialSetMode}, - { "qwtDialSetWrapping", _wrap_qwtDialSetWrapping}, - { "qwtDialSetScale", _wrap_qwtDialSetScale}, - { "qwtDialSetScaleArc", _wrap_qwtDialSetScaleArc}, - { "qwtDialSetOrigin", _wrap_qwtDialSetOrigin}, - { "qwtDialSetNeedle",_wrap_qwtDialSetNeedle}, - { "qwtDialSetValue", _wrap_qwtDialSetValue}, - { "qwtAnalogClockSetTime", _wrap_qwtAnalogClockSetTime}, - { "qwtAnalogClockSetMass", _wrap_qwtAnalogClockSetMass}, - { "qwtAnalogClockSetReadOnly", _wrap_qwtAnalogClockSetReadOnly}, - { "qwtAnalogClockSetFrameShadow", _wrap_qwtAnalogClockSetFrameShadow}, - { "qwtAnalogClockShowBackground", _wrap_qwtAnalogClockShowBackground}, - { "qwtAnalogClockSetLineWidth", _wrap_qwtAnalogClockSetLineWidth}, - { "qwtAnalogClockSetMode", _wrap_qwtAnalogClockSetMode}, - { "qwtAnalogClockSetWrapping", _wrap_qwtAnalogClockSetWrapping}, - { "qwtAnalogClockSetScale", _wrap_qwtAnalogClockSetScale}, - { "qwtAnalogClockSetScaleArc", _wrap_qwtAnalogClockSetScaleArc}, - { "qwtAnalogClockSetOrigin", _wrap_qwtAnalogClockSetOrigin}, - { "qwtAnalogClockSetNeedle",_wrap_qwtAnalogClockSetNeedle}, - { "qwtAnalogClockSetValue", _wrap_qwtAnalogClockSetValue}, - { "unit", _wrap_unit}, - { "textEventType", _wrap_textEventType}, - { "svgObjectName", _wrap_svgObjectName}, - { "getSvgBoundsOnElement", _wrap_getSvgBoundsOnElement}, - { "getSvgMatrixForElement", _wrap_getSvgMatrixForElement}, - { "getGeometry", _wrap_getGeometry}, - { "getParentWidgetId", _wrap_getParentWidgetId}, - { "getParam", _wrap_getParam}, - { "pvQImageScript", _wrap_pvQImageScript}, - { "new_int", _wrap_new_int}, - { "get_int", _wrap_get_int}, - { "delete_int", _wrap_delete_int}, - {0,0} -}; + arg2 = (int)lua_tonumber(L, 2); + arg3 = (int)lua_tonumber(L, 3); + arg4 = (char *)lua_tostring(L, 4); + result = (int)pvQImageScript(arg1,arg2,arg3,(char const *)arg4); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_int(lua_State* L) { + int SWIG_arg = 0; + int arg1 ; + int *result = 0 ; + + SWIG_check_num_args("new_int",1,1) + if(!lua_isnumber(L,1)) SWIG_fail_arg("new_int",1,"int"); + arg1 = (int)lua_tonumber(L, 1); + result = (int *)new_int(arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_int,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_get_int(lua_State* L) { + int SWIG_arg = 0; + int *arg1 = (int *) 0 ; + int result; + + SWIG_check_num_args("get_int",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_int",1,"int *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_int,0))){ + SWIG_fail_ptr("get_int",1,SWIGTYPE_p_int); + } + + result = (int)get_int(arg1); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_delete_int(lua_State* L) { + int SWIG_arg = 0; + int *arg1 = (int *) 0 ; + + SWIG_check_num_args("delete_int",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("delete_int",1,"int *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_int,0))){ + SWIG_fail_ptr("delete_int",1,SWIGTYPE_p_int); + } + + delete_int(arg1); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} -static swig_lua_var_info swig_variables[] = { + +static swig_lua_attribute swig_SwigModule_attributes[] = { { "pvserver_version", _wrap_pvserver_version_get, SWIG_Lua_set_immutable }, { "null_string", _wrap_null_string_get, SWIG_Lua_set_immutable }, {0,0,0} }; - -static swig_lua_const_info swig_constants[] = { +static swig_lua_const_info swig_SwigModule_constants[]= { {SWIG_LUA_CONSTTAB_INT("pv_STDIN", 0)}, {SWIG_LUA_CONSTTAB_INT("pv_STDOUT", 1)}, {SWIG_LUA_CONSTTAB_INT("MAX_PRINTF_LENGTH", 1024)}, @@ -30099,6 +30877,480 @@ static swig_lua_const_info swig_constants[] = { {SWIG_LUA_CONSTTAB_STRING("RESIZE_GL", "resizeGL")}, {0,0,0,0,0,0} }; +static swig_lua_method swig_SwigModule_methods[]= { + { "glencode_set_param", _wrap_glencode_set_param}, + { "pvlock", _wrap_pvlock}, + { "pvunlock", _wrap_pvunlock}, + { "pvsystem", _wrap_pvsystem}, + { "pvGetLocalTime", _wrap_pvGetLocalTime}, + { "pvIsAccessAllowed", _wrap_pvIsAccessAllowed}, + { "pvSendVersion", _wrap_pvSendVersion}, + { "pvXYAllocate", _wrap_pvXYAllocate}, + { "getIntegers", _wrap_getIntegers}, + { "getFloats", _wrap_getFloats}, + { "getTextFromText", _wrap_getTextFromText}, + { "pvSetXY", _wrap_pvSetXY}, + { "pvGetSocketPointer", _wrap_pvGetSocketPointer}, + { "pvInitInternal", _wrap_pvInitInternal}, + { "pvInit", _wrap_pvInit}, + { "pvAccept", _wrap_pvAccept}, + { "pvCreateThread", _wrap_pvCreateThread}, + { "pvGetInitialMask", _wrap_pvGetInitialMask}, + { "pvMain", _wrap_pvMain}, + { "pvSetCleanup", _wrap_pvSetCleanup}, + { "pvGetEvent", _wrap_pvGetEvent}, + { "pvPollEvent", _wrap_pvPollEvent}, + { "pvWait", _wrap_pvWait}, + { "pvGlUpdate", _wrap_pvGlUpdate}, + { "pvSleep", _wrap_pvSleep}, + { "pvWarning", _wrap_pvWarning}, + { "pvMainFatal", _wrap_pvMainFatal}, + { "pvThreadFatal", _wrap_pvThreadFatal}, + { "pvScreenHint", _wrap_pvScreenHint}, + { "pvSetMouseShape", _wrap_pvSetMouseShape}, + { "pvSetWhatsThis", _wrap_pvSetWhatsThis}, + { "pvWhatsThisPrintf", _wrap_pvWhatsThisPrintf}, + { "pvClientCommand", _wrap_pvClientCommand}, + { "pvWriteTextToFileAtClient", _wrap_pvWriteTextToFileAtClient}, + { "pvZoomMask", _wrap_pvZoomMask}, + { "pvSetManualUrl", _wrap_pvSetManualUrl}, + { "pvSelectLanguage", _wrap_pvSelectLanguage}, + { "pvStartDefinition", _wrap_pvStartDefinition}, + { "pvQWidget", _wrap_pvQWidget}, + { "pvQLayoutVbox", _wrap_pvQLayoutVbox}, + { "pvQLayoutHbox", _wrap_pvQLayoutHbox}, + { "pvQLayoutGrid", _wrap_pvQLayoutGrid}, + { "pvQLabel", _wrap_pvQLabel}, + { "pvQComboBox", _wrap_pvQComboBox}, + { "pvQLineEdit", _wrap_pvQLineEdit}, + { "pvQPushButton", _wrap_pvQPushButton}, + { "pvQLCDNumber", _wrap_pvQLCDNumber}, + { "pvQSlider", _wrap_pvQSlider}, + { "pvQButtonGroup", _wrap_pvQButtonGroup}, + { "pvQRadioButton", _wrap_pvQRadioButton}, + { "pvQCheckBox", _wrap_pvQCheckBox}, + { "pvQFrame", _wrap_pvQFrame}, + { "pvQDraw", _wrap_pvQDraw}, + { "pvQImage", _wrap_pvQImage}, + { "pvQGL", _wrap_pvQGL}, + { "pvQTabWidget", _wrap_pvQTabWidget}, + { "pvQToolBox", _wrap_pvQToolBox}, + { "pvQGroupBox", _wrap_pvQGroupBox}, + { "pvQListBox", _wrap_pvQListBox}, + { "pvQTable", _wrap_pvQTable}, + { "pvQSpinBox", _wrap_pvQSpinBox}, + { "pvQDial", _wrap_pvQDial}, + { "pvQProgressBar", _wrap_pvQProgressBar}, + { "pvQMultiLineEdit", _wrap_pvQMultiLineEdit}, + { "pvQTextBrowser", _wrap_pvQTextBrowser}, + { "pvQListView", _wrap_pvQListView}, + { "pvQIconView", _wrap_pvQIconView}, + { "pvQVtkTclWidget", _wrap_pvQVtkTclWidget}, + { "pvQwtPlotWidget", _wrap_pvQwtPlotWidget}, + { "pvQwtScale", _wrap_pvQwtScale}, + { "pvQwtThermo", _wrap_pvQwtThermo}, + { "pvQwtKnob", _wrap_pvQwtKnob}, + { "pvQwtCounter", _wrap_pvQwtCounter}, + { "pvQwtWheel", _wrap_pvQwtWheel}, + { "pvQwtSlider", _wrap_pvQwtSlider}, + { "pvQwtDial", _wrap_pvQwtDial}, + { "pvQwtCompass", _wrap_pvQwtCompass}, + { "pvQwtAnalogClock", _wrap_pvQwtAnalogClock}, + { "pvQDateEdit", _wrap_pvQDateEdit}, + { "pvQTimeEdit", _wrap_pvQTimeEdit}, + { "pvQDateTimeEdit", _wrap_pvQDateTimeEdit}, + { "pvQCustomWidget", _wrap_pvQCustomWidget}, + { "pvEndDefinition", _wrap_pvEndDefinition}, + { "pvAddWidgetOrLayout", _wrap_pvAddWidgetOrLayout}, + { "pvAddStretch", _wrap_pvAddStretch}, + { "pvTabOrder", _wrap_pvTabOrder}, + { "pvDeleteWidget", _wrap_pvDeleteWidget}, + { "pvSetCaption", _wrap_pvSetCaption}, + { "pvPlaySound", _wrap_pvPlaySound}, + { "pvBeep", _wrap_pvBeep}, + { "pvStatusMessage", _wrap_pvStatusMessage}, + { "pvToolTip", _wrap_pvToolTip}, + { "pvSetTextEx", _wrap_pvSetTextEx}, + { "pvSetText", _wrap_pvSetText}, + { "pvPrintf", _wrap_pvPrintf}, + { "pvSetStyleSheet", _wrap_pvSetStyleSheet}, + { "pvPrintfStyleSheet", _wrap_pvPrintfStyleSheet}, + { "pvSetMinValue", _wrap_pvSetMinValue}, + { "pvSetMaxValue", _wrap_pvSetMaxValue}, + { "pvSetValue", _wrap_pvSetValue}, + { "pvClear", _wrap_pvClear}, + { "pvChangeItem", _wrap_pvChangeItem}, + { "pvInsertItem", _wrap_pvInsertItem}, + { "pvRemoveItem", _wrap_pvRemoveItem}, + { "pvRemoveItemByName", _wrap_pvRemoveItemByName}, + { "pvAddColumn", _wrap_pvAddColumn}, + { "pvRemoveAllColumns", _wrap_pvRemoveAllColumns}, + { "pvSetTableText", _wrap_pvSetTableText}, + { "pvSetTableButton", _wrap_pvSetTableButton}, + { "pvSetTableCheckBox", _wrap_pvSetTableCheckBox}, + { "pvSetTableComboBox", _wrap_pvSetTableComboBox}, + { "pvSetTableLabel", _wrap_pvSetTableLabel}, + { "pvTablePrintf", _wrap_pvTablePrintf}, + { "pvSetTableTextAlignment", _wrap_pvSetTableTextAlignment}, + { "pvMysqldump", _wrap_pvMysqldump}, + { "pvCSVdump", _wrap_pvCSVdump}, + { "pvCSVcreate", _wrap_pvCSVcreate}, + { "pvCSV", _wrap_pvCSV}, + { "pvSetListViewText", _wrap_pvSetListViewText}, + { "pvListViewPrintf", _wrap_pvListViewPrintf}, + { "pvListViewSetSelected", _wrap_pvListViewSetSelected}, + { "pvListBoxSetSelected", _wrap_pvListBoxSetSelected}, + { "pvSetColumnWidth", _wrap_pvSetColumnWidth}, + { "pvSetRowHeight", _wrap_pvSetRowHeight}, + { "pvSetWordWrap", _wrap_pvSetWordWrap}, + { "pvSetPixmap", _wrap_pvSetPixmap}, + { "pvSetTablePixmap", _wrap_pvSetTablePixmap}, + { "pvSetSource", _wrap_pvSetSource}, + { "pvSetImage", _wrap_pvSetImage}, + { "pvSetBufferedJpgImage", _wrap_pvSetBufferedJpgImage}, + { "pvSetBufferTransparency", _wrap_pvSetBufferTransparency}, + { "pvSetBackgroundColor", _wrap_pvSetBackgroundColor}, + { "pvSetPaletteBackgroundColor", _wrap_pvSetPaletteBackgroundColor}, + { "pvSetPaletteForegroundColor", _wrap_pvSetPaletteForegroundColor}, + { "pvSetFontColor", _wrap_pvSetFontColor}, + { "pvSetFont", _wrap_pvSetFont}, + { "pvDisplayNum", _wrap_pvDisplayNum}, + { "pvDisplayFloat", _wrap_pvDisplayFloat}, + { "pvDisplayStr", _wrap_pvDisplayStr}, + { "pvAddTab", _wrap_pvAddTab}, + { "pvSetListViewPixmap", _wrap_pvSetListViewPixmap}, + { "pvRemoveListViewItem", _wrap_pvRemoveListViewItem}, + { "pvRemoveIconViewItem", _wrap_pvRemoveIconViewItem}, + { "pvSetIconViewItem", _wrap_pvSetIconViewItem}, + { "pvSetDateOrder", _wrap_pvSetDateOrder}, + { "pvSetDate", _wrap_pvSetDate}, + { "pvSetMinDate", _wrap_pvSetMinDate}, + { "pvSetMaxDate", _wrap_pvSetMaxDate}, + { "pvSetTime", _wrap_pvSetTime}, + { "pvSetMinTime", _wrap_pvSetMinTime}, + { "pvSetMaxTime", _wrap_pvSetMaxTime}, + { "pvEnsureCellVisible", _wrap_pvEnsureCellVisible}, + { "pvMoveCursor", _wrap_pvMoveCursor}, + { "pvScrollToAnchor", _wrap_pvScrollToAnchor}, + { "pvSetZoomFactor", _wrap_pvSetZoomFactor}, + { "pvPrintHtmlOnPrinter", _wrap_pvPrintHtmlOnPrinter}, + { "pvSetWidgetProperty", _wrap_pvSetWidgetProperty}, + { "pvPassThroughOneJpegFrame", _wrap_pvPassThroughOneJpegFrame}, + { "pvSendJpegFrame", _wrap_pvSendJpegFrame}, + { "pvSendRGBA", _wrap_pvSendRGBA}, + { "pvSaveDrawBuffer", _wrap_pvSaveDrawBuffer}, + { "pvWaitpid", _wrap_pvWaitpid}, + { "pvText", _wrap_pvText}, + { "pvRequestJpeg", _wrap_pvRequestJpeg}, + { "pvRequestGeometry", _wrap_pvRequestGeometry}, + { "pvRequestParentWidgetId", _wrap_pvRequestParentWidgetId}, + { "pvSelection", _wrap_pvSelection}, + { "pvRequestSvgBoundsOnElement", _wrap_pvRequestSvgBoundsOnElement}, + { "pvRequestSvgMatrixForElement", _wrap_pvRequestSvgMatrixForElement}, + { "pvMoveContent", _wrap_pvMoveContent}, + { "pvSetGeometry", _wrap_pvSetGeometry}, + { "pvSetMinSize", _wrap_pvSetMinSize}, + { "pvSetMaxSize", _wrap_pvSetMaxSize}, + { "pvSetAlignment", _wrap_pvSetAlignment}, + { "pvSetChecked", _wrap_pvSetChecked}, + { "pvMove", _wrap_pvMove}, + { "pvResize", _wrap_pvResize}, + { "pvHide", _wrap_pvHide}, + { "pvShow", _wrap_pvShow}, + { "pvSetParent", _wrap_pvSetParent}, + { "pvSetMultiSelection", _wrap_pvSetMultiSelection}, + { "pvSetEchoMode", _wrap_pvSetEchoMode}, + { "pvSetEditable", _wrap_pvSetEditable}, + { "pvSetEnabled", _wrap_pvSetEnabled}, + { "pvSetFocus", _wrap_pvSetFocus}, + { "pvTableSetEnabled", _wrap_pvTableSetEnabled}, + { "pvTableSetHeaderResizeEnabled", _wrap_pvTableSetHeaderResizeEnabled}, + { "pvSetSorting", _wrap_pvSetSorting}, + { "pvSetTabPosition", _wrap_pvSetTabPosition}, + { "pvEnableTabBar", _wrap_pvEnableTabBar}, + { "pvSetNumRows", _wrap_pvSetNumRows}, + { "pvSetNumCols", _wrap_pvSetNumCols}, + { "pvInsertRows", _wrap_pvInsertRows}, + { "pvInsertColumns", _wrap_pvInsertColumns}, + { "pvRemoveRow", _wrap_pvRemoveRow}, + { "pvRemoveColumn", _wrap_pvRemoveColumn}, + { "pvSetCurrentItem", _wrap_pvSetCurrentItem}, + { "pvSetTimeEditDisplay", _wrap_pvSetTimeEditDisplay}, + { "pvListViewEnsureVisible", _wrap_pvListViewEnsureVisible}, + { "pvListViewSetOpen", _wrap_pvListViewSetOpen}, + { "pvListViewSetHidden", _wrap_pvListViewSetHidden}, + { "pvListViewSetStandardPopupMenu", _wrap_pvListViewSetStandardPopupMenu}, + { "pvSetStyle", _wrap_pvSetStyle}, + { "pvSetMovie", _wrap_pvSetMovie}, + { "pvMovieControl", _wrap_pvMovieControl}, + { "pvMovieSpeed", _wrap_pvMovieSpeed}, + { "pvAddTabIcon", _wrap_pvAddTabIcon}, + { "pvSetCellWidget", _wrap_pvSetCellWidget}, + { "pvSetContentsMargins", _wrap_pvSetContentsMargins}, + { "pvSetSpacing", _wrap_pvSetSpacing}, + { "pvVtkTcl", _wrap_pvVtkTcl}, + { "pvVtkTclPrintf", _wrap_pvVtkTclPrintf}, + { "pvVtkTclScript", _wrap_pvVtkTclScript}, + { "pvHyperlink", _wrap_pvHyperlink}, + { "pvSendUserEvent", _wrap_pvSendUserEvent}, + { "pvWriteFile", _wrap_pvWriteFile}, + { "pvCloseFile", _wrap_pvCloseFile}, + { "pvGetTextParam", _wrap_pvGetTextParam}, + { "pvGetText", _wrap_pvGetText}, + { "pvParseEventStruct", _wrap_pvParseEventStruct}, + { "pvParseEvent", _wrap_pvParseEvent}, + { "pvCopyToClipboard", _wrap_pvCopyToClipboard}, + { "pvPrint", _wrap_pvPrint}, + { "pvSave", _wrap_pvSave}, + { "pvSaveAsBmp", _wrap_pvSaveAsBmp}, + { "pvHtmlOrSvgDump", _wrap_pvHtmlOrSvgDump}, + { "pvRenderTreeDump", _wrap_pvRenderTreeDump}, + { "pvSendFile", _wrap_pvSendFile}, + { "pvDownloadFileAs", _wrap_pvDownloadFileAs}, + { "pvDownloadFile", _wrap_pvDownloadFile}, + { "pvSetMaxClientsPerIpAdr", _wrap_pvSetMaxClientsPerIpAdr}, + { "pvMaxClientsPerIpAdr", _wrap_pvMaxClientsPerIpAdr}, + { "pvSetMaxClients", _wrap_pvSetMaxClients}, + { "pvMaxClients", _wrap_pvMaxClients}, + { "pvGetAdrTableItem", _wrap_pvGetAdrTableItem}, + { "pvClearMessageQueue", _wrap_pvClearMessageQueue}, + { "pvtcpsend", _wrap_pvtcpsend}, + { "pvtcpsendstring", _wrap_pvtcpsendstring}, + { "pvtcpsend_binary", _wrap_pvtcpsend_binary}, + { "pvtcpreceive", _wrap_pvtcpreceive}, + { "pvtcpreceive_binary", _wrap_pvtcpreceive_binary}, + { "pvSendHttpChunks", _wrap_pvSendHttpChunks}, + { "pvSendHttpContentLength", _wrap_pvSendHttpContentLength}, + { "pvSendHttpResponseFile", _wrap_pvSendHttpResponseFile}, + { "pvSendHttpResponse", _wrap_pvSendHttpResponse}, + { "pvGlBegin", _wrap_pvGlBegin}, + { "pvSendOpenGL", _wrap_pvSendOpenGL}, + { "pvGlEnd", _wrap_pvGlEnd}, + { "pvFileDialog", _wrap_pvFileDialog}, + { "pvPopupMenu", _wrap_pvPopupMenu}, + { "pvMessageBox", _wrap_pvMessageBox}, + { "pvInputDialog", _wrap_pvInputDialog}, + { "pvRunModalDialog", _wrap_pvRunModalDialog}, + { "pvRunModalDialogScript", _wrap_pvRunModalDialogScript}, + { "pvTerminateModalDialog", _wrap_pvTerminateModalDialog}, + { "pvUpdateBaseWindow", _wrap_pvUpdateBaseWindow}, + { "pvUpdateBaseWindowOnOff", _wrap_pvUpdateBaseWindowOnOff}, + { "pvAddDockWidget", _wrap_pvAddDockWidget}, + { "pvDeleteDockWidget", _wrap_pvDeleteDockWidget}, + { "qpwSetCurveData", _wrap_qpwSetCurveData}, + { "qpwSetBufferedCurveData", _wrap_qpwSetBufferedCurveData}, + { "qpwReplot", _wrap_qpwReplot}, + { "qpwSetTitle", _wrap_qpwSetTitle}, + { "qpwSetCanvasBackground", _wrap_qpwSetCanvasBackground}, + { "qpwEnableOutline", _wrap_qpwEnableOutline}, + { "qpwSetOutlinePen", _wrap_qpwSetOutlinePen}, + { "qpwSetAutoLegend", _wrap_qpwSetAutoLegend}, + { "qpwEnableLegend", _wrap_qpwEnableLegend}, + { "qpwSetLegendPos", _wrap_qpwSetLegendPos}, + { "qpwSetLegendFrameStyle", _wrap_qpwSetLegendFrameStyle}, + { "qpwEnableGridXMin", _wrap_qpwEnableGridXMin}, + { "qpwSetGridMajPen", _wrap_qpwSetGridMajPen}, + { "qpwSetGridMinPen", _wrap_qpwSetGridMinPen}, + { "qpwEnableAxis", _wrap_qpwEnableAxis}, + { "qpwSetAxisTitle", _wrap_qpwSetAxisTitle}, + { "qpwSetAxisOptions", _wrap_qpwSetAxisOptions}, + { "qpwSetAxisMaxMajor", _wrap_qpwSetAxisMaxMajor}, + { "qpwSetAxisMaxMinor", _wrap_qpwSetAxisMaxMinor}, + { "qpwInsertCurve", _wrap_qpwInsertCurve}, + { "qpwRemoveCurve", _wrap_qpwRemoveCurve}, + { "qpwSetCurvePen", _wrap_qpwSetCurvePen}, + { "qpwSetCurveSymbol", _wrap_qpwSetCurveSymbol}, + { "qpwSetCurveYAxis", _wrap_qpwSetCurveYAxis}, + { "qpwInsertMarker", _wrap_qpwInsertMarker}, + { "qpwSetMarkerLineStyle", _wrap_qpwSetMarkerLineStyle}, + { "qpwSetMarkerPos", _wrap_qpwSetMarkerPos}, + { "qpwSetMarkerLabelAlign", _wrap_qpwSetMarkerLabelAlign}, + { "qpwSetMarkerPen", _wrap_qpwSetMarkerPen}, + { "qpwSetMarkerLabel", _wrap_qpwSetMarkerLabel}, + { "qpwSetMarkerFont", _wrap_qpwSetMarkerFont}, + { "qpwSetMarkerSymbol", _wrap_qpwSetMarkerSymbol}, + { "qpwInsertLineMarker", _wrap_qpwInsertLineMarker}, + { "qpwSetAxisScaleDraw", _wrap_qpwSetAxisScaleDraw}, + { "qpwSetAxisScale", _wrap_qpwSetAxisScale}, + { "pvSetZoomX", _wrap_pvSetZoomX}, + { "pvSetZoomY", _wrap_pvSetZoomY}, + { "gWriteFile", _wrap_gWriteFile}, + { "gCloseFile", _wrap_gCloseFile}, + { "gBeginDraw", _wrap_gBeginDraw}, + { "gBox", _wrap_gBox}, + { "gRect", _wrap_gRect}, + { "gEndDraw", _wrap_gEndDraw}, + { "gLineTo", _wrap_gLineTo}, + { "gBufferedLine", _wrap_gBufferedLine}, + { "gLine", _wrap_gLine}, + { "gMoveTo", _wrap_gMoveTo}, + { "gRightYAxis", _wrap_gRightYAxis}, + { "gSetColor", _wrap_gSetColor}, + { "gSetWidth", _wrap_gSetWidth}, + { "gSetStyle", _wrap_gSetStyle}, + { "gDrawArc", _wrap_gDrawArc}, + { "gDrawPie", _wrap_gDrawPie}, + { "gDrawPolygon", _wrap_gDrawPolygon}, + { "gSetFont", _wrap_gSetFont}, + { "gSetLinestyle", _wrap_gSetLinestyle}, + { "gText", _wrap_gText}, + { "gTextInAxis", _wrap_gTextInAxis}, + { "gSetFloatFormat", _wrap_gSetFloatFormat}, + { "gXAxis", _wrap_gXAxis}, + { "gYAxis", _wrap_gYAxis}, + { "gXGrid", _wrap_gXGrid}, + { "gYGrid", _wrap_gYGrid}, + { "gBoxWithText", _wrap_gBoxWithText}, + { "gComment", _wrap_gComment}, + { "gPlaySVG", _wrap_gPlaySVG}, + { "gSocketPlaySVG", _wrap_gSocketPlaySVG}, + { "gTranslate", _wrap_gTranslate}, + { "gRotate", _wrap_gRotate}, + { "gScale", _wrap_gScale}, + { "pvSetSelector", _wrap_pvSetSelector}, + { "pvPrintSvgOnPrinter", _wrap_pvPrintSvgOnPrinter}, + { "qwtScaleSetTitle", _wrap_qwtScaleSetTitle}, + { "qwtScaleSetTitleColor", _wrap_qwtScaleSetTitleColor}, + { "qwtScaleSetTitleFont", _wrap_qwtScaleSetTitleFont}, + { "qwtScaleSetTitleAlignment", _wrap_qwtScaleSetTitleAlignment}, + { "qwtScaleSetBorderDist", _wrap_qwtScaleSetBorderDist}, + { "qwtScaleSetBaselineDist", _wrap_qwtScaleSetBaselineDist}, + { "qwtScaleSetScaleDiv", _wrap_qwtScaleSetScaleDiv}, + { "qwtScaleSetLabelFormat", _wrap_qwtScaleSetLabelFormat}, + { "qwtScaleSetLabelAlignment", _wrap_qwtScaleSetLabelAlignment}, + { "qwtScaleSetLabelRotation", _wrap_qwtScaleSetLabelRotation}, + { "qwtScaleSetPosition", _wrap_qwtScaleSetPosition}, + { "qwtThermoSetScale", _wrap_qwtThermoSetScale}, + { "qwtThermoSetOrientation", _wrap_qwtThermoSetOrientation}, + { "qwtThermoSetBorderWidth", _wrap_qwtThermoSetBorderWidth}, + { "qwtThermoSetFillColor", _wrap_qwtThermoSetFillColor}, + { "qwtThermoSetAlarmColor", _wrap_qwtThermoSetAlarmColor}, + { "qwtThermoSetAlarmLevel", _wrap_qwtThermoSetAlarmLevel}, + { "qwtThermoSetAlarmEnabled", _wrap_qwtThermoSetAlarmEnabled}, + { "qwtThermoSetPipeWidth", _wrap_qwtThermoSetPipeWidth}, + { "qwtThermoSetRange", _wrap_qwtThermoSetRange}, + { "qwtThermoSetMargin", _wrap_qwtThermoSetMargin}, + { "qwtThermoSetValue", _wrap_qwtThermoSetValue}, + { "qwtKnobSetScale", _wrap_qwtKnobSetScale}, + { "qwtKnobSetMass", _wrap_qwtKnobSetMass}, + { "qwtKnobSetOrientation", _wrap_qwtKnobSetOrientation}, + { "qwtKnobSetReadOnly", _wrap_qwtKnobSetReadOnly}, + { "qwtKnobSetKnobWidth", _wrap_qwtKnobSetKnobWidth}, + { "qwtKnobSetTotalAngle", _wrap_qwtKnobSetTotalAngle}, + { "qwtKnobSetBorderWidth", _wrap_qwtKnobSetBorderWidth}, + { "qwtKnobSetSymbol", _wrap_qwtKnobSetSymbol}, + { "qwtKnobSetValue", _wrap_qwtKnobSetValue}, + { "qwtCounterSetStep", _wrap_qwtCounterSetStep}, + { "qwtCounterSetMinValue", _wrap_qwtCounterSetMinValue}, + { "qwtCounterSetMaxValue", _wrap_qwtCounterSetMaxValue}, + { "qwtCounterSetStepButton1", _wrap_qwtCounterSetStepButton1}, + { "qwtCounterSetStepButton2", _wrap_qwtCounterSetStepButton2}, + { "qwtCounterSetStepButton3", _wrap_qwtCounterSetStepButton3}, + { "qwtCounterSetNumButtons", _wrap_qwtCounterSetNumButtons}, + { "qwtCounterSetIncSteps", _wrap_qwtCounterSetIncSteps}, + { "qwtCounterSetValue", _wrap_qwtCounterSetValue}, + { "qwtWheelSetMass", _wrap_qwtWheelSetMass}, + { "qwtWheelSetOrientation", _wrap_qwtWheelSetOrientation}, + { "qwtWheelSetReadOnly", _wrap_qwtWheelSetReadOnly}, + { "qwtWheelSetTotalAngle", _wrap_qwtWheelSetTotalAngle}, + { "qwtWheelSetTickCnt", _wrap_qwtWheelSetTickCnt}, + { "qwtWheelSetViewAngle", _wrap_qwtWheelSetViewAngle}, + { "qwtWheelSetInternalBorder", _wrap_qwtWheelSetInternalBorder}, + { "qwtWheelSetWheelWidth", _wrap_qwtWheelSetWheelWidth}, + { "qwtWheelSetValue", _wrap_qwtWheelSetValue}, + { "qwtSliderSetScale", _wrap_qwtSliderSetScale}, + { "qwtSliderSetMass", _wrap_qwtSliderSetMass}, + { "qwtSliderSetOrientation", _wrap_qwtSliderSetOrientation}, + { "qwtSliderSetReadOnly", _wrap_qwtSliderSetReadOnly}, + { "qwtSliderSetBgStyle", _wrap_qwtSliderSetBgStyle}, + { "qwtSliderSetScalePos", _wrap_qwtSliderSetScalePos}, + { "qwtSliderSetThumbLength", _wrap_qwtSliderSetThumbLength}, + { "qwtSliderSetThumbWidth", _wrap_qwtSliderSetThumbWidth}, + { "qwtSliderSetBorderWidth", _wrap_qwtSliderSetBorderWidth}, + { "qwtSliderSetMargins", _wrap_qwtSliderSetMargins}, + { "qwtSliderSetValue", _wrap_qwtSliderSetValue}, + { "qwtCompassSetSimpleCompassRose", _wrap_qwtCompassSetSimpleCompassRose}, + { "qwtCompassSetRange", _wrap_qwtCompassSetRange}, + { "qwtCompassSetMass", _wrap_qwtCompassSetMass}, + { "qwtCompassSetReadOnly", _wrap_qwtCompassSetReadOnly}, + { "qwtCompassSetFrameShadow", _wrap_qwtCompassSetFrameShadow}, + { "qwtCompassShowBackground", _wrap_qwtCompassShowBackground}, + { "qwtCompassSetLineWidth", _wrap_qwtCompassSetLineWidth}, + { "qwtCompassSetMode", _wrap_qwtCompassSetMode}, + { "qwtCompassSetWrapping", _wrap_qwtCompassSetWrapping}, + { "qwtCompassSetScale", _wrap_qwtCompassSetScale}, + { "qwtCompassSetScaleArc", _wrap_qwtCompassSetScaleArc}, + { "qwtCompassSetOrigin", _wrap_qwtCompassSetOrigin}, + { "qwtCompassSetNeedle", _wrap_qwtCompassSetNeedle}, + { "qwtCompassSetValue", _wrap_qwtCompassSetValue}, + { "qwtDialSetRange", _wrap_qwtDialSetRange}, + { "qwtDialSetMass", _wrap_qwtDialSetMass}, + { "qwtDialSetReadOnly", _wrap_qwtDialSetReadOnly}, + { "qwtDialSetFrameShadow", _wrap_qwtDialSetFrameShadow}, + { "qwtDialShowBackground", _wrap_qwtDialShowBackground}, + { "qwtDialSetLineWidth", _wrap_qwtDialSetLineWidth}, + { "qwtDialSetMode", _wrap_qwtDialSetMode}, + { "qwtDialSetWrapping", _wrap_qwtDialSetWrapping}, + { "qwtDialSetScale", _wrap_qwtDialSetScale}, + { "qwtDialSetScaleArc", _wrap_qwtDialSetScaleArc}, + { "qwtDialSetOrigin", _wrap_qwtDialSetOrigin}, + { "qwtDialSetNeedle", _wrap_qwtDialSetNeedle}, + { "qwtDialSetValue", _wrap_qwtDialSetValue}, + { "qwtAnalogClockSetTime", _wrap_qwtAnalogClockSetTime}, + { "qwtAnalogClockSetMass", _wrap_qwtAnalogClockSetMass}, + { "qwtAnalogClockSetReadOnly", _wrap_qwtAnalogClockSetReadOnly}, + { "qwtAnalogClockSetFrameShadow", _wrap_qwtAnalogClockSetFrameShadow}, + { "qwtAnalogClockShowBackground", _wrap_qwtAnalogClockShowBackground}, + { "qwtAnalogClockSetLineWidth", _wrap_qwtAnalogClockSetLineWidth}, + { "qwtAnalogClockSetMode", _wrap_qwtAnalogClockSetMode}, + { "qwtAnalogClockSetWrapping", _wrap_qwtAnalogClockSetWrapping}, + { "qwtAnalogClockSetScale", _wrap_qwtAnalogClockSetScale}, + { "qwtAnalogClockSetScaleArc", _wrap_qwtAnalogClockSetScaleArc}, + { "qwtAnalogClockSetOrigin", _wrap_qwtAnalogClockSetOrigin}, + { "qwtAnalogClockSetNeedle", _wrap_qwtAnalogClockSetNeedle}, + { "qwtAnalogClockSetValue", _wrap_qwtAnalogClockSetValue}, + { "unit", _wrap_unit}, + { "textEventType", _wrap_textEventType}, + { "svgObjectName", _wrap_svgObjectName}, + { "getSvgBoundsOnElement", _wrap_getSvgBoundsOnElement}, + { "getSvgMatrixForElement", _wrap_getSvgMatrixForElement}, + { "getGeometry", _wrap_getGeometry}, + { "getParentWidgetId", _wrap_getParentWidgetId}, + { "getParam", _wrap_getParam}, + { "pvQImageScript", _wrap_pvQImageScript}, + { "new_int", _wrap_new_int}, + { "get_int", _wrap_get_int}, + { "delete_int", _wrap_delete_int}, + {0,0} +}; +static swig_lua_class* swig_SwigModule_classes[]= { +&_wrap_class_PARSE_EVENT_STRUCT, +&_wrap_class_PARAM, +&_wrap_class_IntegerArray, +&_wrap_class_FloatArray, +&_wrap_class_pvTime, +&_wrap_class_pvAddressTableItem, +&_wrap_class_pvAddressTable, +&_wrap_class_glFont, +&_wrap_class_pvWidgetIdManager, +&_wrap_class_qtDatabase, + 0 +}; +static swig_lua_namespace* swig_SwigModule_namespaces[] = { + 0 +}; + +static swig_lua_namespace swig_SwigModule = { + "pv", + swig_SwigModule_methods, + swig_SwigModule_attributes, + swig_SwigModule_constants, + swig_SwigModule_classes, + swig_SwigModule_namespaces +}; +#ifdef __cplusplus +} +#endif /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ @@ -30110,7 +31362,7 @@ static swig_type_info _swigt__p_PARSE_EVENT_STRUCT = {"_p_PARSE_EVENT_STRUCT", " static swig_type_info _swigt__p_QSqlDatabase = {"_p_QSqlDatabase", "QSqlDatabase *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_QSqlError = {"_p_QSqlError", "QSqlError *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_QSqlQuery = {"_p_QSqlQuery", "QSqlQuery *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p__PARAM_ = {"_p__PARAM_", "PARAM *|_PARAM_ *", 0, 0, (void*)&_wrap_class__PARAM_, 0}; +static swig_type_info _swigt__p__PARAM_ = {"_p__PARAM_", "PARAM *|_PARAM_ *", 0, 0, (void*)&_wrap_class_PARAM, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_f_p__PARAM___int = {"_p_f_p__PARAM___int", "int (*)(PARAM *)|int (*)(_PARAM_ *)", 0, 0, (void*)0, 0}; @@ -30226,7 +31478,7 @@ static swig_cast_info *swig_cast_initial[] = { * array with the correct data and linking the correct swig_cast_info * structures together. * - * The generated swig_type_info structures are assigned staticly to an initial + * The generated swig_type_info structures are assigned statically to an initial * array. We just loop through that array, and handle each type individually. * First we lookup if this type has been already loaded, and if so, use the * loaded structure instead of the generated one. Then we have to fill in the @@ -30270,7 +31522,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found, init; + int init; /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { @@ -30289,22 +31541,18 @@ SWIG_InitializeModule(void *clientdata) { /* This is the first module loaded for this interpreter */ /* so set the swig module into the interpreter */ SWIG_SetModule(clientdata, &swig_module); - module_head = &swig_module; } else { /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - found=0; iter=module_head; do { if (iter==&swig_module) { - found=1; - break; + /* Our module is already in the list, so there's nothing more to do. */ + return; } iter=iter->next; } while (iter!= module_head); - /* if the is found in the list, then all is done and we may leave */ - if (found) return; - /* otherwise we must add out module into the list */ + /* otherwise we must add our module into the list */ swig_module.next = module_head->next; module_head->next = &swig_module; } @@ -30468,27 +31716,18 @@ SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ { #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */ int i; + int globalRegister = 0; /* start with global table */ lua_pushglobaltable (L); - /* SWIG's internal initalisation */ + /* SWIG's internal initialisation */ SWIG_InitializeModule((void*)L); SWIG_PropagateClientData(); #endif -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE) /* add a global fn */ SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); - SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal); - /* begin the module (its a table with the same name as the module) */ - SWIG_Lua_module_begin(L,SWIG_name); - /* add commands/functions */ - for (i = 0; swig_commands[i].name; i++){ - SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func); - } - /* add variables */ - for (i = 0; swig_variables[i].name; i++){ - SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set); - } + SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal); #endif #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) @@ -30498,17 +31737,34 @@ SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); } } - /* additional registration structs & classes in lua */ +#ifdef SWIG_LUA_MODULE_GLOBAL + globalRegister = 1; +#endif + + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + SWIG_Lua_namespace_register(L,&swig_SwigModule, globalRegister); +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) for (i = 0; swig_types[i]; i++){ if (swig_types[i]->clientdata){ - SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata)); + SWIG_Lua_elua_class_register_instance(L,(swig_lua_class*)(swig_types[i]->clientdata)); } } #endif -#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) - /* constants */ - SWIG_Lua_InstallConstants(L,swig_constants); +#if defined(SWIG_LUA_ELUA_EMULATE) + lua_newtable(L); + SWIG_Lua_elua_emulate_register(L,swig_SwigModule.ns_methods); + SWIG_Lua_elua_emulate_register_clear(L); + if(globalRegister) { + lua_pushstring(L,swig_SwigModule.name); + lua_pushvalue(L,-2); + lua_rawset(L,-4); + } +#endif + #endif #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) diff --git a/language_bindings/lua/pvapplua/main.cpp b/language_bindings/lua/pvapplua/main.cpp index 1fd1c760..2e1872d9 100755 --- a/language_bindings/lua/pvapplua/main.cpp +++ b/language_bindings/lua/pvapplua/main.cpp @@ -12,12 +12,6 @@ int trace = 0; -const char *rltranslate(char const *txt, char const **def) // dummy -{ - if(def == NULL) return txt; - return txt; -} - // Include the Lua API header files #ifdef __cplusplus extern "C" { diff --git a/language_bindings/lua/pvslua/main.cpp b/language_bindings/lua/pvslua/main.cpp index 46baa623..09a84874 100755 --- a/language_bindings/lua/pvslua/main.cpp +++ b/language_bindings/lua/pvslua/main.cpp @@ -8,12 +8,6 @@ #include "pvapp.h" #include -const char *rltranslate(char const *txt, char const **def) // dummy -{ - if(def == NULL) return txt; - return txt; -} - // Include the Lua API header files #ifdef __cplusplus extern "C" { diff --git a/rllib/lib/rlinifile.h b/rllib/lib/rlinifile.h index ad66e55d..eea9f156 100644 --- a/rllib/lib/rlinifile.h +++ b/rllib/lib/rlinifile.h @@ -113,7 +113,7 @@ class rlIniFile int rlSetTranslator(const char *language, const char *inifile=NULL); #ifndef SWIGPYTHON -const char *rltranslate(const char *txt, const char **mytext=NULL); +const char *rltranslate(const char *txt, char **mytext=NULL); const char *rltranslate2(const char *section, const char *txt, char **mytext=NULL); #define rltr(txt) rltranslate(txt) From eb98b71f11a6c0e3979142c7be1da642be6e2181 Mon Sep 17 00:00:00 2001 From: Johannes Lode Date: Tue, 12 Feb 2019 12:37:10 +0100 Subject: [PATCH 6/7] Add Eclipse project files. --- .gitignore | 2 ++ .settings/.gitignore | 1 + 2 files changed, 3 insertions(+) create mode 100644 .settings/.gitignore diff --git a/.gitignore b/.gitignore index 8015f2f3..a50aa174 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,5 @@ win-mingw/bin/fake_qmake.exe win-mingw/bin/rlsvgcat.exe language_bindings/lua/pvslua/pvslua language_bindings/lua/pvslua/pvapplua +/.cproject +/.project diff --git a/.settings/.gitignore b/.settings/.gitignore new file mode 100644 index 00000000..d81d4c41 --- /dev/null +++ b/.settings/.gitignore @@ -0,0 +1 @@ +/language.settings.xml From 3e03acc9773ba17d00532928b2bdb2ab160e2036 Mon Sep 17 00:00:00 2001 From: Johannes Lode Date: Tue, 12 Feb 2019 12:58:32 +0100 Subject: [PATCH 7/7] Reduced data loss on frequent logger restarts. By inspecting the logging files on logger start the data loss from deleted ring buffer files is reduced. This is achieved by avoiding the deletion of the oldest of the ring buffer files in case the youngest file is still in time window for further logging events. This way occurred a problem in Windows, where read and write pointer are not independent. So the inspection of the files and writing to the files is done from different file descriptors, opend for the special purpose. By the way reduced this problems with data logging, reopening the log files etc. after a server crash and restart. --- rllib/lib/rlhistorylogger.cpp | 57 +++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/rllib/lib/rlhistorylogger.cpp b/rllib/lib/rlhistorylogger.cpp index 1ca50fa8..1a34b3a7 100644 --- a/rllib/lib/rlhistorylogger.cpp +++ b/rllib/lib/rlhistorylogger.cpp @@ -17,6 +17,8 @@ #include "rlcutil.h" #include +#define MAXBUF 256*256 + rlHistoryLogger::rlHistoryLogger(const char *csvName, int maxHoursPerFile, int maxLinesInMemory) { int val; @@ -145,20 +147,63 @@ int rlHistoryLogger::openFile() { // find oldest file and open it for writing int i_oldest = 0; - rlTime t,t_oldest; + int i_youngest = 0; + int file_count = 0; + rlTime t, t_oldest, t_youngest; t_oldest.getLocalTime(); // this must be newer that any file time for(int i=0; i<10; i++) { sprintf(csv_file_name,"%s%d.csv",csv_name,i); if(t.getFileModificationTime(csv_file_name) == 0) { - if(t < t_oldest) i_oldest = i; + if(t < t_oldest) + { + i_oldest = i; + t_oldest = t; + } + if (t > t_youngest) + { + i_youngest = i; + t_youngest = t; + } + ++file_count; + } + else // create missing file + { + FILE* f = fopen(csv_file_name, "w"); + if (f) + fclose(f); } } - current_file = i_oldest; - sprintf(csv_file_name,"%s%d.csv",csv_name,i_oldest); - fout = fopen(csv_file_name,"w"); - file_start_time.getLocalTime(); + + if ((t_youngest + time_diff) > time) // file is in our time slot, append; this reduces data loss in case of frequent restarts + { + current_file = i_youngest; + sprintf(csv_file_name, "%s%d.csv", csv_name, current_file); + + // "a+" does not work reliable, + // under Windows is the order of creation of read- and write-pointer unpredictable, + // they are not independent and the file IO layer has problems after + // system crashes or UID changes, + // this leads to unexplored problems, which prevent successful data write operations + fout = fopen(csv_file_name, "r"); + auto buf = new char[MAXBUF]; + if (fgets(buf, MAXBUF-1, fout) != NULL) + file_start_time.setTimeFromString(buf); + else + file_start_time = t_youngest; + delete[] buf; + fclose(fout); + fout = fopen(csv_file_name, "a"); + } + else + { + // oldest file is old enough for truncation + current_file = i_oldest; + sprintf(csv_file_name, "%s%d.csv", csv_name, current_file); + fout = fopen(csv_file_name,"w"); + file_start_time.getLocalTime(); + } } else {