diff --git a/hphp/runtime/base/file/file.cpp b/hphp/runtime/base/file/file.cpp index f79f53b67..e0736f0a1 100644 --- a/hphp/runtime/base/file/file.cpp +++ b/hphp/runtime/base/file/file.cpp @@ -126,7 +126,7 @@ Variant File::Open(CStrRef filename, CStrRef mode, if (file != nullptr) { file->m_name = filename.data(); file->m_mode = mode.data(); - return Object(file); + return Resource(file); } return false; } diff --git a/hphp/runtime/base/file/http_stream_wrapper.cpp b/hphp/runtime/base/file/http_stream_wrapper.cpp index e18ffa34d..242eb5f95 100644 --- a/hphp/runtime/base/file/http_stream_wrapper.cpp +++ b/hphp/runtime/base/file/http_stream_wrapper.cpp @@ -45,8 +45,8 @@ File* HttpStreamWrapper::open(CStrRef filename, CStrRef mode, } std::unique_ptr file; - StreamContext *ctx = !context.isObject() ? nullptr : - context.toObject().getTyped(); + StreamContext *ctx = !context.isResource() ? nullptr : + context.toResource().getTyped(); if (!ctx || ctx->m_options.isNull() || ctx->m_options[s_http].isNull()) { file = std::unique_ptr(NEWOBJ(UrlFile)()); } else { diff --git a/hphp/runtime/base/file/ssl_socket.cpp b/hphp/runtime/base/file/ssl_socket.cpp index 9916c3bd2..52fa00835 100644 --- a/hphp/runtime/base/file/ssl_socket.cpp +++ b/hphp/runtime/base/file/ssl_socket.cpp @@ -608,7 +608,7 @@ bool SSLSocket::enableCrypto(bool activate /* = true */) { /* allow the script to capture the peer cert * and/or the certificate chain */ if (m_context[s_capture_peer_cert].toBoolean()) { - Object cert(new Certificate(peer_cert)); + Resource cert(new Certificate(peer_cert)); m_context.set(s_peer_certificate, cert); peer_cert = nullptr; } @@ -619,7 +619,7 @@ bool SSLSocket::enableCrypto(bool activate /* = true */) { if (chain) { for (int i = 0; i < sk_X509_num(chain); i++) { X509 *mycert = X509_dup(sk_X509_value(chain, i)); - arr.append(Object(new Certificate(mycert))); + arr.append(Resource(new Certificate(mycert))); } } m_context.set(s_peer_certificate_chain, arr); @@ -705,14 +705,14 @@ BIO *Certificate::ReadData(CVarRef var, bool *file /* = NULL */) { } -Object Certificate::Get(CVarRef var) { +Resource Certificate::Get(CVarRef var) { if (var.isResource()) { - return var.toObject(); + return var.toResource(); } if (var.isString() || var.isObject()) { bool file; BIO *in = ReadData(var, &file); - if (in == nullptr) return Object(); + if (in == nullptr) return Resource(); X509 *cert; /* @@ -726,10 +726,10 @@ Object Certificate::Get(CVarRef var) { cert = PEM_read_bio_X509(in, nullptr, nullptr, nullptr); BIO_free(in); if (cert) { - return Object(new Certificate(cert)); + return Resource(new Certificate(cert)); } } - return Object(); + return Resource(); } /////////////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/base/file/ssl_socket.h b/hphp/runtime/base/file/ssl_socket.h index 447463c16..8a09bb874 100644 --- a/hphp/runtime/base/file/ssl_socket.h +++ b/hphp/runtime/base/file/ssl_socket.h @@ -114,7 +114,7 @@ public: * to that cert * . it will be interpreted as the cert data */ - static Object Get(CVarRef var); + static Resource Get(CVarRef var); static BIO *ReadData(CVarRef var, bool *file = nullptr); }; diff --git a/hphp/runtime/base/resource_data.h b/hphp/runtime/base/resource_data.h index ba4459193..9bc486b65 100644 --- a/hphp/runtime/base/resource_data.h +++ b/hphp/runtime/base/resource_data.h @@ -24,8 +24,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// /** - * Base class of all resources used by extensions for opaquely passing object - * pointers. + * Base class of all PHP resources. */ class ResourceData : public ObjectData { public: diff --git a/hphp/runtime/base/server/pagelet_server.cpp b/hphp/runtime/base/server/pagelet_server.cpp index d85efa5e4..2a79ae221 100644 --- a/hphp/runtime/base/server/pagelet_server.cpp +++ b/hphp/runtime/base/server/pagelet_server.cpp @@ -315,24 +315,24 @@ void PageletServer::Stop() { } } -Object PageletServer::TaskStart(CStrRef url, CArrRef headers, - CStrRef remote_host, - CStrRef post_data /* = null_string */, - CArrRef files /* = null_array */) { +Resource PageletServer::TaskStart(CStrRef url, CArrRef headers, + CStrRef remote_host, + CStrRef post_data /* = null_string */, + CArrRef files /* = null_array */) { { Lock l(s_dispatchMutex); if (!s_dispatcher) { - return null_object; + return null_resource; } if (RuntimeOption::PageletServerQueueLimit > 0 && s_dispatcher->getQueuedJobs() > RuntimeOption::PageletServerQueueLimit) { - return null_object; + return null_resource; } } PageletTask *task = NEWOBJ(PageletTask)(url, headers, remote_host, post_data, get_uploaded_files(), files); - Object ret(task); + Resource ret(task); PageletTransport *job = task->getJob(); Lock l(s_dispatchMutex); if (s_dispatcher) { @@ -340,10 +340,10 @@ Object PageletServer::TaskStart(CStrRef url, CArrRef headers, s_dispatcher->enqueue(job); return ret; } - return null_object; + return null_resource; } -int64_t PageletServer::TaskStatus(CObjRef task) { +int64_t PageletServer::TaskStatus(CResRef task) { PageletTask *ptask = task.getTyped(); PageletTransport *job = ptask->getJob(); if (!job->isPipelineEmpty()) { @@ -355,7 +355,7 @@ int64_t PageletServer::TaskStatus(CObjRef task) { return PAGELET_NOT_READY; } -String PageletServer::TaskResult(CObjRef task, Array &headers, int &code, +String PageletServer::TaskResult(CResRef task, Array &headers, int &code, int64_t timeout_ms) { PageletTask *ptask = task.getTyped(); return ptask->getJob()->getResults(headers, code, timeout_ms); diff --git a/hphp/runtime/base/server/pagelet_server.h b/hphp/runtime/base/server/pagelet_server.h index 92ecae011..721766bdb 100644 --- a/hphp/runtime/base/server/pagelet_server.h +++ b/hphp/runtime/base/server/pagelet_server.h @@ -32,22 +32,22 @@ public: * Create a task. This returns a task handle, or null object * if there are no worker threads. */ - static Object TaskStart(CStrRef url, CArrRef headers, - CStrRef remote_host, - CStrRef post_data = null_string, - CArrRef files = null_array); + static Resource TaskStart(CStrRef url, CArrRef headers, + CStrRef remote_host, + CStrRef post_data = null_string, + CArrRef files = null_array); /** * Query if a task is finished. This is non-blocking and can be called as * many times as desired. */ - static int64_t TaskStatus(CObjRef task); + static int64_t TaskStatus(CResRef task); /** * Get results of a task. This is blocking until task is finished or times * out. The status code is set to -1 in the event of a timeout. */ - static String TaskResult(CObjRef task, + static String TaskResult(CResRef task, Array &headers, int &code, int64_t timeout_ms); diff --git a/hphp/runtime/base/server/xbox_server.cpp b/hphp/runtime/base/server/xbox_server.cpp index 8aeaf3b4f..f6bae7743 100644 --- a/hphp/runtime/base/server/xbox_server.cpp +++ b/hphp/runtime/base/server/xbox_server.cpp @@ -392,7 +392,7 @@ StaticString XboxTask::s_class_name("XboxTask"); /////////////////////////////////////////////////////////////////////////////// -Object XboxServer::TaskStart(CStrRef msg, CStrRef reqInitDoc /* = "" */) { +Resource XboxServer::TaskStart(CStrRef msg, CStrRef reqInitDoc /* = "" */) { { Lock l(s_dispatchMutex); if (s_dispatcher && @@ -401,7 +401,7 @@ Object XboxServer::TaskStart(CStrRef msg, CStrRef reqInitDoc /* = "" */) { s_dispatcher->getQueuedJobs() < RuntimeOption::XboxServerMaxQueueLength)) { XboxTask *task = NEWOBJ(XboxTask)(msg, reqInitDoc); - Object ret(task); + Resource ret(task); XboxTransport *job = task->getJob(); job->incRefCount(); // paired with worker's decRefCount() Transport *transport = g_context->getTransport(); @@ -422,15 +422,15 @@ Object XboxServer::TaskStart(CStrRef msg, CStrRef reqInitDoc /* = "" */) { Object e = SystemLib::AllocExceptionObject(errMsg); throw_exception(e); - return Object(); + return Resource(); } -bool XboxServer::TaskStatus(CObjRef task) { +bool XboxServer::TaskStatus(CResRef task) { XboxTask *ptask = task.getTyped(); return ptask->getJob()->isDone(); } -int XboxServer::TaskResult(CObjRef task, int timeout_ms, Variant &ret) { +int XboxServer::TaskResult(CResRef task, int timeout_ms, Variant &ret) { XboxTask *ptask = task.getTyped(); int code = 0; diff --git a/hphp/runtime/base/server/xbox_server.h b/hphp/runtime/base/server/xbox_server.h index 395e24b73..72733211f 100644 --- a/hphp/runtime/base/server/xbox_server.h +++ b/hphp/runtime/base/server/xbox_server.h @@ -47,9 +47,9 @@ public: /** * Local tasklet for parallel processing. */ - static Object TaskStart(CStrRef msg, CStrRef reqInitDoc = ""); - static bool TaskStatus(CObjRef task); - static int TaskResult(CObjRef task, int timeout_ms, Variant &ret); + static Resource TaskStart(CStrRef msg, CStrRef reqInitDoc = ""); + static bool TaskStatus(CResRef task); + static int TaskResult(CResRef task, int timeout_ms, Variant &ret); /** * Gets the ServerInfo and RequestHandler for the current xbox worker thread. diff --git a/hphp/runtime/base/time/dateinterval.cpp b/hphp/runtime/base/time/dateinterval.cpp index 1262786a2..1878df341 100644 --- a/hphp/runtime/base/time/dateinterval.cpp +++ b/hphp/runtime/base/time/dateinterval.cpp @@ -162,7 +162,7 @@ String DateInterval::format(CStrRef format_spec) { return s.detach(); } -SmartObject DateInterval::cloneDateInterval() const { +SmartResource DateInterval::cloneDateInterval() const { if (!m_di) return NEWOBJ(DateInterval)(); return NEWOBJ(DateInterval)(timelib_rel_time_clone(m_di.get())); } diff --git a/hphp/runtime/base/time/dateinterval.h b/hphp/runtime/base/time/dateinterval.h index 20ee9be58..a6809bc43 100644 --- a/hphp/runtime/base/time/dateinterval.h +++ b/hphp/runtime/base/time/dateinterval.h @@ -70,8 +70,8 @@ public: CStrRef o_getClassNameHook() const { return s_class_name; } DateInterval(); - DateInterval(CStrRef date_interval, bool date_string = false); - DateInterval(timelib_rel_time *di); + explicit DateInterval(CStrRef date_interval, bool date_string = false); + explicit DateInterval(timelib_rel_time *di); int64_t getYears() const { return m_di->y; } int64_t getMonths() const { return m_di->m; } @@ -101,7 +101,7 @@ public: String format(CStrRef format_spec); bool isValid() const { return get(); } - SmartObject cloneDateInterval() const; + SmartResource cloneDateInterval() const; protected: friend class DateTime; diff --git a/hphp/runtime/base/time/datetime.cpp b/hphp/runtime/base/time/datetime.cpp index d5848da44..8853275b6 100644 --- a/hphp/runtime/base/time/datetime.cpp +++ b/hphp/runtime/base/time/datetime.cpp @@ -101,7 +101,7 @@ bool DateTime::IsValid(int y, int m, int d) { d <= timelib_days_in_month(y, m); } -SmartObject DateTime::Current(bool utc /* = false */) { +SmartResource DateTime::Current(bool utc /* = false */) { return NEWOBJ(DateTime)(time(0), utc); } @@ -411,7 +411,7 @@ void DateTime::setTime(int hour, int minute, int second) { update(); } -void DateTime::setTimezone(SmartObject timezone) { +void DateTime::setTimezone(SmartResource timezone) { if (!timezone.isNull()) { m_tz = timezone->cloneTimeZone(); if (m_tz.get() && m_tz->get()) { @@ -447,12 +447,12 @@ void DateTime::internalModify(timelib_rel_time *rel, timelib_update_from_sse(m_time.get()); } -void DateTime::add(const SmartObject &interval) { +void DateTime::add(const SmartResource &interval) { timelib_rel_time *rel = interval->get(); internalModify(rel, true, TIMELIB_REL_INVERT(rel) ? -1 : 1); } -void DateTime::sub(const SmartObject &interval) { +void DateTime::sub(const SmartResource &interval) { timelib_rel_time *rel = interval->get(); internalModify(rel, true, TIMELIB_REL_INVERT(rel) ? 1 : -1); } @@ -734,7 +734,7 @@ Array DateTime::toArray(ArrayFormat format) const { return ret; } -bool DateTime::fromString(CStrRef input, SmartObject tz, +bool DateTime::fromString(CStrRef input, SmartResource tz, const char* format /*=NUL*/) { struct timelib_error_container *error; timelib_time *t; @@ -782,9 +782,9 @@ bool DateTime::fromString(CStrRef input, SmartObject tz, return true; } -SmartObject DateTime::cloneDateTime() const { +SmartResource DateTime::cloneDateTime() const { bool err; - SmartObject ret(NEWOBJ(DateTime)(toTimeStamp(err), true)); + SmartResource ret(NEWOBJ(DateTime)(toTimeStamp(err), true)); ret->setTimezone(m_tz); return ret; } @@ -792,13 +792,14 @@ SmartObject DateTime::cloneDateTime() const { /////////////////////////////////////////////////////////////////////////////// // comparison -SmartObject DateTime::diff(SmartObject datetime2, bool absolute) { +SmartResource +DateTime::diff(SmartResource datetime2, bool absolute) { #ifdef TIMELIB_HAVE_INTERVAL timelib_rel_time *rel = timelib_diff(m_time.get(), datetime2.get()->m_time.get()); if (absolute) { TIMELIB_REL_INVERT_SET(rel, 0); } - SmartObject di(NEWOBJ(DateInterval)(rel)); + SmartResource di(NEWOBJ(DateInterval)(rel)); return di; #else throw NotImplementedException("timelib version too old"); diff --git a/hphp/runtime/base/time/datetime.h b/hphp/runtime/base/time/datetime.h index 95d4e4734..8cd7c5444 100644 --- a/hphp/runtime/base/time/datetime.h +++ b/hphp/runtime/base/time/datetime.h @@ -211,7 +211,7 @@ public: /** * What time is it? */ - static SmartObject Current(bool utc = false); + static SmartResource Current(bool utc = false); /** * Returns are really in special PHP formats, and please read datetime.cpp @@ -247,7 +247,7 @@ public: int isoYear() const; int isoDow() const; int offset() const; // timezone offset from UTC - SmartObject timezone() const { return m_tz->cloneTimeZone();} + SmartResource timezone() const { return m_tz->cloneTimeZone();} const char *weekdayName() const; const char *shortWeekdayName() const; @@ -259,10 +259,10 @@ public: void setDate(int year, int month, int day); void setISODate(int year, int week, int day = 1); void setTime(int hour, int minute, int second = 0); - void setTimezone(SmartObject tz); + void setTimezone(SmartResource tz); void modify(CStrRef diff); // PHP's date_modify() function, very powerful - void add(const SmartObject &interval); - void sub(const SmartObject &interval); + void add(const SmartResource &interval); + void sub(const SmartResource &interval); void internalModify(timelib_rel_time *rel, bool have_relative, char bias); // conversions @@ -273,13 +273,15 @@ public: String toString(DateFormat format) const; Array toArray(ArrayFormat format) const; void fromTimeStamp(int64_t timestamp, bool utc = false); - bool fromString(CStrRef input, SmartObject tz, const char* format=nullptr); + bool fromString(CStrRef input, SmartResource tz, + const char* format=nullptr); // comparison - SmartObject diff(SmartObject datetime2, bool absolute = false); + SmartResource diff(SmartResource datetime2, + bool absolute = false); // cloning - SmartObject cloneDateTime() const; + SmartResource cloneDateTime() const; // sun info Array getSunInfo(double latitude, double longitude) const; @@ -343,7 +345,7 @@ private: typedef boost::shared_ptr TimePtr; TimePtr m_time; - SmartObject m_tz; + SmartResource m_tz; mutable int64_t m_timestamp; mutable bool m_timestampSet; diff --git a/hphp/runtime/base/time/timestamp.cpp b/hphp/runtime/base/time/timestamp.cpp index 403bf77e0..086a9e522 100644 --- a/hphp/runtime/base/time/timestamp.cpp +++ b/hphp/runtime/base/time/timestamp.cpp @@ -69,7 +69,7 @@ int64_t TimeStamp::Get(bool &error, int hou, int min, int sec, int mon, int day, int yea, bool gmt) { DateTime dt(Current()); if (gmt) { - dt.setTimezone(SmartObject(NEWOBJ(TimeZone)("UTC"))); + dt.setTimezone(SmartResource(NEWOBJ(TimeZone)("UTC"))); } dt.set(hou, min, sec, mon, day, yea); return dt.toTimeStamp(error); diff --git a/hphp/runtime/base/time/timezone.cpp b/hphp/runtime/base/time/timezone.cpp index 5f926972c..09b83cd1a 100644 --- a/hphp/runtime/base/time/timezone.cpp +++ b/hphp/runtime/base/time/timezone.cpp @@ -136,7 +136,7 @@ String TimeZone::CurrentName() { return String(s_guessed_timezone.m_tzid); } -SmartObject TimeZone::Current() { +SmartResource TimeZone::Current() { return NEWOBJ(TimeZone)(CurrentName()); } @@ -213,7 +213,7 @@ TimeZone::TimeZone(timelib_tzinfo *tzi) { m_tzi = TimeZoneInfo(tzi, tzinfo_deleter()); } -SmartObject TimeZone::cloneTimeZone() const { +SmartResource TimeZone::cloneTimeZone() const { if (!m_tzi) return NEWOBJ(TimeZone)(); return NEWOBJ(TimeZone)(timelib_tzinfo_clone(m_tzi.get())); } diff --git a/hphp/runtime/base/time/timezone.h b/hphp/runtime/base/time/timezone.h index bc5764e60..54f1eec7f 100644 --- a/hphp/runtime/base/time/timezone.h +++ b/hphp/runtime/base/time/timezone.h @@ -43,7 +43,7 @@ public: * Get/set current timezone that controls how local time is interpreted. */ static String CurrentName(); // current timezone's name - static SmartObject Current(); // current timezone + static SmartResource Current(); // current timezone static bool SetCurrent(CStrRef name); // returns false if invalid /** @@ -109,7 +109,7 @@ public: /** * Make a copy of this timezone object, so it can be changed independently. */ - SmartObject cloneTimeZone() const; + SmartResource cloneTimeZone() const; protected: friend class DateTime; diff --git a/hphp/runtime/base/tv_helpers.cpp b/hphp/runtime/base/tv_helpers.cpp index 00c610140..2debe5b4f 100644 --- a/hphp/runtime/base/tv_helpers.cpp +++ b/hphp/runtime/base/tv_helpers.cpp @@ -429,6 +429,5 @@ bool tvCoerceParamToObjectInPlace(TypedValue* tv) { return tv->m_type == KindOfObject; } - /////////////////////////////////////////////////////////////////////////////// } diff --git a/hphp/runtime/base/type_object.cpp b/hphp/runtime/base/type_object.cpp index 5e05541c8..03ac177a1 100644 --- a/hphp/runtime/base/type_object.cpp +++ b/hphp/runtime/base/type_object.cpp @@ -154,4 +154,5 @@ void Object::setToDefaultObject() { } /////////////////////////////////////////////////////////////////////////////// + } diff --git a/hphp/runtime/base/type_object.h b/hphp/runtime/base/type_object.h index c57def1bd..855642996 100644 --- a/hphp/runtime/base/type_object.h +++ b/hphp/runtime/base/type_object.h @@ -219,6 +219,9 @@ private: } }; +typedef Object Resource; +#define null_resource Object::s_nullObject + /////////////////////////////////////////////////////////////////////////////// } diff --git a/hphp/runtime/base/type_variant.h b/hphp/runtime/base/type_variant.h index 7678147e3..714d3dd60 100644 --- a/hphp/runtime/base/type_variant.h +++ b/hphp/runtime/base/type_variant.h @@ -413,6 +413,11 @@ class Variant : private TypedValue { return *reinterpret_cast(&m_data.pobj); } + inline ALWAYS_INLINE Resource & asResRef() { + assert(m_type == KindOfObject && m_data.pobj); + return *reinterpret_cast(&m_data.pobj); + } + inline ALWAYS_INLINE Object& toObjRef() { assert(is(KindOfObject)); assert(m_type == KindOfRef ? m_data.pref->var()->m_data.pobj : m_data.pobj); @@ -660,6 +665,10 @@ class Variant : private TypedValue { if (m_type == KindOfObject) return m_data.pobj; return toObjectHelper(); } + Resource toResource () const { + if (m_type == KindOfObject) return m_data.pobj; + return toObjectHelper(); + } /** * Whether or not calling toKey() will throw a bad type exception */ @@ -1202,6 +1211,7 @@ public: StringData *getStringData() const { return m_var.getStringData(); } Array toArray() const { return m_var.toArray(); } Object toObject() const { return m_var.toObject(); } + Resource toResource() const { return m_var.toResource(); } ObjectData *getObjectData() const { return m_var.getObjectData(); } CVarRef append(CVarRef v) const { return m_var.append(v); } diff --git a/hphp/runtime/base/types.h b/hphp/runtime/base/types.h index 0851b5602..b78dd8af1 100644 --- a/hphp/runtime/base/types.h +++ b/hphp/runtime/base/types.h @@ -48,6 +48,7 @@ class StaticString; class Array; class Object; template class SmartObject; +#define SmartResource SmartObject class Variant; class VarNR; class RefData; @@ -151,6 +152,7 @@ typedef const char * litstr; /* literal string */ typedef const String & CStrRef; typedef const Array & CArrRef; typedef const Object & CObjRef; +typedef const Object & CResRef; typedef const Variant & CVarRef; typedef const class VRefParamValue &VRefParam; diff --git a/hphp/runtime/debugger/cmd/cmd_print.cpp b/hphp/runtime/debugger/cmd/cmd_print.cpp index 52560c3e2..4ad8413bc 100644 --- a/hphp/runtime/debugger/cmd/cmd_print.cpp +++ b/hphp/runtime/debugger/cmd/cmd_print.cpp @@ -110,7 +110,7 @@ std::string CmdPrint::FormatResult(const char *format, CVarRef ret) { if (strcmp(format, "time") == 0) { DateTime dt; int64_t ts = -1; - if (dt.fromString(ret.toString(), SmartObject())) { + if (dt.fromString(ret.toString(), SmartResource())) { bool err; ts = dt.toTimeStamp(err); } diff --git a/hphp/runtime/debugger/debugger_client.cpp b/hphp/runtime/debugger/debugger_client.cpp index 27a4611c7..75ede9b52 100644 --- a/hphp/runtime/debugger/debugger_client.cpp +++ b/hphp/runtime/debugger/debugger_client.cpp @@ -530,7 +530,7 @@ bool DebuggerClient::connectRemote(const std::string &host, int port) { // API mode, and in client mode we expect to destruct it ourselves // when ~DebuggerClient runs. sock->unregister(); - Object obj(sock); // Destroy sock if we don't connect. + Resource obj(sock); // Destroy sock if we don't connect. if (f_socket_connect(sock, String(host), port)) { DMachineInfoPtr machine(new DMachineInfo()); machine->m_name = host; @@ -555,7 +555,7 @@ bool DebuggerClient::reconnect() { Socket *sock = new Socket(socket(PF_INET, SOCK_STREAM, 0), PF_INET, host.c_str(), port); sock->unregister(); - Object obj(sock); // Destroy sock if we don't connect. + Resource obj(sock); // Destroy sock if we don't connect. if (f_socket_connect(sock, String(host), port)) { for (unsigned int i = 0; i < m_machines.size(); i++) { if (m_machines[i] == m_machine) { diff --git a/hphp/runtime/ext/ext_apc.cpp b/hphp/runtime/ext/ext_apc.cpp index fd1a62de2..13475ddc5 100644 --- a/hphp/runtime/ext/ext_apc.cpp +++ b/hphp/runtime/ext/ext_apc.cpp @@ -261,10 +261,10 @@ bool f_apc_bin_load(CStrRef data, int64_t flags /* = 0 */, int64_t cache_id /* = } Variant f_apc_bin_dumpfile(int64_t cache_id, CVarRef filter, CStrRef filename, int64_t flags /* = 0 */, - CObjRef context /* = uninit_null() */) { + CResRef context /* = uninit_null() */) { throw NotSupportedException(__func__, "feature not supported"); } -bool f_apc_bin_loadfile(CStrRef filename, CObjRef context /* = uninit_null() */, +bool f_apc_bin_loadfile(CStrRef filename, CResRef context /* = uninit_null() */, int64_t flags /* = 0 */, int64_t cache_id /* = 0 */) { throw NotSupportedException(__func__, "feature not supported"); } diff --git a/hphp/runtime/ext/ext_apc.h b/hphp/runtime/ext/ext_apc.h index 668678a81..40c29ea22 100644 --- a/hphp/runtime/ext/ext_apc.h +++ b/hphp/runtime/ext/ext_apc.h @@ -52,9 +52,9 @@ Variant f_apc_bin_dump(int64_t cache_id = 0, CVarRef filter = null_variant); bool f_apc_bin_load(CStrRef data, int64_t flags = 0, int64_t cache_id = 0); Variant f_apc_bin_dumpfile(int64_t cache_id, CVarRef filter, CStrRef filename, int64_t flags = 0, - CObjRef context = Object()); + CResRef context = Resource()); bool f_apc_bin_loadfile(CStrRef filename, - CObjRef context = Object(), + CResRef context = Resource(), int64_t flags = 0, int64_t cache_id = 0); /////////////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/ext/ext_bzip2.cpp b/hphp/runtime/ext/ext_bzip2.cpp index 9597e05f4..06d26f53b 100644 --- a/hphp/runtime/ext/ext_bzip2.cpp +++ b/hphp/runtime/ext/ext_bzip2.cpp @@ -22,15 +22,15 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// -Variant f_bzclose(CObjRef bz) { +Variant f_bzclose(CResRef bz) { return f_fclose(bz); } -Variant f_bzread(CObjRef bz, int length /* = 1024 */) { +Variant f_bzread(CResRef bz, int length /* = 1024 */) { return f_fread(bz, length); } -Variant f_bzwrite(CObjRef bz, CStrRef data, int length /* = 0 */) { +Variant f_bzwrite(CResRef bz, CStrRef data, int length /* = 0 */) { return f_fwrite(bz, data, length); } @@ -61,7 +61,7 @@ Variant f_bzopen(CVarRef filename, CStrRef mode) { raise_warning("first parameter has to be string or file-resource"); return false; } - PlainFile* f = filename.cast(); + PlainFile* f = filename.toResource().getTyped(); if (!f) { return false; } @@ -91,26 +91,26 @@ Variant f_bzopen(CVarRef filename, CStrRef mode) { bz = NEWOBJ(BZ2File)(f); } - Object handle(bz); + Resource handle(bz); return handle; } -Variant f_bzflush(CObjRef bz) { +Variant f_bzflush(CResRef bz) { BZ2File *f = bz.getTyped(); return f->flush(); } -String f_bzerrstr(CObjRef bz) { +String f_bzerrstr(CResRef bz) { BZ2File *f = bz.getTyped(); return f->errstr(); } -Variant f_bzerror(CObjRef bz) { +Variant f_bzerror(CResRef bz) { BZ2File *f = bz.getTyped(); return f->error(); } -int64_t f_bzerrno(CObjRef bz) { +int64_t f_bzerrno(CResRef bz) { BZ2File *f = bz.getTyped(); return f->errnu(); } diff --git a/hphp/runtime/ext/ext_curl.cpp b/hphp/runtime/ext/ext_curl.cpp index 28493e481..3d2c4dee3 100644 --- a/hphp/runtime/ext/ext_curl.cpp +++ b/hphp/runtime/ext/ext_curl.cpp @@ -55,7 +55,7 @@ private: int method; Variant callback; - SmartObject fp; + SmartResource fp; StringBuffer buf; String content; int type; @@ -67,7 +67,7 @@ private: int method; Variant callback; - SmartObject fp; + SmartResource fp; }; DECLARE_BOOST_TYPES(ToFree); @@ -409,11 +409,11 @@ public: case CURLOPT_WRITEHEADER: case CURLOPT_STDERR: { - if (!value.is(KindOfObject)) { + if (!value.isResource()) { return false; } - Object obj = value.toObject(); + Resource obj = value.toResource(); if (obj.isNull() || obj.getTyped(true) == NULL) { return false; } @@ -627,7 +627,7 @@ public: { int data_size = size * nmemb; Variant ret = ch->do_callback( - t->callback, CREATE_VECTOR3(Object(ch), t->fp->fd(), data_size)); + t->callback, CREATE_VECTOR3(Resource(ch), t->fp->fd(), data_size)); if (ret.isString()) { String sret = ret.toString(); length = data_size < sret.size() ? data_size : sret.size(); @@ -659,7 +659,7 @@ public: { Variant ret = ch->do_callback( t->callback, - CREATE_VECTOR2(Object(ch), String(data, length, CopyString))); + CREATE_VECTOR2(Resource(ch), String(data, length, CopyString))); length = ret.toInt64(); } break; @@ -689,7 +689,7 @@ public: { Variant ret = ch->do_callback( t->callback, - CREATE_VECTOR2(Object(ch), String(data, length, CopyString))); + CREATE_VECTOR2(Resource(ch), String(data, length, CopyString))); length = ret.toInt64(); } break; @@ -759,7 +759,7 @@ Variant f_curl_init(CStrRef url /* = null_string */) { return NEWOBJ(CurlResource)(url); } -Variant f_curl_copy_handle(CObjRef ch) { +Variant f_curl_copy_handle(CResRef ch) { CHECK_RESOURCE(curl); return NEWOBJ(CurlResource)(curl); } @@ -801,12 +801,12 @@ Variant f_curl_version(int uversion /* = k_CURLVERSION_NOW */) { return ret.create(); } -bool f_curl_setopt(CObjRef ch, int option, CVarRef value) { +bool f_curl_setopt(CResRef ch, int option, CVarRef value) { CHECK_RESOURCE(curl); return curl->setOption(option, value); } -bool f_curl_setopt_array(CObjRef ch, CArrRef options) { +bool f_curl_setopt_array(CResRef ch, CArrRef options) { CHECK_RESOURCE(curl); for (ArrayIter iter(options); iter; ++iter) { if (!curl->setOption(iter.first().toInt32(), iter.second())) { @@ -816,12 +816,12 @@ bool f_curl_setopt_array(CObjRef ch, CArrRef options) { return true; } -Variant f_fb_curl_getopt(CObjRef ch, int opt /* = 0 */) { +Variant f_fb_curl_getopt(CResRef ch, int opt /* = 0 */) { CHECK_RESOURCE(curl); return curl->getOption(opt); } -Variant f_curl_exec(CObjRef ch) { +Variant f_curl_exec(CResRef ch) { CHECK_RESOURCE(curl); return curl->execute(); } @@ -850,7 +850,7 @@ const StaticString s_redirect_time("redirect_time"), s_request_header("request_header"); -Variant f_curl_getinfo(CObjRef ch, int opt /* = 0 */) { +Variant f_curl_getinfo(CResRef ch, int opt /* = 0 */) { CHECK_RESOURCE(curl); CURL *cp = curl->get(); @@ -998,17 +998,17 @@ Variant f_curl_getinfo(CObjRef ch, int opt /* = 0 */) { return uninit_null(); } -Variant f_curl_errno(CObjRef ch) { +Variant f_curl_errno(CResRef ch) { CHECK_RESOURCE(curl); return curl->getError(); } -Variant f_curl_error(CObjRef ch) { +Variant f_curl_error(CResRef ch) { CHECK_RESOURCE(curl); return curl->getErrorString(); } -Variant f_curl_close(CObjRef ch) { +Variant f_curl_close(CResRef ch) { CHECK_RESOURCE(curl); curl->close(); return uninit_null(); @@ -1040,13 +1040,13 @@ public: } } - void add(CObjRef ch) { + void add(CResRef ch) { m_easyh.append(ch); } void remove(CurlResource *curle) { for (ArrayIter iter(m_easyh); iter; ++iter) { - if (iter.second().toObject().getTyped()->get(true) == + if (iter.second().toResource().getTyped()->get(true) == curle->get()) { m_easyh.remove(iter.first()); return; @@ -1054,20 +1054,21 @@ public: } } - Object find(CURL *cp) { + Resource find(CURL *cp) { for (ArrayIter iter(m_easyh); iter; ++iter) { - if (iter.second().toObject().getTyped()->get(true) == cp) { - return iter.second().toObject(); + if (iter.second().toResource(). + getTyped()->get(true) == cp) { + return iter.second().toResource(); } } - return Object(); + return Resource(); } void check_exceptions() { ObjectData* phpException = 0; Exception* cppException = 0; for (ArrayIter iter(m_easyh); iter; ++iter) { - CurlResource* curl = iter.second().toCObjRef(). getTyped(); + CurlResource* curl = iter.second().toResource().getTyped(); if (ObjectData* e = curl->getAndClearPhpException()) { if (phpException) { e->o_set(s_previous, Variant(phpException), s_exception); @@ -1119,25 +1120,25 @@ StaticString CurlMultiResource::s_class_name("cURL Multi Handle"); return uninit_null(); \ } \ -Object f_curl_multi_init() { +Resource f_curl_multi_init() { return NEWOBJ(CurlMultiResource)(); } -Variant f_curl_multi_add_handle(CObjRef mh, CObjRef ch) { +Variant f_curl_multi_add_handle(CResRef mh, CResRef ch) { CHECK_MULTI_RESOURCE(curlm); CurlResource *curle = ch.getTyped(); curlm->add(ch); return curl_multi_add_handle(curlm->get(), curle->get()); } -Variant f_curl_multi_remove_handle(CObjRef mh, CObjRef ch) { +Variant f_curl_multi_remove_handle(CResRef mh, CResRef ch) { CHECK_MULTI_RESOURCE(curlm); CurlResource *curle = ch.getTyped(); curlm->remove(curle); return curl_multi_remove_handle(curlm->get(), curle->get()); } -Variant f_curl_multi_exec(CObjRef mh, VRefParam still_running) { +Variant f_curl_multi_exec(CResRef mh, VRefParam still_running) { CHECK_MULTI_RESOURCE(curlm); int running = still_running; IOStatusHelper io("curl_multi_exec"); @@ -1192,7 +1193,7 @@ static void hphp_curl_multi_select(CURLM *mh, int timeout_ms, int *ret) { # endif #endif -Variant f_curl_multi_select(CObjRef mh, double timeout /* = 1.0 */) { +Variant f_curl_multi_select(CResRef mh, double timeout /* = 1.0 */) { CHECK_MULTI_RESOURCE(curlm); int ret; unsigned long timeout_ms = (unsigned long)(timeout * 1000.0); @@ -1201,7 +1202,7 @@ Variant f_curl_multi_select(CObjRef mh, double timeout /* = 1.0 */) { return ret; } -Variant f_curl_multi_getcontent(CObjRef ch) { +Variant f_curl_multi_getcontent(CResRef ch) { CHECK_RESOURCE(curl); return curl->getContents(); } @@ -1217,7 +1218,7 @@ Array f_curl_convert_fd_to_stream(fd_set *fd, int max_fd) { return ret; } -Variant f_fb_curl_multi_fdset(CObjRef mh, +Variant f_fb_curl_multi_fdset(CResRef mh, VRefParam read_fd_set, VRefParam write_fd_set, VRefParam exc_fd_set, @@ -1249,7 +1250,7 @@ const StaticString s_headers("headers"), s_requests("requests"); -Variant f_curl_multi_info_read(CObjRef mh, +Variant f_curl_multi_info_read(CResRef mh, VRefParam msgs_in_queue /* = null */) { CHECK_MULTI_RESOURCE(curlm); @@ -1264,14 +1265,14 @@ Variant f_curl_multi_info_read(CObjRef mh, Array ret; ret.set(s_msg, tmp_msg->msg); ret.set(s_result, tmp_msg->data.result); - Object curle = curlm->find(tmp_msg->easy_handle); + Resource curle = curlm->find(tmp_msg->easy_handle); if (!curle.isNull()) { ret.set(s_handle, curle); } return ret; } -Variant f_curl_multi_close(CObjRef mh) { +Variant f_curl_multi_close(CResRef mh) { CHECK_MULTI_RESOURCE(curlm); curlm->close(); return uninit_null(); @@ -1424,7 +1425,7 @@ Variant f_evhttp_async_get(CStrRef url, CArrRef headers /* = null_array */, LibEventHttpClientPtr client = prepare_client(url, "", headers, timeout, true, false); if (client) { - return Object(NEWOBJ(LibEventHttpHandle)(client)); + return Resource(NEWOBJ(LibEventHttpHandle)(client)); } return false; } @@ -1438,12 +1439,12 @@ Variant f_evhttp_async_post(CStrRef url, CStrRef data, LibEventHttpClientPtr client = prepare_client(url, data, headers, timeout, true, true); if (client) { - return Object(NEWOBJ(LibEventHttpHandle)(client)); + return Resource(NEWOBJ(LibEventHttpHandle)(client)); } return false; } -Variant f_evhttp_recv(CObjRef handle) { +Variant f_evhttp_recv(CResRef handle) { if (RuntimeOption::ServerHttpSafeMode) { throw_fatal("evhttp_recv is disabled"); } diff --git a/hphp/runtime/ext/ext_curl.h b/hphp/runtime/ext/ext_curl.h index 717d4b1ff..221729e78 100644 --- a/hphp/runtime/ext/ext_curl.h +++ b/hphp/runtime/ext/ext_curl.h @@ -29,31 +29,31 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// Variant f_curl_init(CStrRef url = null_string); -Variant f_curl_copy_handle(CObjRef ch); +Variant f_curl_copy_handle(CResRef ch); Variant f_curl_version(int uversion = k_CURLVERSION_NOW); -bool f_curl_setopt(CObjRef ch, int option, CVarRef value); -bool f_curl_setopt_array(CObjRef ch, CArrRef options); -Variant f_fb_curl_getopt(CObjRef ch, int opt = 0); -Variant f_curl_exec(CObjRef ch); -Variant f_curl_getinfo(CObjRef ch, int opt = 0); -Variant f_curl_errno(CObjRef ch); -Variant f_curl_error(CObjRef ch); -Variant f_curl_close(CObjRef ch); -Object f_curl_multi_init(); -Variant f_curl_multi_add_handle(CObjRef mh, CObjRef ch); -Variant f_curl_multi_remove_handle(CObjRef mh, CObjRef ch); -Variant f_curl_multi_exec(CObjRef mh, VRefParam still_running); -Variant f_curl_multi_select(CObjRef mh, double timeout = 1.0); -Variant f_fb_curl_multi_fdset(CObjRef mh, VRefParam read_fd_set, VRefParam write_fd_set, VRefParam exc_fd_set, VRefParam max_fd = null_object); -Variant f_curl_multi_getcontent(CObjRef ch); -Variant f_curl_multi_info_read(CObjRef mh, VRefParam msgs_in_queue = uninit_null()); -Variant f_curl_multi_close(CObjRef mh); +bool f_curl_setopt(CResRef ch, int option, CVarRef value); +bool f_curl_setopt_array(CResRef ch, CArrRef options); +Variant f_fb_curl_getopt(CResRef ch, int opt = 0); +Variant f_curl_exec(CResRef ch); +Variant f_curl_getinfo(CResRef ch, int opt = 0); +Variant f_curl_errno(CResRef ch); +Variant f_curl_error(CResRef ch); +Variant f_curl_close(CResRef ch); +Resource f_curl_multi_init(); +Variant f_curl_multi_add_handle(CResRef mh, CResRef ch); +Variant f_curl_multi_remove_handle(CResRef mh, CResRef ch); +Variant f_curl_multi_exec(CResRef mh, VRefParam still_running); +Variant f_curl_multi_select(CResRef mh, double timeout = 1.0); +Variant f_fb_curl_multi_fdset(CResRef mh, VRefParam read_fd_set, VRefParam write_fd_set, VRefParam exc_fd_set, VRefParam max_fd = null_object); +Variant f_curl_multi_getcontent(CResRef ch); +Variant f_curl_multi_info_read(CResRef mh, VRefParam msgs_in_queue = uninit_null()); +Variant f_curl_multi_close(CResRef mh); void f_evhttp_set_cache(CStrRef address, int max_conn, int port = 80); Variant f_evhttp_get(CStrRef url, CArrRef headers = null_array, int timeout = 5); Variant f_evhttp_post(CStrRef url, CStrRef data, CArrRef headers = null_array, int timeout = 5); Variant f_evhttp_async_get(CStrRef url, CArrRef headers = null_array, int timeout = 5); Variant f_evhttp_async_post(CStrRef url, CStrRef data, CArrRef headers = null_array, int timeout = 5); -Variant f_evhttp_recv(CObjRef handle); +Variant f_evhttp_recv(CResRef handle); extern const int64_t k_CURLINFO_LOCAL_PORT; extern const int64_t k_CURLOPT_TIMEOUT_MS; diff --git a/hphp/runtime/ext/ext_datetime.cpp b/hphp/runtime/ext/ext_datetime.cpp index 92eb6af8b..571adbcfc 100644 --- a/hphp/runtime/ext/ext_datetime.cpp +++ b/hphp/runtime/ext/ext_datetime.cpp @@ -118,7 +118,7 @@ int64_t c_DateTime::t_gettimestamp() { } Variant c_DateTime::t_gettimezone() { - SmartObject tz = m_dt->timezone(); + SmartResource tz = m_dt->timezone(); if (tz->isValid()) { return c_DateTimeZone::wrap(tz); } @@ -308,7 +308,7 @@ Variant c_DateInterval::t___set(Variant member, Variant value) { } Object c_DateInterval::ti_createfromdatestring(CStrRef time) { - SmartObject di(NEWOBJ(DateInterval)(time, true)); + SmartResource di(NEWOBJ(DateInterval)(time, true)); return c_DateInterval::wrap(di); } @@ -429,7 +429,7 @@ Variant f_strtotime(CStrRef input, } DateTime dt(timestamp); - if (!dt.fromString(input, SmartObject())) { + if (!dt.fromString(input, SmartResource())) { return false; } bool error; diff --git a/hphp/runtime/ext/ext_datetime.h b/hphp/runtime/ext/ext_datetime.h index ee3027900..452302bf8 100644 --- a/hphp/runtime/ext/ext_datetime.h +++ b/hphp/runtime/ext/ext_datetime.h @@ -67,7 +67,7 @@ class c_DateTime : public ExtObjectData { public: Object t_sub(CObjRef interval); // Helper for DateTime -> c_DateTime conversion - public: static Object wrap(SmartObject dt) { + public: static Object wrap(SmartResource dt) { c_DateTime *cdt = NEWOBJ(c_DateTime)(); Object ret(cdt); cdt->m_dt = dt; @@ -75,15 +75,15 @@ class c_DateTime : public ExtObjectData { } // Helper for c_DateTime -> DateTime conversion - public: static SmartObject unwrap(CObjRef datetime) { + public: static SmartResource unwrap(CObjRef datetime) { SmartObject cdt = datetime.getTyped(true); if (cdt.get() == NULL) - return SmartObject(); + return SmartResource(); return cdt->m_dt; } private: - SmartObject m_dt; + SmartResource m_dt; public: virtual c_DateTime* clone(); }; @@ -123,7 +123,7 @@ class c_DateTimeZone : public ExtObjectData { public: static Array ti_listidentifiers(); // Helper for TimeZone -> c_DateTimeZone conversion - public: static Object wrap(SmartObject tz) { + public: static Object wrap(SmartResource tz) { c_DateTimeZone *ctz = NEWOBJ(c_DateTimeZone)(); Object ret(ctz); ctz->m_tz = tz; @@ -131,15 +131,15 @@ class c_DateTimeZone : public ExtObjectData { } // Helper for c_DateTimeZone -> TimeZone conversion - public: static SmartObject unwrap(CObjRef timezone) { + public: static SmartResource unwrap(CObjRef timezone) { SmartObject ctz = timezone.getTyped(true); if (ctz.get() == NULL) - return SmartObject(); + return SmartResource(); return ctz->m_tz; } private: - SmartObject m_tz; + SmartResource m_tz; public: virtual c_DateTimeZone* clone(); }; @@ -162,23 +162,23 @@ class c_DateInterval : public ExtObjectDataFlags di) { + public: static Object wrap(SmartResource di) { c_DateInterval *cdi = NEWOBJ(c_DateInterval)(); Object ret(cdi); cdi->m_di = di; return ret; } - public: static SmartObject unwrap(CObjRef dateinterval) { + public: static SmartResource unwrap(CObjRef dateinterval) { SmartObject cdi = dateinterval.getTyped(true); if (cdi.get() == NULL) - return SmartObject(); + return SmartResource(); return cdi->m_di; } private: - SmartObject m_di; + SmartResource m_di; public: virtual c_DateInterval* clone(); diff --git a/hphp/runtime/ext/ext_file.cpp b/hphp/runtime/ext/ext_file.cpp index e42f7c08a..f75952a40 100644 --- a/hphp/runtime/ext/ext_file.cpp +++ b/hphp/runtime/ext/ext_file.cpp @@ -147,7 +147,8 @@ Variant f_fopen(CStrRef filename, CStrRef mode, bool use_include_path /* = false */, CVarRef context /* = null */) { if (!context.isNull() && - (!context.isObject() || !context.toObject().getTyped())) { + (!context.isResource() || + !context.toResource().getTyped())) { raise_warning("$context must be a valid Stream Context or NULL"); return false; } @@ -159,7 +160,7 @@ Variant f_fopen(CStrRef filename, CStrRef mode, Variant f_popen(CStrRef command, CStrRef mode) { File *file = NEWOBJ(Pipe)(); - Object handle(file); + Resource handle(file); bool ret = CHECK_ERROR(file->open(File::TranslateCommand(command), mode)); if (!ret) { return false; @@ -167,29 +168,29 @@ Variant f_popen(CStrRef command, CStrRef mode) { return handle; } -bool f_fclose(CObjRef handle) { +bool f_fclose(CResRef handle) { CHECK_HANDLE(handle, f); return CHECK_ERROR(f->close()); } -Variant f_pclose(CObjRef handle) { +Variant f_pclose(CResRef handle) { CHECK_HANDLE(handle, f); CHECK_ERROR(f->close()); return s_file_data->m_pcloseRet; } -Variant f_fseek(CObjRef handle, int64_t offset, +Variant f_fseek(CResRef handle, int64_t offset, int64_t whence /* = k_SEEK_SET */) { CHECK_HANDLE(handle, f); return CHECK_ERROR(f->seek(offset, whence)) ? 0 : -1; } -bool f_rewind(CObjRef handle) { +bool f_rewind(CResRef handle) { CHECK_HANDLE(handle, f); return CHECK_ERROR(f->rewind()); } -Variant f_ftell(CObjRef handle) { +Variant f_ftell(CResRef handle) { CHECK_HANDLE(handle, f); int64_t ret = f->tell(); if (!CHECK_ERROR(ret != -1)) { @@ -198,12 +199,12 @@ Variant f_ftell(CObjRef handle) { return ret; } -bool f_feof(CObjRef handle) { +bool f_feof(CResRef handle) { CHECK_HANDLE(handle, f); return f->eof(); } -Variant f_fstat(CObjRef handle) { +Variant f_fstat(CResRef handle) { PlainFile *file = handle.getTyped(true, true); if (file == NULL) { raise_warning("Not a valid stream resource"); @@ -214,12 +215,12 @@ Variant f_fstat(CObjRef handle) { return stat_impl(&sb); } -Variant f_fread(CObjRef handle, int64_t length) { +Variant f_fread(CResRef handle, int64_t length) { CHECK_HANDLE(handle, f); return f->read(length); } -Variant f_fgetc(CObjRef handle) { +Variant f_fgetc(CResRef handle) { CHECK_HANDLE(handle, f); int result = f->getc(); if (result == EOF) { @@ -228,7 +229,7 @@ Variant f_fgetc(CObjRef handle) { return String::FromChar(result); } -Variant f_fgets(CObjRef handle, int64_t length /* = 0 */) { +Variant f_fgets(CResRef handle, int64_t length /* = 0 */) { if (length < 0) { throw_invalid_argument("length (negative): %" PRId64, length); return false; @@ -241,7 +242,7 @@ Variant f_fgets(CObjRef handle, int64_t length /* = 0 */) { return false; } -Variant f_fgetss(CObjRef handle, int64_t length /* = 0 */, +Variant f_fgetss(CResRef handle, int64_t length /* = 0 */, CStrRef allowable_tags /* = null_string */) { Variant ret = f_fgets(handle, length); if (!same(ret, false)) { @@ -250,53 +251,55 @@ Variant f_fgetss(CObjRef handle, int64_t length /* = 0 */, return ret; } -Variant f_fscanf(int _argc, CObjRef handle, CStrRef format, CArrRef _argv /* = null_array */) { +Variant f_fscanf(int _argc, CResRef handle, CStrRef format, + CArrRef _argv /* = null_array */) { CHECK_HANDLE(handle, f); return f_sscanf(_argc, f->readLine(), format, _argv); } -Variant f_fpassthru(CObjRef handle) { +Variant f_fpassthru(CResRef handle) { CHECK_HANDLE(handle, f); return f->print(); } -Variant f_fwrite(CObjRef handle, CStrRef data, int64_t length /* = 0 */) { +Variant f_fwrite(CResRef handle, CStrRef data, int64_t length /* = 0 */) { CHECK_HANDLE(handle, f); int64_t ret = f->write(data, length); if (ret < 0) ret = 0; return ret; } -Variant f_fputs(CObjRef handle, CStrRef data, int64_t length /* = 0 */) { +Variant f_fputs(CResRef handle, CStrRef data, int64_t length /* = 0 */) { CHECK_HANDLE(handle, f); int64_t ret = f->write(data, length); if (ret < 0) ret = 0; return ret; } -Variant f_fprintf(int _argc, CObjRef handle, CStrRef format, CArrRef _argv /* = null_array */) { +Variant f_fprintf(int _argc, CResRef handle, CStrRef format, + CArrRef _argv /* = null_array */) { CHECK_HANDLE(handle, f); return f->printf(format, _argv); } -Variant f_vfprintf(CObjRef handle, CStrRef format, CArrRef args) { +Variant f_vfprintf(CResRef handle, CStrRef format, CArrRef args) { CHECK_HANDLE(handle, f); return f->printf(format, args); } -bool f_fflush(CObjRef handle) { +bool f_fflush(CResRef handle) { CHECK_HANDLE(handle, f); return CHECK_ERROR(f->flush()); } -bool f_ftruncate(CObjRef handle, int64_t size) { +bool f_ftruncate(CResRef handle, int64_t size) { CHECK_HANDLE(handle, f); return CHECK_ERROR(f->truncate(size)); } static int flock_values[] = { LOCK_SH, LOCK_EX, LOCK_UN }; -bool f_flock(CObjRef handle, int operation, VRefParam wouldblock /* = null */) { +bool f_flock(CResRef handle, int operation, VRefParam wouldblock /* = null */) { CHECK_HANDLE(handle, f); bool block = false; int act; @@ -312,7 +315,7 @@ bool f_flock(CObjRef handle, int operation, VRefParam wouldblock /* = null */) { return ret; } -Variant f_fputcsv(CObjRef handle, CArrRef fields, CStrRef delimiter /* = "," */, +Variant f_fputcsv(CResRef handle, CArrRef fields, CStrRef delimiter /* = "," */, CStrRef enclosure /* = "\"" */) { if (delimiter.size() != 1) { throw_invalid_argument("delimiter: %s", delimiter.data()); @@ -326,7 +329,7 @@ Variant f_fputcsv(CObjRef handle, CArrRef fields, CStrRef delimiter /* = "," */, return f->writeCSV(fields, delimiter.charAt(0), enclosure.charAt(0)); } -Variant f_fgetcsv(CObjRef handle, int64_t length /* = 0 */, +Variant f_fgetcsv(CResRef handle, int64_t length /* = 0 */, CStrRef delimiter /* = "," */, CStrRef enclosure /* = "\"" */, CStrRef escape /* = "\\" */) { @@ -360,7 +363,7 @@ Variant f_file_get_contents(CStrRef filename, int64_t maxlen /* = 0 */) { Variant stream = f_fopen(filename, "rb", use_include_path, context); if (same(stream, false)) return false; - return f_stream_get_contents(stream.toObject(), maxlen, offset); + return f_stream_get_contents(stream.toResource(), maxlen, offset); } Variant f_file_put_contents(CStrRef filename, CVarRef data, @@ -370,7 +373,7 @@ Variant f_file_put_contents(CStrRef filename, CVarRef data, if (!fvar.toBoolean()) { return false; } - File *f = fvar.asObjRef().getTyped(); + File *f = fvar.asResRef().getTyped(); if ((flags & LOCK_EX) && flock(f->fd(), LOCK_EX)) { return false; @@ -380,7 +383,7 @@ Variant f_file_put_contents(CStrRef filename, CVarRef data, switch (data.getType()) { case KindOfObject: { - File *fsrc = data.toObject().getTyped(true, true); + File *fsrc = data.toResource().getTyped(true, true); if (fsrc == NULL) { raise_warning("Not a valid stream resource"); return false; @@ -500,7 +503,7 @@ Variant f_readfile(CStrRef filename, bool use_include_path /* = false */, Util::safe_strerror(errno).c_str()); return false; } - Variant ret = f_fpassthru(f.toObject()); + Variant ret = f_fpassthru(f.toResource()); return ret; } @@ -1038,8 +1041,8 @@ bool f_copy(CStrRef source, CStrRef dest, return false; } - return f_stream_copy_to_stream(sfile.toObject(), - dfile.toObject()).toBoolean(); + return f_stream_copy_to_stream(sfile.toResource(), + dfile.toResource()).toBoolean(); } else { int ret = RuntimeOption::UseDirectCopy ? @@ -1232,7 +1235,7 @@ Variant f_tempnam(CStrRef dir, CStrRef prefix) { Variant f_tmpfile() { FILE *f = tmpfile(); if (f) { - return Object(NEWOBJ(PlainFile)(f)); + return Resource(NEWOBJ(PlainFile)(f)); } return false; } @@ -1321,7 +1324,7 @@ public: defaultDirectory.reset(); } - Object defaultDirectory; + Resource defaultDirectory; }; IMPLEMENT_STATIC_REQUEST_LOCAL(DirectoryRequestData, s_directory_data); @@ -1329,14 +1332,14 @@ const StaticString s_handle("handle"), s_path("path"); -static DIR *get_dir(CObjRef dir_handle) { - Object obj; +static DIR *get_dir(CResRef dir_handle) { + Resource obj; if (dir_handle.isNull()) { obj = s_directory_data->defaultDirectory; } else { Array arr = dir_handle.toArray(); if (arr.exists(s_handle)) { - obj = arr[s_handle].toObject(); + obj = arr[s_handle].toResource(); } else { obj = dir_handle; } @@ -1371,10 +1374,10 @@ Variant f_opendir(CStrRef path, CVarRef context /* = null */) { Directory *p = new Directory(dir); s_directory_data->defaultDirectory = p; - return Object(p); + return Resource(p); } -Variant f_readdir(CObjRef dir_handle) { +Variant f_readdir(CResRef dir_handle) { DIR *dir = get_dir(dir_handle); if (dir) { struct dirent entry; @@ -1387,7 +1390,7 @@ Variant f_readdir(CObjRef dir_handle) { return false; } -void f_rewinddir(CObjRef dir_handle) { +void f_rewinddir(CResRef dir_handle) { DIR *dir = get_dir(dir_handle); if (dir) { rewinddir(dir); @@ -1408,7 +1411,7 @@ Variant f_scandir(CStrRef directory, bool descending /* = false */, if (dir == NULL) { return false; } - Object deleter(new Directory(dir)); + Resource deleter(new Directory(dir)); std::vector names; while (true) { @@ -1434,12 +1437,12 @@ Variant f_scandir(CStrRef directory, bool descending /* = false */, return ret; } -void f_closedir(CObjRef dir_handle) { +void f_closedir(CResRef dir_handle) { if (!dir_handle.isNull()) { - Object obj; + Resource obj; Array arr = dir_handle.toArray(); if (arr.exists(s_handle)) { - obj = arr[s_handle].toObject(); + obj = arr[s_handle].toResource(); } else { obj = dir_handle; } diff --git a/hphp/runtime/ext/ext_file.h b/hphp/runtime/ext/ext_file.h index b1278c87d..713d4b318 100644 --- a/hphp/runtime/ext/ext_file.h +++ b/hphp/runtime/ext/ext_file.h @@ -34,30 +34,30 @@ namespace HPHP { Variant f_fopen(CStrRef filename, CStrRef mode, bool use_include_path = false, CVarRef context = uninit_null()); Variant f_popen(CStrRef command, CStrRef mode); -bool f_fclose(CObjRef handle); -Variant f_pclose(CObjRef handle); -Variant f_fseek(CObjRef handle, int64_t offset, int64_t whence = k_SEEK_SET); -bool f_rewind(CObjRef handle); -Variant f_ftell(CObjRef handle); -bool f_feof(CObjRef handle); -Variant f_fstat(CObjRef handle); -Variant f_fread(CObjRef handle, int64_t length); -Variant f_fgetc(CObjRef handle); -Variant f_fgets(CObjRef handle, int64_t length = 0); -Variant f_fgetss(CObjRef handle, int64_t length = 0, +bool f_fclose(CResRef handle); +Variant f_pclose(CResRef handle); +Variant f_fseek(CResRef handle, int64_t offset, int64_t whence = k_SEEK_SET); +bool f_rewind(CResRef handle); +Variant f_ftell(CResRef handle); +bool f_feof(CResRef handle); +Variant f_fstat(CResRef handle); +Variant f_fread(CResRef handle, int64_t length); +Variant f_fgetc(CResRef handle); +Variant f_fgets(CResRef handle, int64_t length = 0); +Variant f_fgetss(CResRef handle, int64_t length = 0, CStrRef allowable_tags = null_string); -Variant f_fscanf(int _argc, CObjRef handle, CStrRef format, CArrRef _argv = null_array); -Variant f_fpassthru(CObjRef handle); -Variant f_fwrite(CObjRef handle, CStrRef data, int64_t length = 0); -Variant f_fputs(CObjRef handle, CStrRef data, int64_t length = 0); -Variant f_fprintf(int _argc, CObjRef handle, CStrRef format, CArrRef _argv = null_array); -Variant f_vfprintf(CObjRef handle, CStrRef format, CArrRef args); -bool f_fflush(CObjRef handle); -bool f_ftruncate(CObjRef handle, int64_t size); -bool f_flock(CObjRef handle, int operation, VRefParam wouldblock = uninit_null()); -Variant f_fputcsv(CObjRef handle, CArrRef fields, CStrRef delimiter = ",", +Variant f_fscanf(int _argc, CResRef handle, CStrRef format, CArrRef _argv = null_array); +Variant f_fpassthru(CResRef handle); +Variant f_fwrite(CResRef handle, CStrRef data, int64_t length = 0); +Variant f_fputs(CResRef handle, CStrRef data, int64_t length = 0); +Variant f_fprintf(int _argc, CResRef handle, CStrRef format, CArrRef _argv = null_array); +Variant f_vfprintf(CResRef handle, CStrRef format, CArrRef args); +bool f_fflush(CResRef handle); +bool f_ftruncate(CResRef handle, int64_t size); +bool f_flock(CResRef handle, int operation, VRefParam wouldblock = uninit_null()); +Variant f_fputcsv(CResRef handle, CArrRef fields, CStrRef delimiter = ",", CStrRef enclosure = "\""); -Variant f_fgetcsv(CObjRef handle, int64_t length = 0, CStrRef delimiter = ",", +Variant f_fgetcsv(CResRef handle, int64_t length = 0, CStrRef delimiter = ",", CStrRef enclosure = "\"", CStrRef escape = "\\"); /////////////////////////////////////////////////////////////////////////////// @@ -149,11 +149,11 @@ bool f_chdir(CStrRef directory); bool f_chroot(CStrRef directory); Variant f_dir(CStrRef directory); Variant f_opendir(CStrRef path, CVarRef context = uninit_null()); -Variant f_readdir(CObjRef dir_handle); -void f_rewinddir(CObjRef dir_handle); +Variant f_readdir(CResRef dir_handle); +void f_rewinddir(CResRef dir_handle); Variant f_scandir(CStrRef directory, bool descending = false, CVarRef context = uninit_null()); -void f_closedir(CObjRef dir_handle); +void f_closedir(CResRef dir_handle); /////////////////////////////////////////////////////////////////////////////// } diff --git a/hphp/runtime/ext/ext_hash.cpp b/hphp/runtime/ext/ext_hash.cpp index 8d684e12a..5fe4a21fd 100644 --- a/hphp/runtime/ext/ext_hash.cpp +++ b/hphp/runtime/ext/ext_hash.cpp @@ -181,8 +181,9 @@ static Variant php_hash_do_hash(CStrRef algo, CStrRef data, bool isfilename, ops->hash_init(context); if (isfilename) { - for (Variant chunk = f_fread(f.toObject(), 1024); !is_empty_string(chunk); - chunk = f_fread(f.toObject(), 1024)) { + for (Variant chunk = f_fread(f.toResource(), 1024); + !is_empty_string(chunk); + chunk = f_fread(f.toResource(), 1024)) { String schunk = chunk.toString(); ops->hash_update(context, (unsigned char *)schunk.data(), schunk.size()); } @@ -272,8 +273,9 @@ static Variant php_hash_do_hash_hmac(CStrRef algo, CStrRef data, char *K = prepare_hmac_key(ops, context, key); if (isfilename) { - for (Variant chunk = f_fread(f.toObject(), 1024); !is_empty_string(chunk); - chunk = f_fread(f.toObject(), 1024)) { + for (Variant chunk = f_fread(f.toResource(), 1024); + !is_empty_string(chunk); + chunk = f_fread(f.toResource(), 1024)) { String schunk = chunk.toString(); ops->hash_update(context, (unsigned char *)schunk.data(), schunk.size()); } @@ -324,26 +326,27 @@ Variant f_hash_init(CStrRef algo, int options /* = 0 */, if (options & k_HASH_HMAC) { hash->key = prepare_hmac_key(ops, context, key); } - return Object(hash); + return Resource(hash); } -bool f_hash_update(CObjRef context, CStrRef data) { +bool f_hash_update(CResRef context, CStrRef data) { HashContext *hash = context.getTyped(); hash->ops->hash_update(hash->context, (unsigned char *)data.data(), data.size()); return true; } -bool f_hash_update_file(CObjRef init_context, CStrRef filename, - CObjRef stream_context /* = null */) { +bool f_hash_update_file(CResRef init_context, CStrRef filename, + CResRef stream_context /* = null */) { Variant f = f_fopen(filename, "rb"); if (same(f, false)) { return false; } HashContext *hash = init_context.getTyped(); - for (Variant chunk = f_fread(f.toObject(), 1024); !is_empty_string(chunk); - chunk = f_fread(f.toObject(), 1024)) { + for (Variant chunk = f_fread(f.toResource(), 1024); + !is_empty_string(chunk); + chunk = f_fread(f.toResource(), 1024)) { String schunk = chunk.toString(); hash->ops->hash_update(hash->context, (unsigned char *)schunk.data(), schunk.size()); @@ -351,7 +354,7 @@ bool f_hash_update_file(CObjRef init_context, CStrRef filename, return true; } -int64_t f_hash_update_stream(CObjRef context, CObjRef handle, +int64_t f_hash_update_stream(CResRef context, CResRef handle, int length /* = -1 */) { HashContext *hash = context.getTyped(); int didread = 0; @@ -369,7 +372,7 @@ int64_t f_hash_update_stream(CObjRef context, CObjRef handle, return didread; } -String f_hash_final(CObjRef context, bool raw_output /* = false */) { +String f_hash_final(CResRef context, bool raw_output /* = false */) { HashContext *hash = context.getTyped(); String raw = String(hash->ops->digest_size, ReserveString); diff --git a/hphp/runtime/ext/ext_hash.h b/hphp/runtime/ext/ext_hash.h index 7419dd85f..fbec2ae7c 100644 --- a/hphp/runtime/ext/ext_hash.h +++ b/hphp/runtime/ext/ext_hash.h @@ -29,12 +29,12 @@ Variant f_hash(CStrRef algo, CStrRef data, bool raw_output = false); Array f_hash_algos(); Variant f_hash_init(CStrRef algo, int options = 0, CStrRef key = null_string); Variant f_hash_file(CStrRef algo, CStrRef filename, bool raw_output = false); -String f_hash_final(CObjRef context, bool raw_output = false); +String f_hash_final(CResRef context, bool raw_output = false); Variant f_hash_hmac_file(CStrRef algo, CStrRef filename, CStrRef key, bool raw_output = false); Variant f_hash_hmac(CStrRef algo, CStrRef data, CStrRef key, bool raw_output = false); -bool f_hash_update_file(CObjRef init_context, CStrRef filename, CObjRef stream_context = Object()); -int64_t f_hash_update_stream(CObjRef context, CObjRef handle, int length = -1); -bool f_hash_update(CObjRef context, CStrRef data); +bool f_hash_update_file(CResRef init_context, CStrRef filename, CObjRef stream_context = Object()); +int64_t f_hash_update_stream(CResRef context, CObjRef handle, int length = -1); +bool f_hash_update(CResRef context, CStrRef data); int64_t f_furchash_hphp_ext(CStrRef key, int len, int nPart); bool f_furchash_hphp_ext_supported(); int64_t f_hphp_murmurhash(CStrRef key, int len, int seed); diff --git a/hphp/runtime/ext/ext_image.cpp b/hphp/runtime/ext/ext_image.cpp index c010c646a..456dbcb3d 100644 --- a/hphp/runtime/ext/ext_image.cpp +++ b/hphp/runtime/ext/ext_image.cpp @@ -397,7 +397,7 @@ static const char php_sig_jp2[12] = (char)0x0d, (char)0x0a, (char)0x87, (char)0x0a}; static const char php_sig_iff[4] = {'F','O','R','M'}; -static struct gfxinfo *php_handle_gif(CObjRef stream) { +static struct gfxinfo *php_handle_gif(CResRef stream) { struct gfxinfo *result = NULL; String dim; const unsigned char *s; @@ -415,7 +415,7 @@ static struct gfxinfo *php_handle_gif(CObjRef stream) { return result; } -static struct gfxinfo *php_handle_psd (CObjRef stream) { +static struct gfxinfo *php_handle_psd (CResRef stream) { struct gfxinfo *result = NULL; String dim; const unsigned char *s; @@ -438,7 +438,7 @@ static struct gfxinfo *php_handle_psd (CObjRef stream) { return result; } -static struct gfxinfo *php_handle_bmp (CObjRef stream) { +static struct gfxinfo *php_handle_bmp (CResRef stream) { struct gfxinfo *result = NULL; String dim; const unsigned char *s; @@ -496,7 +496,7 @@ static unsigned long int php_swf_get_bits(unsigned char* buffer, } #if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) -static struct gfxinfo *php_handle_swc(CObjRef stream) { +static struct gfxinfo *php_handle_swc(CResRef stream) { struct gfxinfo *result = NULL; long bits; @@ -577,7 +577,7 @@ static struct gfxinfo *php_handle_swc(CObjRef stream) { } #endif -static struct gfxinfo *php_handle_swf(CObjRef stream) { +static struct gfxinfo *php_handle_swf(CResRef stream) { struct gfxinfo *result = NULL; long bits; unsigned char *a; @@ -599,7 +599,7 @@ static struct gfxinfo *php_handle_swf(CObjRef stream) { return result; } -static struct gfxinfo *php_handle_png(CObjRef stream) { +static struct gfxinfo *php_handle_png(CResRef stream) { struct gfxinfo *result = NULL; String dim; const unsigned char *s; @@ -673,7 +673,7 @@ static struct gfxinfo *php_handle_png(CObjRef stream) { #define M_EXIF 0xE1 /* Exif Attribute Information */ -static unsigned short php_read2(CObjRef stream) { +static unsigned short php_read2(CResRef stream) { unsigned char *a; String str = toString(f_fread(stream, 2)); /* just return 0 if we hit the end-of-file */ @@ -682,7 +682,7 @@ static unsigned short php_read2(CObjRef stream) { return (((unsigned short)a[0]) << 8) + ((unsigned short)a[1]); } -static unsigned int php_next_marker(CObjRef stream, int last_marker, +static unsigned int php_next_marker(CResRef stream, int last_marker, int comment_correction, int ff_read) { int a=0, marker; @@ -733,7 +733,7 @@ static unsigned int php_next_marker(CObjRef stream, int last_marker, return (unsigned int)marker; } -static int php_skip_variable(CObjRef stream) { +static int php_skip_variable(CResRef stream) { off_t length = (unsigned int)php_read2(stream); if (length < 2) { @@ -744,7 +744,7 @@ static int php_skip_variable(CObjRef stream) { return 1; } -static int php_read_APP(CObjRef stream, unsigned int marker, Variant &info) { +static int php_read_APP(CResRef stream, unsigned int marker, Variant &info) { unsigned short length; Variant buffer; unsigned char markername[16]; @@ -771,7 +771,7 @@ static int php_read_APP(CObjRef stream, unsigned int marker, Variant &info) { return 1; } -static struct gfxinfo *php_handle_jpeg(CObjRef stream, Variant &info) { +static struct gfxinfo *php_handle_jpeg(CResRef stream, Variant &info) { struct gfxinfo *result = NULL; unsigned int marker = M_PSEUDO; unsigned short length, ff_read=1; @@ -863,7 +863,7 @@ static struct gfxinfo *php_handle_jpeg(CObjRef stream, Variant &info) { return result; /* perhaps image broken -> no info but size */ } -static unsigned short php_read4(CObjRef stream) { +static unsigned short php_read4(CResRef stream) { unsigned char *a; String str = toString(f_fread(stream, 4)); /* just return 0 if we hit the end-of-file */ @@ -899,7 +899,7 @@ static unsigned short php_read4(CObjRef stream) { #define JPEG2000_MARKER_COM 0x64 /* Comment */ /* Main loop to parse JPEG2000 raw codestream structure */ -static struct gfxinfo *php_handle_jpc(CObjRef stream) { +static struct gfxinfo *php_handle_jpc(CResRef stream) { struct gfxinfo *result = NULL; int highest_bit_depth, bit_depth; unsigned char first_marker_id; @@ -970,7 +970,7 @@ static struct gfxinfo *php_handle_jpc(CObjRef stream) { } /* main loop to parse JPEG 2000 JP2 wrapper format structure */ -static struct gfxinfo *php_handle_jp2(CObjRef stream) { +static struct gfxinfo *php_handle_jp2(CResRef stream) { struct gfxinfo *result = NULL; unsigned int box_length; unsigned int box_type; @@ -1133,7 +1133,7 @@ static unsigned php_ifd_get32u(void *Long, int motorola_intel) { } /* main loop to parse TIFF structure */ -static struct gfxinfo *php_handle_tiff(CObjRef stream, int motorola_intel) { +static struct gfxinfo *php_handle_tiff(CResRef stream, int motorola_intel) { struct gfxinfo *result = NULL; int i, num_entries; unsigned char *dir_entry; @@ -1205,7 +1205,7 @@ static struct gfxinfo *php_handle_tiff(CObjRef stream, int motorola_intel) { return NULL; } -static struct gfxinfo *php_handle_iff(CObjRef stream) { +static struct gfxinfo *php_handle_iff(CResRef stream) { struct gfxinfo * result; String str; char *a; @@ -1263,7 +1263,7 @@ static struct gfxinfo *php_handle_iff(CObjRef stream) { * int Number of columns * int Number of rows */ -static int php_get_wbmp(CObjRef stream, struct gfxinfo **result, int check) { +static int php_get_wbmp(CResRef stream, struct gfxinfo **result, int check) { int i, width = 0, height = 0; if (!f_rewind(stream)) { @@ -1316,7 +1316,7 @@ static int php_get_wbmp(CObjRef stream, struct gfxinfo **result, int check) { return IMAGE_FILETYPE_WBMP; } -static struct gfxinfo *php_handle_wbmp(CObjRef stream) { +static struct gfxinfo *php_handle_wbmp(CResRef stream) { struct gfxinfo *result = (struct gfxinfo *)IM_CALLOC(1, sizeof(struct gfxinfo)); CHECK_ALLOC_R(result, (sizeof(struct gfxinfo)), NULL); @@ -1329,7 +1329,7 @@ static struct gfxinfo *php_handle_wbmp(CObjRef stream) { return result; } -static int php_get_xbm(CObjRef stream, struct gfxinfo **result) { +static int php_get_xbm(CResRef stream, struct gfxinfo **result) { String fline; char *iname; char *type; @@ -1383,7 +1383,7 @@ static int php_get_xbm(CObjRef stream, struct gfxinfo **result) { return 0; } -static struct gfxinfo *php_handle_xbm(CObjRef stream) { +static struct gfxinfo *php_handle_xbm(CResRef stream) { struct gfxinfo *result; php_get_xbm(stream, &result); return result; @@ -1425,7 +1425,7 @@ static char *php_image_type_to_mime_type(int image_type) { } /* detect filetype from first bytes */ -static int php_getimagetype(CObjRef stream) { +static int php_getimagetype(CResRef stream) { File *file = stream.getTyped(); String fileType; String data; @@ -1596,61 +1596,61 @@ Variant f_getimagesize(CStrRef filename, VRefParam imageinfo /* = null */) { raise_warning("failed to open stream: %s", filename.c_str()); return false; } - itype = php_getimagetype(stream.toObject()); + itype = php_getimagetype(stream.toResource()); switch( itype) { case IMAGE_FILETYPE_GIF: - result = php_handle_gif(stream.toObject()); + result = php_handle_gif(stream.toResource()); break; case IMAGE_FILETYPE_JPEG: - result = php_handle_jpeg(stream.toObject(), imageinfo); + result = php_handle_jpeg(stream.toResource(), imageinfo); break; case IMAGE_FILETYPE_PNG: - result = php_handle_png(stream.toObject()); + result = php_handle_png(stream.toResource()); break; case IMAGE_FILETYPE_SWF: - result = php_handle_swf(stream.toObject()); + result = php_handle_swf(stream.toResource()); break; case IMAGE_FILETYPE_SWC: #if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) - result = php_handle_swc(stream.toObject()); + result = php_handle_swc(stream.toResource()); #else raise_notice("The image is a compressed SWF file, but you do not " "have a static version of the zlib extension enabled"); #endif break; case IMAGE_FILETYPE_PSD: - result = php_handle_psd(stream.toObject()); + result = php_handle_psd(stream.toResource()); break; case IMAGE_FILETYPE_BMP: - result = php_handle_bmp(stream.toObject()); + result = php_handle_bmp(stream.toResource()); break; case IMAGE_FILETYPE_TIFF_II: - result = php_handle_tiff(stream.toObject(), 0); + result = php_handle_tiff(stream.toResource(), 0); break; case IMAGE_FILETYPE_TIFF_MM: - result = php_handle_tiff(stream.toObject(), 1); + result = php_handle_tiff(stream.toResource(), 1); break; case IMAGE_FILETYPE_JPC: - result = php_handle_jpc(stream.toObject()); + result = php_handle_jpc(stream.toResource()); break; case IMAGE_FILETYPE_JP2: - result = php_handle_jp2(stream.toObject()); + result = php_handle_jp2(stream.toResource()); break; case IMAGE_FILETYPE_IFF: - result = php_handle_iff(stream.toObject()); + result = php_handle_iff(stream.toResource()); break; case IMAGE_FILETYPE_WBMP: - result = php_handle_wbmp(stream.toObject()); + result = php_handle_wbmp(stream.toResource()); break; case IMAGE_FILETYPE_XBM: - result = php_handle_xbm(stream.toObject()); + result = php_handle_xbm(stream.toResource()); break; default: case IMAGE_FILETYPE_UNKNOWN: break; } - f_fclose(stream.toObject()); + f_fclose(stream.toResource()); if (result) { ArrayInit ret(7); @@ -1726,10 +1726,10 @@ static Variant php_open_plain_file(CStrRef filename, const char *mode, if (same(stream, false)) { return false; } - PlainFile *plain_file = stream.toObject().getTyped(false, true); + PlainFile *plain_file = stream.toResource().getTyped(false, true); FILE *fp = NULL; if (!plain_file || !(fp = plain_file->getStream())) { - f_fclose(stream.toObject()); + f_fclose(stream.toResource()); return false; } if (fpp) *fpp = fp; @@ -1760,7 +1760,7 @@ static void _php_image_output_ctxfree(struct gdIOCtx *ctx) { IM_FREE(ctx); } } -static bool _php_image_output_ctx(CObjRef image, CStrRef filename, +static bool _php_image_output_ctx(CResRef image, CStrRef filename, int quality, int basefilter, int image_type, char *tn, void (*func_p)()) { @@ -1835,9 +1835,9 @@ static bool _php_image_output_ctx(CObjRef image, CStrRef filename, ctx->free(ctx); #endif - if(fp) { + if (fp) { fflush(fp); - f_fclose(stream.toObject()); + f_fclose(stream.toResource()); } return true; @@ -2028,7 +2028,7 @@ static bool _php_image_convert(CStrRef f_org, CStrRef f_dest, gdImageDestroy(im_org); - f_fclose(org_stream.toObject()); + f_fclose(org_stream.toResource()); im_dest = gdImageCreate(dest_width, dest_height); if (im_dest == NULL) { @@ -2072,7 +2072,7 @@ static bool _php_image_convert(CStrRef f_org, CStrRef f_dest, gdImageWBMP(im_dest, black , dest); fflush(dest); - f_fclose(dest_stream.toObject()); + f_fclose(dest_stream.toResource()); gdImageDestroy(im_dest); @@ -2081,7 +2081,7 @@ static bool _php_image_convert(CStrRef f_org, CStrRef f_dest, #endif /* HAVE_GD_WBMP */ // For quality and type, -1 means that the argument does not exist -static bool _php_image_output(CObjRef image, CStrRef filename, int quality, +static bool _php_image_output(CResRef image, CStrRef filename, int quality, int type, int image_type, char *tn, void (*func_p)()) { gdImagePtr im = image.getTyped()->get(); @@ -2154,7 +2154,7 @@ static bool _php_image_output(CObjRef image, CStrRef filename, int quality, break; } fflush(fp); - f_fclose(stream.toObject()); + f_fclose(stream.toResource()); } else { int b; FILE *tmp; @@ -2257,7 +2257,7 @@ static gdImagePtr _php_image_create_from(CStrRef filename, #endif FILE *fp = NULL; - File *file = stream.toObject().getTyped(); + File *file = stream.toResource().getTyped(); PlainFile *plain_file = dynamic_cast(file); if (plain_file) { fp = plain_file->getStream(); @@ -2331,13 +2331,13 @@ static gdImagePtr _php_image_create_from(CStrRef filename, } if (im) { - f_fclose(stream.toObject()); + f_fclose(stream.toResource()); return im; } raise_warning("'%s' is not a valid %s file", filename.c_str(), tn); out_err: - f_fclose(stream.toObject()); + f_fclose(stream.toResource()); return NULL; } @@ -2522,7 +2522,7 @@ static void php_gdimagecharup(gdImagePtr im, gdFontPtr f, int x, int y, * arg = 2 ImageString * arg = 3 ImageStringUp */ -static bool php_imagechar(CObjRef image, int size, int x, int y, +static bool php_imagechar(CResRef image, int size, int x, int y, CStrRef c, int color, int mode) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -2560,7 +2560,7 @@ static bool php_imagechar(CObjRef image, int size, int x, int y, /* arg = 0 normal polygon arg = 1 filled polygon */ -static bool php_imagepolygon(CObjRef image, CArrRef points, int num_points, +static bool php_imagepolygon(CResRef image, CArrRef points, int num_points, int color, int filled) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -2602,7 +2602,7 @@ static bool php_imagepolygon(CObjRef image, CArrRef points, int num_points, return true; } -static bool php_image_filter_negate(CObjRef image, +static bool php_image_filter_negate(CResRef image, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, @@ -2620,7 +2620,7 @@ static bool php_image_filter_negate(CObjRef image, */ } -static bool php_image_filter_grayscale(CObjRef image, +static bool php_image_filter_grayscale(CResRef image, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, @@ -2638,7 +2638,7 @@ static bool php_image_filter_grayscale(CObjRef image, */ } -static bool php_image_filter_brightness(CObjRef image, +static bool php_image_filter_brightness(CResRef image, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, @@ -2656,7 +2656,7 @@ static bool php_image_filter_brightness(CObjRef image, */ } -static bool php_image_filter_contrast(CObjRef image, +static bool php_image_filter_contrast(CResRef image, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, @@ -2674,7 +2674,7 @@ static bool php_image_filter_contrast(CObjRef image, */ } -static bool php_image_filter_colorize(CObjRef image, +static bool php_image_filter_colorize(CResRef image, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, @@ -2695,7 +2695,7 @@ static bool php_image_filter_colorize(CObjRef image, */ } -static bool php_image_filter_edgedetect(CObjRef image, +static bool php_image_filter_edgedetect(CResRef image, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, @@ -2714,7 +2714,7 @@ static bool php_image_filter_edgedetect(CObjRef image, */ } -static bool php_image_filter_emboss(CObjRef image, +static bool php_image_filter_emboss(CResRef image, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, @@ -2732,7 +2732,7 @@ static bool php_image_filter_emboss(CObjRef image, */ } -static bool php_image_filter_gaussian_blur(CObjRef image, +static bool php_image_filter_gaussian_blur(CResRef image, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, @@ -2750,7 +2750,7 @@ static bool php_image_filter_gaussian_blur(CObjRef image, */ } -static bool php_image_filter_selective_blur(CObjRef image, +static bool php_image_filter_selective_blur(CResRef image, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, @@ -2768,7 +2768,7 @@ static bool php_image_filter_selective_blur(CObjRef image, */ } -static bool php_image_filter_mean_removal(CObjRef image, +static bool php_image_filter_mean_removal(CResRef image, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, @@ -2786,7 +2786,7 @@ static bool php_image_filter_mean_removal(CObjRef image, */ } -static bool php_image_filter_smooth(CObjRef image, +static bool php_image_filter_smooth(CResRef image, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, @@ -2854,7 +2854,7 @@ static Variant php_imagettftext_common(int mode, int extended, str = arg4; extrainfo = arg5; } else { - Object image = arg1.toObject(); + Resource image = arg1.toResource(); ptsize = arg2.toDouble(); angle = arg3.toDouble(); x = toInt64(arg4); @@ -2895,7 +2895,7 @@ static Variant php_imagettftext_common(int mode, int extended, raise_warning("Invalid font filename %s", fontname.c_str()); return false; } - f_fclose(stream.toObject()); + f_fclose(stream.toResource()); #ifdef USE_GD_IMGSTRTTF # if HAVE_GD_STRINGFTEX @@ -3127,7 +3127,7 @@ Variant f_imageloadfont(CStrRef file) { #endif } -bool f_imagesetstyle(CObjRef image, CArrRef style) { +bool f_imagesetstyle(CResRef image, CArrRef style) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; int *stylearr; @@ -3157,16 +3157,16 @@ Variant f_imagecreatetruecolor(int width, int height) { if (!im) { return false; } - return Object(new Image(im)); + return Resource(new Image(im)); } -bool f_imageistruecolor(CObjRef image) { +bool f_imageistruecolor(CResRef image) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; return im->trueColor; } -Variant f_imagetruecolortopalette(CObjRef image, bool dither, int ncolors) { +Variant f_imagetruecolortopalette(CResRef image, bool dither, int ncolors) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3178,7 +3178,7 @@ Variant f_imagetruecolortopalette(CObjRef image, bool dither, int ncolors) { return true; } -Variant f_imagecolormatch(CObjRef image1, CObjRef image2) { +Variant f_imagecolormatch(CResRef image1, CResRef image2) { throw NotSupportedException(__func__, "gdImageColorMatch does not exist"); /* gdImagePtr im1 = image1.getTyped()->get(); @@ -3207,14 +3207,14 @@ Variant f_imagecolormatch(CObjRef image1, CObjRef image2) { */ } -bool f_imagesetthickness(CObjRef image, int thickness) { +bool f_imagesetthickness(CResRef image, int thickness) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; gdImageSetThickness(im, thickness); return true; } -bool f_imagefilledellipse(CObjRef image, int cx, int cy, +bool f_imagefilledellipse(CResRef image, int cx, int cy, int width, int height, int color) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3222,7 +3222,7 @@ bool f_imagefilledellipse(CObjRef image, int cx, int cy, return true; } -bool f_imagefilledarc(CObjRef image, int cx, int cy, int width, int height, +bool f_imagefilledarc(CResRef image, int cx, int cy, int width, int height, int start, int end, int color, int style) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3232,28 +3232,28 @@ bool f_imagefilledarc(CObjRef image, int cx, int cy, int width, int height, return true; } -bool f_imagealphablending(CObjRef image, bool blendmode) { +bool f_imagealphablending(CResRef image, bool blendmode) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; gdImageAlphaBlending(im, blendmode); return true; } -bool f_imagesavealpha(CObjRef image, bool saveflag) { +bool f_imagesavealpha(CResRef image, bool saveflag) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; gdImageSaveAlpha(im, saveflag); return true; } -bool f_imagelayereffect(CObjRef image, int effect) { +bool f_imagelayereffect(CResRef image, int effect) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; gdImageAlphaBlending(im, effect); return true; } -Variant f_imagecolorallocatealpha(CObjRef image, int red, int green, int blue, +Variant f_imagecolorallocatealpha(CResRef image, int red, int green, int blue, int alpha) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3264,28 +3264,28 @@ Variant f_imagecolorallocatealpha(CObjRef image, int red, int green, int blue, return ct; } -Variant f_imagecolorresolvealpha(CObjRef image, int red, int green, int blue, +Variant f_imagecolorresolvealpha(CResRef image, int red, int green, int blue, int alpha) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; return gdImageColorResolveAlpha(im, red, green, blue, alpha); } -Variant f_imagecolorclosestalpha(CObjRef image, int red, int green, int blue, +Variant f_imagecolorclosestalpha(CResRef image, int red, int green, int blue, int alpha) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; return gdImageColorClosestAlpha(im, red, green, blue, alpha); } -Variant f_imagecolorexactalpha(CObjRef image, int red, int green, int blue, +Variant f_imagecolorexactalpha(CResRef image, int red, int green, int blue, int alpha) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; return gdImageColorExactAlpha(im, red, green, blue, alpha); } -bool f_imagecopyresampled(CObjRef dst_im, CObjRef src_im, +bool f_imagecopyresampled(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) { gdImagePtr im_src = src_im.getTyped()->get(); @@ -3313,7 +3313,7 @@ Variant f_imagegrabscreen() { #endif } -Variant f_imagerotate(CObjRef source_image, double angle, int bgd_color, +Variant f_imagerotate(CResRef source_image, double angle, int bgd_color, int ignore_transparent /* = 0 */) { #if defined(HPHP_OSS) throw NotSupportedException(__func__, "gdImageRotate does not exist"); @@ -3323,11 +3323,11 @@ Variant f_imagerotate(CObjRef source_image, double angle, int bgd_color, gdImagePtr im_dst = gdImageRotate(im_src, angle, bgd_color, ignore_transparent); if (!im_dst) return false; - return Object(new Image(im_dst)); + return Resource(new Image(im_dst)); #endif } -bool f_imagesettile(CObjRef image, CObjRef tile) { +bool f_imagesettile(CResRef image, CResRef tile) { #if HAVE_GD_IMAGESETTILE gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3340,7 +3340,7 @@ bool f_imagesettile(CObjRef image, CObjRef tile) { #endif } -bool f_imagesetbrush(CObjRef image, CObjRef brush) { +bool f_imagesetbrush(CResRef image, CResRef brush) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; gdImagePtr tile = brush.getTyped()->get(); @@ -3359,7 +3359,7 @@ Variant f_imagecreate(int width, int height) { if (!im) { return false; } - return Object(new Image(im)); + return Resource(new Image(im)); } int64_t f_imagetypes() { @@ -3454,7 +3454,7 @@ Variant f_imagecreatefromstring(CStrRef data) { raise_warning("Couldn't create GD Image Stream out of Data"); return false; } - return Object(new Image(im)); + return Resource(new Image(im)); #else throw NotSupportedException(__func__, "HAVE_LIBGD15 undefined"); #endif @@ -3467,7 +3467,7 @@ Variant f_imagecreatefromgif(CStrRef filename) { PHP_GDIMG_TYPE_GIF, "GIF", (gdImagePtr(*)())gdImageCreateFromGif, (gdImagePtr(*)())gdImageCreateFromGifCtx); - return Object(new Image(im)); + return Resource(new Image(im)); #else throw NotSupportedException(__func__, "HAVE_GD_GIF_READ undefined"); #endif @@ -3480,7 +3480,7 @@ Variant f_imagecreatefromjpeg(CStrRef filename) { PHP_GDIMG_TYPE_JPG, "JPEG", (gdImagePtr(*)())gdImageCreateFromJpeg, (gdImagePtr(*)())gdImageCreateFromJpegCtx); - return Object(new Image(im)); + return Resource(new Image(im)); #else throw NotSupportedException(__func__, "HAVE_GD_JPG undefined"); #endif @@ -3493,7 +3493,7 @@ Variant f_imagecreatefrompng(CStrRef filename) { PHP_GDIMG_TYPE_PNG, "PNG", (gdImagePtr(*)())gdImageCreateFromPng, (gdImagePtr(*)())gdImageCreateFromPngCtx); - return Object(new Image(im)); + return Resource(new Image(im)); #else throw NotSupportedException(__func__, "HAVE_GD_PNG undefined"); #endif @@ -3506,7 +3506,7 @@ Variant f_imagecreatefromxbm(CStrRef filename) { PHP_GDIMG_TYPE_XBM, "XBM", (gdImagePtr(*)())gdImageCreateFromXbm, (gdImagePtr(*)())NULL); - return Object(new Image(im)); + return Resource(new Image(im)); #else throw NotSupportedException(__func__, "HAVE_GD_XBM undefined"); #endif @@ -3519,7 +3519,7 @@ Variant f_imagecreatefromxpm(CStrRef filename) { PHP_GDIMG_TYPE_XPM, "XPM", (gdImagePtr(*)())gdImageCreateFromXpm, (gdImagePtr(*)())NULL); - return Object(new Image(im)); + return Resource(new Image(im)); #else throw NotSupportedException(__func__, "HAVE_GD_XPM or HAVE_GD_BUNDLED undefined"); @@ -3533,7 +3533,7 @@ Variant f_imagecreatefromwbmp(CStrRef filename) { PHP_GDIMG_TYPE_WBM, "WBMP", (gdImagePtr(*)())gdImageCreateFromWBMP, (gdImagePtr(*)())gdImageCreateFromWBMPCtx); - return Object(new Image(im)); + return Resource(new Image(im)); #else throw NotSupportedException(__func__, "HAVE_GD_WBMP undefined"); #endif @@ -3545,7 +3545,7 @@ Variant f_imagecreatefromgd(CStrRef filename) { PHP_GDIMG_TYPE_GD, "GD", (gdImagePtr(*)())gdImageCreateFromGd, (gdImagePtr(*)())gdImageCreateFromGdCtx); - return Object(new Image(im)); + return Resource(new Image(im)); } Variant f_imagecreatefromgd2(CStrRef filename) { @@ -3554,7 +3554,7 @@ Variant f_imagecreatefromgd2(CStrRef filename) { PHP_GDIMG_TYPE_GD2, "GD2", (gdImagePtr(*)())gdImageCreateFromGd2, (gdImagePtr(*)())gdImageCreateFromGd2Ctx); - return Object(new Image(im)); + return Resource(new Image(im)); } Variant f_imagecreatefromgd2part(CStrRef filename, @@ -3564,15 +3564,15 @@ Variant f_imagecreatefromgd2part(CStrRef filename, PHP_GDIMG_TYPE_GD2PART, "GD2", (gdImagePtr(*)())gdImageCreateFromGd2Part, (gdImagePtr(*)())gdImageCreateFromGd2PartCtx); - return Object(new Image(im)); + return Resource(new Image(im)); } -bool f_imagexbm(CObjRef image, CStrRef filename /* = null_string */, +bool f_imagexbm(CResRef image, CStrRef filename /* = null_string */, int foreground /* = -1 */) { throw NotSupportedException(__func__, "gdImageXbmCtx does not exist"); } -bool f_imagegif(CObjRef image, CStrRef filename /* = null_string */) { +bool f_imagegif(CResRef image, CStrRef filename /* = null_string */) { #ifdef HAVE_GD_GIF_CTX return _php_image_output_ctx(image, filename, -1, -1, PHP_GDIMG_TYPE_GIF, "GIF", @@ -3584,7 +3584,7 @@ bool f_imagegif(CObjRef image, CStrRef filename /* = null_string */) { #endif } -bool f_imagepng(CObjRef image, CStrRef filename /* = null_string */, +bool f_imagepng(CResRef image, CStrRef filename /* = null_string */, int quality /* = -1 */, int filters /* = -1 */) { #ifdef HAVE_GD_PNG #ifdef USE_GD_IOCTX @@ -3601,7 +3601,7 @@ bool f_imagepng(CObjRef image, CStrRef filename /* = null_string */, #endif } -bool f_imagejpeg(CObjRef image, CStrRef filename /* = null_string */, +bool f_imagejpeg(CResRef image, CStrRef filename /* = null_string */, int quality /* = -1 */) { #ifdef HAVE_GD_JPG #ifdef USE_GD_IOCTX @@ -3618,7 +3618,7 @@ bool f_imagejpeg(CObjRef image, CStrRef filename /* = null_string */, #endif } -bool f_imagewbmp(CObjRef image, CStrRef filename /* = null_string */, +bool f_imagewbmp(CResRef image, CStrRef filename /* = null_string */, int foreground /* = -1 */) { #ifdef USE_GD_IOCTX return _php_image_output_ctx(image, filename, foreground, -1, @@ -3631,19 +3631,19 @@ bool f_imagewbmp(CObjRef image, CStrRef filename /* = null_string */, #endif } -bool f_imagegd(CObjRef image, CStrRef filename /* = null_string */) { +bool f_imagegd(CResRef image, CStrRef filename /* = null_string */) { return _php_image_output(image, filename, -1, -1, PHP_GDIMG_TYPE_GD, "GD", (void (*)())gdImageGd); } -bool f_imagegd2(CObjRef image, CStrRef filename /* = null_string */, +bool f_imagegd2(CResRef image, CStrRef filename /* = null_string */, int chunk_size /* = 0 */, int type /* = 0 */) { return _php_image_output(image, filename, chunk_size, type, PHP_GDIMG_TYPE_GD2, "GD2", (void (*)())gdImageGd2); } -bool f_imagedestroy(CObjRef image) { +bool f_imagedestroy(CResRef image) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; gdImageDestroy(im); @@ -3651,7 +3651,7 @@ bool f_imagedestroy(CObjRef image) { return true; } -Variant f_imagecolorallocate(CObjRef image, int red, int green, int blue) { +Variant f_imagecolorallocate(CResRef image, int red, int green, int blue) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; int ct = gdImageColorAllocate(im, red, green, blue); @@ -3661,7 +3661,7 @@ Variant f_imagecolorallocate(CObjRef image, int red, int green, int blue) { return ct; } -void f_imagepalettecopy(CObjRef destination, CObjRef source) { +void f_imagepalettecopy(CResRef destination, CResRef source) { /* gdImagePtr dstim = destination.getTyped()->get(); if (!dstim) return false; @@ -3672,7 +3672,7 @@ void f_imagepalettecopy(CObjRef destination, CObjRef source) { */ } -Variant f_imagecolorat(CObjRef image, int x, int y) { +Variant f_imagecolorat(CResRef image, int x, int y) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; #if HAVE_LIBGD20 @@ -3700,19 +3700,19 @@ Variant f_imagecolorat(CObjRef image, int x, int y) { #endif } -Variant f_imagecolorclosest(CObjRef image, int red, int green, int blue) { +Variant f_imagecolorclosest(CResRef image, int red, int green, int blue) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; return gdImageColorClosest(im, red, green, blue); } -Variant f_imagecolorclosesthwb(CObjRef image, int red, int green, int blue) { +Variant f_imagecolorclosesthwb(CResRef image, int red, int green, int blue) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; return gdImageColorClosestHWB(im, red, green, blue); } -bool f_imagecolordeallocate(CObjRef image, int color) { +bool f_imagecolordeallocate(CResRef image, int color) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; #if HAVE_LIBGD20 @@ -3730,19 +3730,19 @@ bool f_imagecolordeallocate(CObjRef image, int color) { } } -Variant f_imagecolorresolve(CObjRef image, int red, int green, int blue) { +Variant f_imagecolorresolve(CResRef image, int red, int green, int blue) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; return gdImageColorResolve(im, red, green, blue); } -Variant f_imagecolorexact(CObjRef image, int red, int green, int blue) { +Variant f_imagecolorexact(CResRef image, int red, int green, int blue) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; return gdImageColorExact(im, red, green, blue); } -Variant f_imagecolorset(CObjRef image, int index, +Variant f_imagecolorset(CResRef image, int index, int red, int green, int blue) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3762,7 +3762,7 @@ const StaticString s_blue("blue"), s_alpha("alpha"); -Variant f_imagecolorsforindex(CObjRef image, int index) { +Variant f_imagecolorsforindex(CResRef image, int index) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; #if HAVE_LIBGD20 @@ -3789,7 +3789,7 @@ Variant f_imagecolorsforindex(CObjRef image, int index) { return false; } -bool f_imagegammacorrect(CObjRef image, double inputgamma, +bool f_imagegammacorrect(CResRef image, double inputgamma, double outputgamma) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3824,14 +3824,14 @@ bool f_imagegammacorrect(CObjRef image, double inputgamma, return true; } -bool f_imagesetpixel(CObjRef image, int x, int y, int color) { +bool f_imagesetpixel(CResRef image, int x, int y, int color) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; gdImageSetPixel(im, x, y, color); return true; } -bool f_imageline(CObjRef image, int x1, int y1, int x2, int y2, int color) { +bool f_imageline(CResRef image, int x1, int y1, int x2, int y2, int color) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; color = SetupAntiAliasedColor(im, color); @@ -3839,7 +3839,7 @@ bool f_imageline(CObjRef image, int x1, int y1, int x2, int y2, int color) { return true; } -bool f_imagedashedline(CObjRef image, int x1, int y1, int x2, int y2, +bool f_imagedashedline(CResRef image, int x1, int y1, int x2, int y2, int color) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3847,7 +3847,7 @@ bool f_imagedashedline(CObjRef image, int x1, int y1, int x2, int y2, return true; } -bool f_imagerectangle(CObjRef image, int x1, int y1, +bool f_imagerectangle(CResRef image, int x1, int y1, int x2, int y2, int color) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3855,7 +3855,7 @@ bool f_imagerectangle(CObjRef image, int x1, int y1, return true; } -bool f_imagefilledrectangle(CObjRef image, int x1, int y1, +bool f_imagefilledrectangle(CResRef image, int x1, int y1, int x2, int y2, int color) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3863,7 +3863,7 @@ bool f_imagefilledrectangle(CObjRef image, int x1, int y1, return true; } -bool f_imagearc(CObjRef image, int cx, int cy, int width, int height, +bool f_imagearc(CResRef image, int cx, int cy, int width, int height, int start, int end, int color) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3874,7 +3874,7 @@ bool f_imagearc(CObjRef image, int cx, int cy, int width, int height, return true; } -bool f_imageellipse(CObjRef image, int cx, int cy, int width, int height, +bool f_imageellipse(CResRef image, int cx, int cy, int width, int height, int color) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3883,7 +3883,7 @@ bool f_imageellipse(CObjRef image, int cx, int cy, int width, int height, return true; } -bool f_imagefilltoborder(CObjRef image, int x, int y, +bool f_imagefilltoborder(CResRef image, int x, int y, int border, int color) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; @@ -3891,20 +3891,20 @@ bool f_imagefilltoborder(CObjRef image, int x, int y, return true; } -bool f_imagefill(CObjRef image, int x, int y, int color) { +bool f_imagefill(CResRef image, int x, int y, int color) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; gdImageFill(im, x, y, color); return true; } -Variant f_imagecolorstotal(CObjRef image) { +Variant f_imagecolorstotal(CResRef image) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; return (gdImageColorsTotal(im)); } -Variant f_imagecolortransparent(CObjRef image, int color /* = -1 */) { +Variant f_imagecolortransparent(CResRef image, int color /* = -1 */) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; if (color != -1) { @@ -3914,7 +3914,7 @@ Variant f_imagecolortransparent(CObjRef image, int color /* = -1 */) { return gdImageGetTransparent(im); } -Variant f_imageinterlace(CObjRef image, int interlace /* = 0 */) { +Variant f_imageinterlace(CResRef image, int interlace /* = 0 */) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; if (interlace != 0) { @@ -3924,12 +3924,12 @@ Variant f_imageinterlace(CObjRef image, int interlace /* = 0 */) { return gdImageGetInterlaced(im); } -bool f_imagepolygon(CObjRef image, CArrRef points, +bool f_imagepolygon(CResRef image, CArrRef points, int num_points, int color) { return php_imagepolygon(image, points, num_points, color, 0); } -bool f_imagefilledpolygon(CObjRef image, CArrRef points, int num_points, +bool f_imagefilledpolygon(CResRef image, CArrRef points, int num_points, int color) { return php_imagepolygon(image, points, num_points, color, 1); } @@ -3942,27 +3942,27 @@ int64_t f_imagefontheight(int font) { return php_imagefontsize(font, 1); } -bool f_imagechar(CObjRef image, int font, int x, int y, +bool f_imagechar(CResRef image, int font, int x, int y, CStrRef c, int color) { return php_imagechar(image, font, x, y, c, color, 0); } -bool f_imagecharup(CObjRef image, int font, int x, int y, +bool f_imagecharup(CResRef image, int font, int x, int y, CStrRef c, int color) { return php_imagechar(image, font, x, y, c, color, 1); } -bool f_imagestring(CObjRef image, int font, int x, int y, +bool f_imagestring(CResRef image, int font, int x, int y, CStrRef str, int color) { return php_imagechar(image, font, x, y, str, color, 2); } -bool f_imagestringup(CObjRef image, int font, int x, int y, +bool f_imagestringup(CResRef image, int font, int x, int y, CStrRef str, int color) { return php_imagechar(image, font, x, y, str, color, 3); } -bool f_imagecopy(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, +bool f_imagecopy(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h) { gdImagePtr im_src = src_im.getTyped()->get(); if (!im_src) return false; @@ -3972,7 +3972,7 @@ bool f_imagecopy(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, return true; } -bool f_imagecopymerge(CObjRef dst_im, CObjRef src_im, +bool f_imagecopymerge(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct) { gdImagePtr im_src = src_im.getTyped()->get(); @@ -3988,7 +3988,7 @@ bool f_imagecopymerge(CObjRef dst_im, CObjRef src_im, #endif } -bool f_imagecopymergegray(CObjRef dst_im, CObjRef src_im, +bool f_imagecopymergegray(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct) { @@ -4001,7 +4001,7 @@ bool f_imagecopymergegray(CObjRef dst_im, CObjRef src_im, return true; } -bool f_imagecopyresized(CObjRef dst_im, CObjRef src_im, +bool f_imagecopyresized(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) { gdImagePtr im_src = src_im.getTyped()->get(); @@ -4018,13 +4018,13 @@ bool f_imagecopyresized(CObjRef dst_im, CObjRef src_im, return true; } -Variant f_imagesx(CObjRef image) { +Variant f_imagesx(CResRef image) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; return gdImageSX(im); } -Variant f_imagesy(CObjRef image) { +Variant f_imagesy(CResRef image) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; return gdImageSY(im); @@ -4043,7 +4043,7 @@ Variant f_imageftbbox(double size, double angle, CStrRef font_file, #endif } -Variant f_imagefttext(CObjRef image, double size, double angle, +Variant f_imagefttext(CResRef image, double size, double angle, int x, int y, int col, CStrRef font_file, CStrRef text, CArrRef extrainfo /* = null */) { #if defined(ENABLE_GD_TTF) && HAVE_LIBGD20 && \ @@ -4068,7 +4068,7 @@ Variant f_imagettfbbox(double size, double angle, #endif } -Variant f_imagettftext(CObjRef image, double size, double angle, +Variant f_imagettftext(CResRef image, double size, double angle, int x, int y, int color, CStrRef fontfile, CStrRef text) { #ifdef ENABLE_GD_TTF @@ -4088,7 +4088,7 @@ Object f_imagepsloadfont(CStrRef filename) { #endif } -bool f_imagepsfreefont(CObjRef fontindex) { +bool f_imagepsfreefont(CResRef fontindex) { #ifdef HAVE_LIBT1 #error config error: HAVE_LIBT1 defined! #else @@ -4096,7 +4096,7 @@ bool f_imagepsfreefont(CObjRef fontindex) { #endif } -bool f_imagepsencodefont(CObjRef font_index, CStrRef encodingfile) { +bool f_imagepsencodefont(CResRef font_index, CStrRef encodingfile) { #ifdef HAVE_LIBT1 #error config error: HAVE_LIBT1 defined! #else @@ -4112,7 +4112,7 @@ bool f_imagepsextendfont(int font_index, double extend) { #endif } -bool f_imagepsslantfont(CObjRef font_index, double slant) { +bool f_imagepsslantfont(CResRef font_index, double slant) { #ifdef HAVE_LIBT1 #error config error: HAVE_LIBT1 defined! #else @@ -4120,7 +4120,7 @@ bool f_imagepsslantfont(CObjRef font_index, double slant) { #endif } -Array f_imagepstext(CObjRef image, CStrRef text, CObjRef font, int size, +Array f_imagepstext(CResRef image, CStrRef text, CResRef font, int size, int foreground, int background, int x, int y, int space /* = 0 */, int tightness /* = 0 */, double angle /* = 0.0 */, @@ -4141,7 +4141,7 @@ Array f_imagepsbbox(CStrRef text, int font, int size, int space /* = 0 */, #endif } -bool f_image2wbmp(CObjRef image, CStrRef filename /* = null_string */, +bool f_image2wbmp(CResRef image, CStrRef filename /* = null_string */, int threshold /* = -1 */) { #ifdef HAVE_GD_WBMP return _php_image_output(image, filename, threshold, -1, @@ -4164,10 +4164,10 @@ bool f_png2wbmp(CStrRef pngname, CStrRef wbmpname, int dest_height, threshold, PHP_GDIMG_TYPE_PNG); } -bool f_imagefilter(CObjRef image, int filtertype, +bool f_imagefilter(CResRef image, int filtertype, int arg1 /* = 0 */, int arg2 /* = 0 */, int arg3 /* = 0 */, int arg4 /* = 0 */) { - typedef bool (*image_filter)(CObjRef, int, int, int, int); + typedef bool (*image_filter)(CResRef, int, int, int, int); image_filter filters[] = { php_image_filter_negate , php_image_filter_grayscale, @@ -4259,7 +4259,7 @@ static int gdImageConvolution(gdImagePtr src, float filter[3][3], return 1; } -bool f_imageconvolution(CObjRef image, CArrRef matrix, +bool f_imageconvolution(CResRef image, CArrRef matrix, double div, double offset) { gdImagePtr im_src = image.getTyped()->get(); if (!im_src) return false; @@ -4297,7 +4297,7 @@ bool f_imageconvolution(CObjRef image, CArrRef matrix, } } -bool f_imageantialias(CObjRef image, bool on) { +bool f_imageantialias(CResRef image, bool on) { gdImagePtr im = image.getTyped()->get(); if (!im) return false; SetAntiAliased(im, on); @@ -4405,16 +4405,16 @@ Variant f_iptcembed(CStrRef iptcdata, CStrRef jpeg_file_name, return false; } if (spool < 2) { - Array stat = f_fstat(stream.toObject()).toArray(); + Array stat = f_fstat(stream.toResource()).toArray(); int st_size = stat[s_size].toInt32(); size_t malloc_size = iptcdata_len + sizeof(psheader) + st_size + 1024 + 1; poi = spoolbuf = (unsigned char *)IM_MALLOC(malloc_size); CHECK_ALLOC_R(poi, malloc_size, false); memset(poi, 0, malloc_size); } - File *file = stream.toObject().getTyped(); + File *file = stream.toResource().getTyped(); if (php_iptc_get1(file, spool, poi?&poi:0) != 0xFF) { - f_fclose(stream.toObject()); + f_fclose(stream.toResource()); if (spoolbuf) { IM_FREE(spoolbuf); } @@ -4422,7 +4422,7 @@ Variant f_iptcembed(CStrRef iptcdata, CStrRef jpeg_file_name, } if (php_iptc_get1(file, spool, poi?&poi:0) != 0xD8) { - f_fclose(stream.toObject()); + f_fclose(stream.toResource()); if (spoolbuf) { IM_FREE(spoolbuf); } @@ -4490,7 +4490,7 @@ Variant f_iptcembed(CStrRef iptcdata, CStrRef jpeg_file_name, } } - f_fclose(stream.toObject()); + f_fclose(stream.toResource()); if (spool < 2) { return String((char *)spoolbuf, poi - spoolbuf, AttachString); @@ -7302,7 +7302,7 @@ static int exif_read_file(image_info_type *ImageInfo, String FileName, raise_warning("Unable to open file %s", FileName.c_str()); return 0; } - ImageInfo->infile = stream.toObject().getTyped(); + ImageInfo->infile = stream.toResource().getTyped(); PlainFile *plain_file = dynamic_cast(ImageInfo->infile); if (plain_file) { if (stat(FileName.c_str(), &st) >= 0) { @@ -7317,9 +7317,9 @@ static int exif_read_file(image_info_type *ImageInfo, String FileName, ImageInfo->FileSize = st.st_size; } else { if (!ImageInfo->FileSize) { - f_fseek(stream.toObject(), 0, SEEK_END); + f_fseek(stream.toResource(), 0, SEEK_END); ImageInfo->FileSize = ImageInfo->infile->tell(); - f_fseek(stream.toObject(), 0, SEEK_SET); + f_fseek(stream.toResource(), 0, SEEK_SET); } } @@ -7340,7 +7340,7 @@ static int exif_read_file(image_info_type *ImageInfo, String FileName, /* Scan the JPEG headers. */ ret = exif_scan_FILE_header(ImageInfo); - f_fclose(stream.toObject()); + f_fclose(stream.toResource()); return ret; } @@ -8025,8 +8025,8 @@ Variant f_exif_imagetype(CStrRef filename) { raise_warning("failed to open file: %s", filename.c_str()); return false; } - int itype = php_getimagetype(stream.toObject()); - f_fclose(stream.toObject()); + int itype = php_getimagetype(stream.toResource()); + f_fclose(stream.toResource()); if (itype == IMAGE_FILETYPE_UNKNOWN) return false; return itype; } diff --git a/hphp/runtime/ext/ext_image.h b/hphp/runtime/ext/ext_image.h index 52bbbd9eb..84916ff67 100644 --- a/hphp/runtime/ext/ext_image.h +++ b/hphp/runtime/ext/ext_image.h @@ -35,7 +35,7 @@ struct gfxinfo { class Image : public SweepableResourceData { public: Image() { m_gdImage = NULL;} - Image(gdImagePtr gdImage) { m_gdImage = gdImage;} + explicit Image(gdImagePtr gdImage) { m_gdImage = gdImage;} ~Image(); gdImagePtr get() { return m_gdImage;} void reset() { m_gdImage = NULL;} @@ -53,34 +53,34 @@ Array f_gd_info(); Variant f_getimagesize(CStrRef filename, VRefParam imageinfo = uninit_null()); String f_image_type_to_extension(int imagetype, bool include_dot = true); String f_image_type_to_mime_type(int imagetype); -bool f_image2wbmp(CObjRef image, CStrRef filename = null_string, int threshold = -1); -bool f_imagealphablending(CObjRef image, bool blendmode); -bool f_imageantialias(CObjRef image, bool on); -bool f_imagearc(CObjRef image, int cx, int cy, int width, int height, int start, int end, int color); -bool f_imagechar(CObjRef image, int font, int x, int y, CStrRef c, int color); -bool f_imagecharup(CObjRef image, int font, int x, int y, CStrRef c, int color); -Variant f_imagecolorallocate(CObjRef image, int red, int green, int blue); -Variant f_imagecolorallocatealpha(CObjRef image, int red, int green, int blue, int alpha); -Variant f_imagecolorat(CObjRef image, int x, int y); -Variant f_imagecolorclosest(CObjRef image, int red, int green, int blue); -Variant f_imagecolorclosestalpha(CObjRef image, int red, int green, int blue, int alpha); -Variant f_imagecolorclosesthwb(CObjRef image, int red, int green, int blue); -bool f_imagecolordeallocate(CObjRef image, int color); -Variant f_imagecolorexact(CObjRef image, int red, int green, int blue); -Variant f_imagecolorexactalpha(CObjRef image, int red, int green, int blue, int alpha); -Variant f_imagecolormatch(CObjRef image1, CObjRef image2); -Variant f_imagecolorresolve(CObjRef image, int red, int green, int blue); -Variant f_imagecolorresolvealpha(CObjRef image, int red, int green, int blue, int alpha); -Variant f_imagecolorset(CObjRef image, int index, int red, int green, int blue); -Variant f_imagecolorsforindex(CObjRef image, int index); -Variant f_imagecolorstotal(CObjRef image); -Variant f_imagecolortransparent(CObjRef image, int color = -1); -bool f_imageconvolution(CObjRef image, CArrRef matrix, double div, double offset); -bool f_imagecopy(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h); -bool f_imagecopymerge(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct); -bool f_imagecopymergegray(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct); -bool f_imagecopyresampled(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h); -bool f_imagecopyresized(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h); +bool f_image2wbmp(CResRef image, CStrRef filename = null_string, int threshold = -1); +bool f_imagealphablending(CResRef image, bool blendmode); +bool f_imageantialias(CResRef image, bool on); +bool f_imagearc(CResRef image, int cx, int cy, int width, int height, int start, int end, int color); +bool f_imagechar(CResRef image, int font, int x, int y, CStrRef c, int color); +bool f_imagecharup(CResRef image, int font, int x, int y, CStrRef c, int color); +Variant f_imagecolorallocate(CResRef image, int red, int green, int blue); +Variant f_imagecolorallocatealpha(CResRef image, int red, int green, int blue, int alpha); +Variant f_imagecolorat(CResRef image, int x, int y); +Variant f_imagecolorclosest(CResRef image, int red, int green, int blue); +Variant f_imagecolorclosestalpha(CResRef image, int red, int green, int blue, int alpha); +Variant f_imagecolorclosesthwb(CResRef image, int red, int green, int blue); +bool f_imagecolordeallocate(CResRef image, int color); +Variant f_imagecolorexact(CResRef image, int red, int green, int blue); +Variant f_imagecolorexactalpha(CResRef image, int red, int green, int blue, int alpha); +Variant f_imagecolormatch(CResRef image1, CResRef image2); +Variant f_imagecolorresolve(CResRef image, int red, int green, int blue); +Variant f_imagecolorresolvealpha(CResRef image, int red, int green, int blue, int alpha); +Variant f_imagecolorset(CResRef image, int index, int red, int green, int blue); +Variant f_imagecolorsforindex(CResRef image, int index); +Variant f_imagecolorstotal(CResRef image); +Variant f_imagecolortransparent(CResRef image, int color = -1); +bool f_imageconvolution(CResRef image, CArrRef matrix, double div, double offset); +bool f_imagecopy(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h); +bool f_imagecopymerge(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct); +bool f_imagecopymergegray(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct); +bool f_imagecopyresampled(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h); +bool f_imagecopyresized(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h); Variant f_imagecreate(int width, int height); Variant f_imagecreatefromgd2part(CStrRef filename, int srcx, int srcy, int width, int height); Variant f_imagecreatefromgd(CStrRef filename); @@ -93,60 +93,60 @@ Variant f_imagecreatefromwbmp(CStrRef filename); Variant f_imagecreatefromxbm(CStrRef filename); Variant f_imagecreatefromxpm(CStrRef filename); Variant f_imagecreatetruecolor(int width, int height); -bool f_imagedashedline(CObjRef image, int x1, int y1, int x2, int y2, int color); -bool f_imagedestroy(CObjRef image); -bool f_imageellipse(CObjRef image, int cx, int cy, int width, int height, int color); -bool f_imagefill(CObjRef image, int x, int y, int color); -bool f_imagefilledarc(CObjRef image, int cx, int cy, int width, int height, int start, int end, int color, int style); -bool f_imagefilledellipse(CObjRef image, int cx, int cy, int width, int height, int color); -bool f_imagefilledpolygon(CObjRef image, CArrRef points, int num_points, int color); -bool f_imagefilledrectangle(CObjRef image, int x1, int y1, int x2, int y2, int color); -bool f_imagefilltoborder(CObjRef image, int x, int y, int border, int color); -bool f_imagefilter(CObjRef image, int filtertype, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0); +bool f_imagedashedline(CResRef image, int x1, int y1, int x2, int y2, int color); +bool f_imagedestroy(CResRef image); +bool f_imageellipse(CResRef image, int cx, int cy, int width, int height, int color); +bool f_imagefill(CResRef image, int x, int y, int color); +bool f_imagefilledarc(CResRef image, int cx, int cy, int width, int height, int start, int end, int color, int style); +bool f_imagefilledellipse(CResRef image, int cx, int cy, int width, int height, int color); +bool f_imagefilledpolygon(CResRef image, CArrRef points, int num_points, int color); +bool f_imagefilledrectangle(CResRef image, int x1, int y1, int x2, int y2, int color); +bool f_imagefilltoborder(CResRef image, int x, int y, int border, int color); +bool f_imagefilter(CResRef image, int filtertype, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0); int64_t f_imagefontheight(int font); int64_t f_imagefontwidth(int font); Variant f_imageftbbox(double size, double angle, CStrRef font_file, CStrRef text, CArrRef extrainfo = Array()); -Variant f_imagefttext(CObjRef image, double size, double angle, int x, int y, int col, CStrRef font_file, CStrRef text, CArrRef extrainfo = Array()); -bool f_imagegammacorrect(CObjRef image, double inputgamma, double outputgamma); -bool f_imagegd2(CObjRef image, CStrRef filename = null_string, int chunk_size = 0, int type = 0); -bool f_imagegd(CObjRef image, CStrRef filename = null_string); -bool f_imagegif(CObjRef image, CStrRef filename = null_string); +Variant f_imagefttext(CResRef image, double size, double angle, int x, int y, int col, CStrRef font_file, CStrRef text, CArrRef extrainfo = Array()); +bool f_imagegammacorrect(CResRef image, double inputgamma, double outputgamma); +bool f_imagegd2(CResRef image, CStrRef filename = null_string, int chunk_size = 0, int type = 0); +bool f_imagegd(CResRef image, CStrRef filename = null_string); +bool f_imagegif(CResRef image, CStrRef filename = null_string); Variant f_imagegrabscreen(); Variant f_imagegrabwindow(int window, int client_area = 0); -Variant f_imageinterlace(CObjRef image, int interlace = 0); -bool f_imageistruecolor(CObjRef image); -bool f_imagejpeg(CObjRef image, CStrRef filename = null_string, int quality = -1); -bool f_imagelayereffect(CObjRef image, int effect); -bool f_imageline(CObjRef image, int x1, int y1, int x2, int y2, int color); +Variant f_imageinterlace(CResRef image, int interlace = 0); +bool f_imageistruecolor(CResRef image); +bool f_imagejpeg(CResRef image, CStrRef filename = null_string, int quality = -1); +bool f_imagelayereffect(CResRef image, int effect); +bool f_imageline(CResRef image, int x1, int y1, int x2, int y2, int color); Variant f_imageloadfont(CStrRef file); -void f_imagepalettecopy(CObjRef destination, CObjRef source); -bool f_imagepng(CObjRef image, CStrRef filename = null_string, int quality = -1, int filters = -1); -bool f_imagepolygon(CObjRef image, CArrRef points, int num_points, int color); +void f_imagepalettecopy(CResRef destination, CResRef source); +bool f_imagepng(CResRef image, CStrRef filename = null_string, int quality = -1, int filters = -1); +bool f_imagepolygon(CResRef image, CArrRef points, int num_points, int color); Array f_imagepsbbox(CStrRef text, int font, int size, int space = 0, int tightness = 0, double angle = 0.0); -bool f_imagepsencodefont(CObjRef font_index, CStrRef encodingfile); +bool f_imagepsencodefont(CResRef font_index, CStrRef encodingfile); bool f_imagepsextendfont(int font_index, double extend); -bool f_imagepsfreefont(CObjRef fontindex); +bool f_imagepsfreefont(CResRef fontindex); Object f_imagepsloadfont(CStrRef filename); -bool f_imagepsslantfont(CObjRef font_index, double slant); -Array f_imagepstext(CObjRef image, CStrRef text, CObjRef font, int size, int foreground, int background, int x, int y, int space = 0, int tightness = 0, double angle = 0.0, int antialias_steps = 0); -bool f_imagerectangle(CObjRef image, int x1, int y1, int x2, int y2, int color); -Variant f_imagerotate(CObjRef source_image, double angle, int bgd_color, int ignore_transparent = 0); -bool f_imagesavealpha(CObjRef image, bool saveflag); -bool f_imagesetbrush(CObjRef image, CObjRef brush); -bool f_imagesetpixel(CObjRef image, int x, int y, int color); -bool f_imagesetstyle(CObjRef image, CArrRef style); -bool f_imagesetthickness(CObjRef image, int thickness); -bool f_imagesettile(CObjRef image, CObjRef tile); -bool f_imagestring(CObjRef image, int font, int x, int y, CStrRef str, int color); -bool f_imagestringup(CObjRef image, int font, int x, int y, CStrRef str, int color); -Variant f_imagesx(CObjRef image); -Variant f_imagesy(CObjRef image); -Variant f_imagetruecolortopalette(CObjRef image, bool dither, int ncolors); +bool f_imagepsslantfont(CResRef font_index, double slant); +Array f_imagepstext(CResRef image, CStrRef text, CResRef font, int size, int foreground, int background, int x, int y, int space = 0, int tightness = 0, double angle = 0.0, int antialias_steps = 0); +bool f_imagerectangle(CResRef image, int x1, int y1, int x2, int y2, int color); +Variant f_imagerotate(CResRef source_image, double angle, int bgd_color, int ignore_transparent = 0); +bool f_imagesavealpha(CResRef image, bool saveflag); +bool f_imagesetbrush(CResRef image, CResRef brush); +bool f_imagesetpixel(CResRef image, int x, int y, int color); +bool f_imagesetstyle(CResRef image, CArrRef style); +bool f_imagesetthickness(CResRef image, int thickness); +bool f_imagesettile(CResRef image, CResRef tile); +bool f_imagestring(CResRef image, int font, int x, int y, CStrRef str, int color); +bool f_imagestringup(CResRef image, int font, int x, int y, CStrRef str, int color); +Variant f_imagesx(CResRef image); +Variant f_imagesy(CResRef image); +Variant f_imagetruecolortopalette(CResRef image, bool dither, int ncolors); Variant f_imagettfbbox(double size, double angle, CStrRef fontfile, CStrRef text); -Variant f_imagettftext(CObjRef image, double size, double angle, int x, int y, int color, CStrRef fontfile, CStrRef text); +Variant f_imagettftext(CResRef image, double size, double angle, int x, int y, int color, CStrRef fontfile, CStrRef text); int64_t f_imagetypes(); -bool f_imagewbmp(CObjRef image, CStrRef filename = null_string, int foreground = -1); -bool f_imagexbm(CObjRef image, CStrRef filename = null_string, int foreground = -1); +bool f_imagewbmp(CResRef image, CStrRef filename = null_string, int foreground = -1); +bool f_imagexbm(CResRef image, CStrRef filename = null_string, int foreground = -1); Variant f_iptcembed(CStrRef iptcdata, CStrRef jpeg_file_name, int spool = 0); Variant f_iptcparse(CStrRef iptcblock); bool f_jpeg2wbmp(CStrRef jpegname, CStrRef wbmpname, int dest_height, int dest_width, int threshold); diff --git a/hphp/runtime/ext/ext_imap.cpp b/hphp/runtime/ext/ext_imap.cpp index 37e5ea355..7ea2bbcec 100644 --- a/hphp/runtime/ext/ext_imap.cpp +++ b/hphp/runtime/ext/ext_imap.cpp @@ -772,7 +772,7 @@ Variant f_imap_alerts() { return ret; } -bool f_imap_append(CObjRef imap_stream, CStrRef mailbox, CStrRef message, +bool f_imap_append(CResRef imap_stream, CStrRef mailbox, CStrRef message, CStrRef options /* = "" */) { throw NotImplementedException(__func__); } @@ -805,7 +805,7 @@ Variant f_imap_binary(CStrRef str) { return ret; } -Variant f_imap_body(CObjRef imap_stream, int64_t msg_number, +Variant f_imap_body(CResRef imap_stream, int64_t msg_number, int64_t options /* = 0 */) { if (options && ((options & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) { raise_warning("invalid value for the options parameter"); @@ -838,7 +838,7 @@ Variant f_imap_body(CObjRef imap_stream, int64_t msg_number, } } -Variant f_imap_bodystruct(CObjRef imap_stream, int64_t msg_number, +Variant f_imap_bodystruct(CResRef imap_stream, int64_t msg_number, CStrRef section) { ImapStream *obj = imap_stream.getTyped(); if (!obj->checkMsgNumber(msg_number)) { @@ -856,7 +856,7 @@ Variant f_imap_bodystruct(CObjRef imap_stream, int64_t msg_number, return ret; } -Variant f_imap_check(CObjRef imap_stream) { +Variant f_imap_check(CResRef imap_stream) { ImapStream *obj = imap_stream.getTyped(); if (mail_ping(obj->m_stream) == NIL) { return false; @@ -875,7 +875,7 @@ Variant f_imap_check(CObjRef imap_stream) { return false; } -bool f_imap_clearflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag, +bool f_imap_clearflag_full(CResRef imap_stream, CStrRef sequence, CStrRef flag, int64_t options /* = 0 */) { ImapStream *obj = imap_stream.getTyped(); mail_clearflag_full(obj->m_stream, (char *)sequence.data(), @@ -883,7 +883,7 @@ bool f_imap_clearflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag, return true; } -bool f_imap_close(CObjRef imap_stream, int64_t flag /* = 0 */) { +bool f_imap_close(CResRef imap_stream, int64_t flag /* = 0 */) { ImapStream *obj = imap_stream.getTyped(); if (flag) { if (flag != PHP_EXPUNGE) { @@ -897,7 +897,7 @@ bool f_imap_close(CObjRef imap_stream, int64_t flag /* = 0 */) { return true; } -bool f_imap_createmailbox(CObjRef imap_stream, CStrRef mailbox) { +bool f_imap_createmailbox(CResRef imap_stream, CStrRef mailbox) { ImapStream *obj = imap_stream.getTyped(); if (mail_create(obj->m_stream, (char *)mailbox.data()) == T) { return true; @@ -906,7 +906,7 @@ bool f_imap_createmailbox(CObjRef imap_stream, CStrRef mailbox) { } } -bool f_imap_delete(CObjRef imap_stream, CStrRef msg_number, +bool f_imap_delete(CResRef imap_stream, CStrRef msg_number, int64_t options /* = 0 */) { ImapStream *obj = imap_stream.getTyped(); mail_setflag_full(obj->m_stream, (char *)msg_number.data(), @@ -915,7 +915,7 @@ bool f_imap_delete(CObjRef imap_stream, CStrRef msg_number, return true; } -bool f_imap_deletemailbox(CObjRef imap_stream, CStrRef mailbox) { +bool f_imap_deletemailbox(CResRef imap_stream, CStrRef mailbox) { ImapStream *obj = imap_stream.getTyped(); if (mail_delete(obj->m_stream, (char *)mailbox.data()) == T) { return true; @@ -939,13 +939,13 @@ Variant f_imap_errors() { return ret; } -bool f_imap_expunge(CObjRef imap_stream) { +bool f_imap_expunge(CResRef imap_stream) { ImapStream *obj = imap_stream.getTyped(); mail_expunge(obj->m_stream); return true; } -Variant f_imap_fetch_overview(CObjRef imap_stream, CStrRef sequence, +Variant f_imap_fetch_overview(CResRef imap_stream, CStrRef sequence, int64_t options /* = 0 */) { if (options && options != FT_UID) { Logger::Warning("invalid value for the options parameter"); @@ -1008,7 +1008,7 @@ Variant f_imap_fetch_overview(CObjRef imap_stream, CStrRef sequence, return ret; } -Variant f_imap_fetchbody(CObjRef imap_stream, int64_t msg_number, +Variant f_imap_fetchbody(CResRef imap_stream, int64_t msg_number, CStrRef section, int64_t options /* = 0 */) { if (options && ((options & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) { raise_warning("invalid value for the options parameter"); @@ -1036,7 +1036,7 @@ Variant f_imap_fetchbody(CObjRef imap_stream, int64_t msg_number, return String(body, len, CopyString); } -Variant f_imap_fetchheader(CObjRef imap_stream, int64_t msg_number, +Variant f_imap_fetchheader(CResRef imap_stream, int64_t msg_number, int64_t options /* = 0 */) { if (options && ((options & ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) { Logger::Warning("invalid value for the options parameter"); @@ -1062,7 +1062,7 @@ Variant f_imap_fetchheader(CObjRef imap_stream, int64_t msg_number, (options ? options : NIL)), CopyString); } -Variant f_imap_fetchstructure(CObjRef imap_stream, int64_t msg_number, +Variant f_imap_fetchstructure(CResRef imap_stream, int64_t msg_number, int64_t options /* = 0 */) { if (options && ((options & ~FT_UID) != 0)) { raise_warning("invalid value for the options parameter"); @@ -1104,7 +1104,7 @@ Variant f_imap_fetchstructure(CObjRef imap_stream, int64_t msg_number, return ret; } -bool f_imap_gc(CObjRef imap_stream, int64_t caches) { +bool f_imap_gc(CResRef imap_stream, int64_t caches) { if (caches && ((caches & ~(GC_TEXTS | GC_ELT | GC_ENV)) != 0)) { raise_warning("invalid value for the caches parameter"); return false; @@ -1115,29 +1115,29 @@ bool f_imap_gc(CObjRef imap_stream, int64_t caches) { return true; } -Variant f_imap_get_quota(CObjRef imap_stream, CStrRef quota_root) { +Variant f_imap_get_quota(CResRef imap_stream, CStrRef quota_root) { throw NotImplementedException(__func__); } -Variant f_imap_get_quotaroot(CObjRef imap_stream, CStrRef quota_root) { +Variant f_imap_get_quotaroot(CResRef imap_stream, CStrRef quota_root) { throw NotImplementedException(__func__); } -Variant f_imap_getacl(CObjRef imap_stream, CStrRef mailbox) { +Variant f_imap_getacl(CResRef imap_stream, CStrRef mailbox) { throw NotImplementedException(__func__); } -Variant f_imap_getmailboxes(CObjRef imap_stream, CStrRef ref, +Variant f_imap_getmailboxes(CResRef imap_stream, CStrRef ref, CStrRef pattern) { throw NotImplementedException(__func__); } -Variant f_imap_getsubscribed(CObjRef imap_stream, CStrRef ref, +Variant f_imap_getsubscribed(CResRef imap_stream, CStrRef ref, CStrRef pattern) { throw NotImplementedException(__func__); } -Variant f_imap_header(CObjRef imap_stream, int64_t msg_number, +Variant f_imap_header(CResRef imap_stream, int64_t msg_number, int64_t fromlength /* = 0 */, int64_t subjectlength /* = 0 */, CStrRef defaulthost /* = "" */) { @@ -1145,7 +1145,7 @@ Variant f_imap_header(CObjRef imap_stream, int64_t msg_number, fromlength, subjectlength, defaulthost); } -Variant f_imap_headerinfo(CObjRef imap_stream, int64_t msg_number, +Variant f_imap_headerinfo(CResRef imap_stream, int64_t msg_number, int64_t fromlength /* = 0 */, int64_t subjectlength /* = 0 */, CStrRef defaulthost /* = "" */) { @@ -1207,7 +1207,7 @@ Variant f_imap_headerinfo(CObjRef imap_stream, int64_t msg_number, return ret; } -Variant f_imap_headers(CObjRef imap_stream) { +Variant f_imap_headers(CResRef imap_stream) { throw NotImplementedException(__func__); } @@ -1224,7 +1224,7 @@ Variant f_imap_last_error() { return uninit_null(); } -Variant f_imap_list(CObjRef imap_stream, CStrRef ref, CStrRef pattern) { +Variant f_imap_list(CResRef imap_stream, CStrRef ref, CStrRef pattern) { ImapStream *obj = imap_stream.getTyped(); /* set flag for normal, old mailbox list */ @@ -1245,21 +1245,21 @@ Variant f_imap_list(CObjRef imap_stream, CStrRef ref, CStrRef pattern) { return ret; } -Variant f_imap_listmailbox(CObjRef imap_stream, CStrRef ref, CStrRef pattern) { +Variant f_imap_listmailbox(CResRef imap_stream, CStrRef ref, CStrRef pattern) { return f_imap_list(imap_stream, ref, pattern); } -Variant f_imap_listscan(CObjRef imap_stream, CStrRef ref, CStrRef pattern, +Variant f_imap_listscan(CResRef imap_stream, CStrRef ref, CStrRef pattern, CStrRef content) { throw NotImplementedException(__func__); } -Variant f_imap_listsubscribed(CObjRef imap_stream, CStrRef ref, +Variant f_imap_listsubscribed(CResRef imap_stream, CStrRef ref, CStrRef pattern) { throw NotImplementedException(__func__); } -Variant f_imap_lsub(CObjRef imap_stream, CStrRef ref, CStrRef pattern) { +Variant f_imap_lsub(CResRef imap_stream, CStrRef ref, CStrRef pattern) { throw NotImplementedException(__func__); } @@ -1267,7 +1267,7 @@ Variant f_imap_mail_compose(CArrRef envelope, CArrRef body) { throw NotImplementedException(__func__); } -bool f_imap_mail_copy(CObjRef imap_stream, CStrRef msglist, CStrRef mailbox, +bool f_imap_mail_copy(CResRef imap_stream, CStrRef msglist, CStrRef mailbox, int64_t options /* = 0 */) { ImapStream *obj = imap_stream.getTyped(); if (mail_copy_full(obj->m_stream, (char *)msglist.data(), @@ -1278,7 +1278,7 @@ bool f_imap_mail_copy(CObjRef imap_stream, CStrRef msglist, CStrRef mailbox, } } -bool f_imap_mail_move(CObjRef imap_stream, CStrRef msglist, CStrRef mailbox, +bool f_imap_mail_move(CResRef imap_stream, CStrRef msglist, CStrRef mailbox, int64_t options /* = 0 */) { ImapStream *obj = imap_stream.getTyped(); if (mail_copy_full(obj->m_stream, (char *)msglist.data(), @@ -1340,7 +1340,7 @@ bool f_imap_mail(CStrRef to, CStrRef subject, CStrRef message, } } -Variant f_imap_mailboxmsginfo(CObjRef imap_stream) { +Variant f_imap_mailboxmsginfo(CResRef imap_stream) { ImapStream *obj = imap_stream.getTyped(); Object ret(SystemLib::AllocStdClassObject()); @@ -1379,16 +1379,16 @@ Variant f_imap_mime_header_decode(CStrRef text) { throw NotImplementedException(__func__); } -Variant f_imap_msgno(CObjRef imap_stream, int64_t uid) { +Variant f_imap_msgno(CResRef imap_stream, int64_t uid) { ImapStream *obj = imap_stream.getTyped(); return (int64_t)mail_msgno(obj->m_stream, uid); } -Variant f_imap_num_msg(CObjRef imap_stream) { +Variant f_imap_num_msg(CResRef imap_stream) { return (int64_t)imap_stream.getTyped()->m_stream->nmsgs; } -Variant f_imap_num_recent(CObjRef imap_stream) { +Variant f_imap_num_recent(CResRef imap_stream) { ImapStream *obj = imap_stream.getTyped(); return (int64_t)obj->m_stream->recent; } @@ -1423,7 +1423,7 @@ Variant f_imap_open(CStrRef mailbox, CStrRef username, CStrRef password, return NEWOBJ(ImapStream)(stream, (options & PHP_EXPUNGE) ? CL_EXPUNGE : NIL); } -bool f_imap_ping(CObjRef imap_stream) { +bool f_imap_ping(CResRef imap_stream) { ImapStream *obj = imap_stream.getTyped(); return mail_ping(obj->m_stream); } @@ -1442,7 +1442,7 @@ Variant f_imap_qprint(CStrRef str) { return ret; } -bool f_imap_renamemailbox(CObjRef imap_stream, CStrRef old_mbox, +bool f_imap_renamemailbox(CResRef imap_stream, CStrRef old_mbox, CStrRef new_mbox) { ImapStream *obj = imap_stream.getTyped(); if (mail_rename(obj->m_stream, (char *)old_mbox.data(), @@ -1453,7 +1453,7 @@ bool f_imap_renamemailbox(CObjRef imap_stream, CStrRef old_mbox, } } -bool f_imap_reopen(CObjRef imap_stream, CStrRef mailbox, +bool f_imap_reopen(CResRef imap_stream, CStrRef mailbox, int64_t options /* = 0 */, int64_t retries /* = 0 */) { ImapStream *obj = imap_stream.getTyped(); long flags = NIL; @@ -1494,17 +1494,17 @@ Variant f_imap_rfc822_write_address(CStrRef mailbox, CStrRef host, throw NotImplementedException(__func__); } -bool f_imap_savebody(CObjRef imap_stream, CVarRef file, int64_t msg_number, +bool f_imap_savebody(CResRef imap_stream, CVarRef file, int64_t msg_number, CStrRef part_number /* = "" */, int64_t options /* = 0 */) { throw NotImplementedException(__func__); } -Variant f_imap_scanmailbox(CObjRef imap_stream, CStrRef ref, CStrRef pattern, +Variant f_imap_scanmailbox(CResRef imap_stream, CStrRef ref, CStrRef pattern, CStrRef content) { throw NotImplementedException(__func__); } -Variant f_imap_search(CObjRef imap_stream, CStrRef criteria, +Variant f_imap_search(CResRef imap_stream, CStrRef criteria, int64_t options /* = 0 */, CStrRef charset /* = "" */) { ImapStream *obj = imap_stream.getTyped(); @@ -1537,17 +1537,17 @@ Variant f_imap_search(CObjRef imap_stream, CStrRef criteria, return ret; } -bool f_imap_set_quota(CObjRef imap_stream, CStrRef quota_root, +bool f_imap_set_quota(CResRef imap_stream, CStrRef quota_root, int64_t quota_limit) { throw NotImplementedException(__func__); } -bool f_imap_setacl(CObjRef imap_stream, CStrRef mailbox, CStrRef id, +bool f_imap_setacl(CResRef imap_stream, CStrRef mailbox, CStrRef id, CStrRef rights) { throw NotImplementedException(__func__); } -bool f_imap_setflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag, +bool f_imap_setflag_full(CResRef imap_stream, CStrRef sequence, CStrRef flag, int64_t options /* = 0 */) { ImapStream *obj = imap_stream.getTyped(); mail_setflag_full(obj->m_stream, (char*)sequence.data(), (char*)flag.data(), @@ -1555,14 +1555,14 @@ bool f_imap_setflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag, return true; } -Variant f_imap_sort(CObjRef imap_stream, int64_t criteria, int64_t reverse, +Variant f_imap_sort(CResRef imap_stream, int64_t criteria, int64_t reverse, int64_t options /* = 0 */, CStrRef search_criteria /* = "" */, CStrRef charset /* = "" */) { throw NotImplementedException(__func__); } -Variant f_imap_status(CObjRef imap_stream, CStrRef mailbox, +Variant f_imap_status(CResRef imap_stream, CStrRef mailbox, int64_t options /* = 0 */) { ImapStream *obj = imap_stream.getTyped(); Object ret(SystemLib::AllocStdClassObject()); @@ -1591,7 +1591,7 @@ Variant f_imap_status(CObjRef imap_stream, CStrRef mailbox, return ret; } -bool f_imap_subscribe(CObjRef imap_stream, CStrRef mailbox) { +bool f_imap_subscribe(CResRef imap_stream, CStrRef mailbox) { ImapStream *obj = imap_stream.getTyped(); if (mail_subscribe(obj->m_stream, (char *)mailbox.data()) == T) { return true; @@ -1600,7 +1600,7 @@ bool f_imap_subscribe(CObjRef imap_stream, CStrRef mailbox) { } } -Variant f_imap_thread(CObjRef imap_stream, int64_t options /* = 0 */) { +Variant f_imap_thread(CResRef imap_stream, int64_t options /* = 0 */) { throw NotImplementedException(__func__); } @@ -1649,7 +1649,7 @@ Variant f_imap_timeout(int64_t timeout_type, int64_t timeout /* = -1 */) { return false; } -Variant f_imap_uid(CObjRef imap_stream, int64_t msg_number) { +Variant f_imap_uid(CResRef imap_stream, int64_t msg_number) { ImapStream *obj = imap_stream.getTyped(); if (!obj->checkMsgNumber(msg_number)) { return false; @@ -1657,7 +1657,7 @@ Variant f_imap_uid(CObjRef imap_stream, int64_t msg_number) { return (int64_t)mail_uid(obj->m_stream, msg_number); } -bool f_imap_undelete(CObjRef imap_stream, CStrRef msg_number, +bool f_imap_undelete(CResRef imap_stream, CStrRef msg_number, int64_t flags /* = 0 */) { ImapStream *obj = imap_stream.getTyped(); mail_clearflag_full(obj->m_stream, (char *)msg_number.data(), @@ -1665,7 +1665,7 @@ bool f_imap_undelete(CObjRef imap_stream, CStrRef msg_number, return true; } -bool f_imap_unsubscribe(CObjRef imap_stream, CStrRef mailbox) { +bool f_imap_unsubscribe(CResRef imap_stream, CStrRef mailbox) { ImapStream *obj = imap_stream.getTyped(); if (mail_unsubscribe(obj->m_stream, (char *)mailbox.data()) == T) { return true; diff --git a/hphp/runtime/ext/ext_imap.h b/hphp/runtime/ext/ext_imap.h index 7ce138145..0514fbec6 100644 --- a/hphp/runtime/ext/ext_imap.h +++ b/hphp/runtime/ext/ext_imap.h @@ -27,69 +27,69 @@ namespace HPHP { Variant f_imap_8bit(CStrRef str); Variant f_imap_alerts(); -bool f_imap_append(CObjRef imap_stream, CStrRef mailbox, CStrRef message, CStrRef options = ""); +bool f_imap_append(CResRef imap_stream, CStrRef mailbox, CStrRef message, CStrRef options = ""); Variant f_imap_base64(CStrRef text); Variant f_imap_binary(CStrRef str); -Variant f_imap_body(CObjRef imap_stream, int64_t msg_number, int64_t options = 0); -Variant f_imap_bodystruct(CObjRef imap_stream, int64_t msg_number, CStrRef section); -Variant f_imap_check(CObjRef imap_stream); -bool f_imap_clearflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag, int64_t options = 0); -bool f_imap_close(CObjRef imap_stream, int64_t flag = 0); -bool f_imap_createmailbox(CObjRef imap_stream, CStrRef mailbox); -bool f_imap_delete(CObjRef imap_stream, CStrRef msg_number, int64_t options = 0); -bool f_imap_deletemailbox(CObjRef imap_stream, CStrRef mailbox); +Variant f_imap_body(CResRef imap_stream, int64_t msg_number, int64_t options = 0); +Variant f_imap_bodystruct(CResRef imap_stream, int64_t msg_number, CStrRef section); +Variant f_imap_check(CResRef imap_stream); +bool f_imap_clearflag_full(CResRef imap_stream, CStrRef sequence, CStrRef flag, int64_t options = 0); +bool f_imap_close(CResRef imap_stream, int64_t flag = 0); +bool f_imap_createmailbox(CResRef imap_stream, CStrRef mailbox); +bool f_imap_delete(CResRef imap_stream, CStrRef msg_number, int64_t options = 0); +bool f_imap_deletemailbox(CResRef imap_stream, CStrRef mailbox); Variant f_imap_errors(); -bool f_imap_expunge(CObjRef imap_stream); -Variant f_imap_fetch_overview(CObjRef imap_stream, CStrRef sequence, int64_t options = 0); -Variant f_imap_fetchbody(CObjRef imap_stream, int64_t msg_number, CStrRef section, int64_t options = 0); -Variant f_imap_fetchheader(CObjRef imap_stream, int64_t msg_number, int64_t options = 0); -Variant f_imap_fetchstructure(CObjRef imap_stream, int64_t msg_number, int64_t options = 0); -bool f_imap_gc(CObjRef imap_stream, int64_t caches); -Variant f_imap_get_quota(CObjRef imap_stream, CStrRef quota_root); -Variant f_imap_get_quotaroot(CObjRef imap_stream, CStrRef quota_root); -Variant f_imap_getacl(CObjRef imap_stream, CStrRef mailbox); -Variant f_imap_getmailboxes(CObjRef imap_stream, CStrRef ref, CStrRef pattern); -Variant f_imap_getsubscribed(CObjRef imap_stream, CStrRef ref, CStrRef pattern); -Variant f_imap_header(CObjRef imap_stream, int64_t msg_number, int64_t fromlength = 0, int64_t subjectlength = 0, CStrRef defaulthost = ""); -Variant f_imap_headerinfo(CObjRef imap_stream, int64_t msg_number, int64_t fromlength = 0, int64_t subjectlength = 0, CStrRef defaulthost = ""); -Variant f_imap_headers(CObjRef imap_stream); +bool f_imap_expunge(CResRef imap_stream); +Variant f_imap_fetch_overview(CResRef imap_stream, CStrRef sequence, int64_t options = 0); +Variant f_imap_fetchbody(CResRef imap_stream, int64_t msg_number, CStrRef section, int64_t options = 0); +Variant f_imap_fetchheader(CResRef imap_stream, int64_t msg_number, int64_t options = 0); +Variant f_imap_fetchstructure(CResRef imap_stream, int64_t msg_number, int64_t options = 0); +bool f_imap_gc(CResRef imap_stream, int64_t caches); +Variant f_imap_get_quota(CResRef imap_stream, CStrRef quota_root); +Variant f_imap_get_quotaroot(CResRef imap_stream, CStrRef quota_root); +Variant f_imap_getacl(CResRef imap_stream, CStrRef mailbox); +Variant f_imap_getmailboxes(CResRef imap_stream, CStrRef ref, CStrRef pattern); +Variant f_imap_getsubscribed(CResRef imap_stream, CStrRef ref, CStrRef pattern); +Variant f_imap_header(CResRef imap_stream, int64_t msg_number, int64_t fromlength = 0, int64_t subjectlength = 0, CStrRef defaulthost = ""); +Variant f_imap_headerinfo(CResRef imap_stream, int64_t msg_number, int64_t fromlength = 0, int64_t subjectlength = 0, CStrRef defaulthost = ""); +Variant f_imap_headers(CResRef imap_stream); Variant f_imap_last_error(); -Variant f_imap_list(CObjRef imap_stream, CStrRef ref, CStrRef pattern); -Variant f_imap_listmailbox(CObjRef imap_stream, CStrRef ref, CStrRef pattern); -Variant f_imap_listscan(CObjRef imap_stream, CStrRef ref, CStrRef pattern, CStrRef content); -Variant f_imap_listsubscribed(CObjRef imap_stream, CStrRef ref, CStrRef pattern); -Variant f_imap_lsub(CObjRef imap_stream, CStrRef ref, CStrRef pattern); +Variant f_imap_list(CResRef imap_stream, CStrRef ref, CStrRef pattern); +Variant f_imap_listmailbox(CResRef imap_stream, CStrRef ref, CStrRef pattern); +Variant f_imap_listscan(CResRef imap_stream, CStrRef ref, CStrRef pattern, CStrRef content); +Variant f_imap_listsubscribed(CResRef imap_stream, CStrRef ref, CStrRef pattern); +Variant f_imap_lsub(CResRef imap_stream, CStrRef ref, CStrRef pattern); Variant f_imap_mail_compose(CArrRef envelope, CArrRef body); -bool f_imap_mail_copy(CObjRef imap_stream, CStrRef msglist, CStrRef mailbox, int64_t options = 0); -bool f_imap_mail_move(CObjRef imap_stream, CStrRef msglist, CStrRef mailbox, int64_t options = 0); +bool f_imap_mail_copy(CResRef imap_stream, CStrRef msglist, CStrRef mailbox, int64_t options = 0); +bool f_imap_mail_move(CResRef imap_stream, CStrRef msglist, CStrRef mailbox, int64_t options = 0); bool f_imap_mail(CStrRef to, CStrRef subject, CStrRef message, CStrRef additional_headers = "", CStrRef cc = "", CStrRef bcc = "", CStrRef rpath = ""); -Variant f_imap_mailboxmsginfo(CObjRef imap_stream); +Variant f_imap_mailboxmsginfo(CResRef imap_stream); Variant f_imap_mime_header_decode(CStrRef text); -Variant f_imap_msgno(CObjRef imap_stream, int64_t uid); -Variant f_imap_num_msg(CObjRef imap_stream); -Variant f_imap_num_recent(CObjRef imap_stream); +Variant f_imap_msgno(CResRef imap_stream, int64_t uid); +Variant f_imap_num_msg(CResRef imap_stream); +Variant f_imap_num_recent(CResRef imap_stream); Variant f_imap_open(CStrRef mailbox, CStrRef username, CStrRef password, int64_t options = 0, int64_t retries = 0); -bool f_imap_ping(CObjRef imap_stream); +bool f_imap_ping(CResRef imap_stream); Variant f_imap_qprint(CStrRef str); -bool f_imap_renamemailbox(CObjRef imap_stream, CStrRef old_mbox, CStrRef new_mbox); -bool f_imap_reopen(CObjRef imap_stream, CStrRef mailbox, int64_t options = 0, int64_t retries = 0); +bool f_imap_renamemailbox(CResRef imap_stream, CStrRef old_mbox, CStrRef new_mbox); +bool f_imap_reopen(CResRef imap_stream, CStrRef mailbox, int64_t options = 0, int64_t retries = 0); Variant f_imap_rfc822_parse_adrlist(CStrRef address, CStrRef default_host); Variant f_imap_rfc822_parse_headers(CStrRef headers, CStrRef defaulthost = ""); Variant f_imap_rfc822_write_address(CStrRef mailbox, CStrRef host, CStrRef personal); -bool f_imap_savebody(CObjRef imap_stream, CVarRef file, int64_t msg_number, CStrRef part_number = "", int64_t options = 0); -Variant f_imap_scanmailbox(CObjRef imap_stream, CStrRef ref, CStrRef pattern, CStrRef content); -Variant f_imap_search(CObjRef imap_stream, CStrRef criteria, int64_t options = 0, CStrRef charset = ""); -bool f_imap_set_quota(CObjRef imap_stream, CStrRef quota_root, int64_t quota_limit); -bool f_imap_setacl(CObjRef imap_stream, CStrRef mailbox, CStrRef id, CStrRef rights); -bool f_imap_setflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag, int64_t options = 0); -Variant f_imap_sort(CObjRef imap_stream, int64_t criteria, int64_t reverse, int64_t options = 0, CStrRef search_criteria = "", CStrRef charset = ""); -Variant f_imap_status(CObjRef imap_stream, CStrRef mailbox, int64_t options = 0); -bool f_imap_subscribe(CObjRef imap_stream, CStrRef mailbox); -Variant f_imap_thread(CObjRef imap_stream, int64_t options = 0); +bool f_imap_savebody(CResRef imap_stream, CVarRef file, int64_t msg_number, CStrRef part_number = "", int64_t options = 0); +Variant f_imap_scanmailbox(CResRef imap_stream, CStrRef ref, CStrRef pattern, CStrRef content); +Variant f_imap_search(CResRef imap_stream, CStrRef criteria, int64_t options = 0, CStrRef charset = ""); +bool f_imap_set_quota(CResRef imap_stream, CStrRef quota_root, int64_t quota_limit); +bool f_imap_setacl(CResRef imap_stream, CStrRef mailbox, CStrRef id, CStrRef rights); +bool f_imap_setflag_full(CResRef imap_stream, CStrRef sequence, CStrRef flag, int64_t options = 0); +Variant f_imap_sort(CResRef imap_stream, int64_t criteria, int64_t reverse, int64_t options = 0, CStrRef search_criteria = "", CStrRef charset = ""); +Variant f_imap_status(CResRef imap_stream, CStrRef mailbox, int64_t options = 0); +bool f_imap_subscribe(CResRef imap_stream, CStrRef mailbox); +Variant f_imap_thread(CResRef imap_stream, int64_t options = 0); Variant f_imap_timeout(int64_t timeout_type, int64_t timeout = -1); -Variant f_imap_uid(CObjRef imap_stream, int64_t msg_number); -bool f_imap_undelete(CObjRef imap_stream, CStrRef msg_number, int64_t flags = 0); -bool f_imap_unsubscribe(CObjRef imap_stream, CStrRef mailbox); +Variant f_imap_uid(CResRef imap_stream, int64_t msg_number); +bool f_imap_undelete(CResRef imap_stream, CStrRef msg_number, int64_t flags = 0); +bool f_imap_unsubscribe(CResRef imap_stream, CStrRef mailbox); Variant f_imap_utf7_decode(CStrRef text); Variant f_imap_utf7_encode(CStrRef data); Variant f_imap_utf8(CStrRef mime_encoded_text); diff --git a/hphp/runtime/ext/ext_ipc.cpp b/hphp/runtime/ext/ext_ipc.cpp index 0c7d3ae19..0bf02e9a4 100644 --- a/hphp/runtime/ext/ext_ipc.cpp +++ b/hphp/runtime/ext/ext_ipc.cpp @@ -94,14 +94,14 @@ Variant f_msg_get_queue(int64_t key, int64_t perms /* = 0666 */) { MessageQueue *q = NEWOBJ(MessageQueue)(); q->key = key; q->id = id; - return Object(q); + return Resource(q); } bool f_msg_queue_exists(int64_t key) { return msgget(key, 0) >= 0; } -bool f_msg_remove_queue(CObjRef queue) { +bool f_msg_remove_queue(CResRef queue) { MessageQueue *q = queue.getTyped(); if (!q) { raise_warning("Invalid message queue was specified"); @@ -123,7 +123,7 @@ const StaticString s_msg_lspid("msg_lspid"), s_msg_lrpid("msg_lrpid"); -bool f_msg_set_queue(CObjRef queue, CArrRef data) { +bool f_msg_set_queue(CResRef queue, CArrRef data) { MessageQueue *q = queue.getTyped(); if (!q) { raise_warning("Invalid message queue was specified"); @@ -148,7 +148,7 @@ bool f_msg_set_queue(CObjRef queue, CArrRef data) { return false; } -Array f_msg_stat_queue(CObjRef queue) { +Array f_msg_stat_queue(CResRef queue) { MessageQueue *q = queue.getTyped(); if (!q) { raise_warning("Invalid message queue was specified"); @@ -174,7 +174,7 @@ Array f_msg_stat_queue(CObjRef queue) { return Array(); } -bool f_msg_send(CObjRef queue, int64_t msgtype, CVarRef message, +bool f_msg_send(CResRef queue, int64_t msgtype, CVarRef message, bool serialize /* = true */, bool blocking /* = true */, VRefParam errorcode /* = null */) { MessageQueue *q = queue.getTyped(); @@ -209,7 +209,7 @@ bool f_msg_send(CObjRef queue, int64_t msgtype, CVarRef message, return true; } -bool f_msg_receive(CObjRef queue, int64_t desiredmsgtype, VRefParam msgtype, +bool f_msg_receive(CResRef queue, int64_t desiredmsgtype, VRefParam msgtype, int64_t maxsize, VRefParam message, bool unserialize /* = true */, int64_t flags /* = 0 */, VRefParam errorcode /* = null */) { @@ -364,11 +364,11 @@ public: StaticString Semaphore::s_class_name("Semaphore"); -bool f_sem_acquire(CObjRef sem_identifier) { +bool f_sem_acquire(CResRef sem_identifier) { return sem_identifier.getTyped()->op(true); } -bool f_sem_release(CObjRef sem_identifier) { +bool f_sem_release(CResRef sem_identifier) { return sem_identifier.getTyped()->op(false); } @@ -457,14 +457,14 @@ Variant f_sem_get(int64_t key, int64_t max_acquire /* = 1 */, sem_ptr->semid = semid; sem_ptr->count = 0; sem_ptr->auto_release = auto_release; - return Object(sem_ptr); + return Resource(sem_ptr); } /** * contributed by Gavin Sherry gavin@linuxworld.com.au * Fri Mar 16 00:50:13 EST 2001 */ -bool f_sem_remove(CObjRef sem_identifier) { +bool f_sem_remove(CResRef sem_identifier) { Semaphore *sem_ptr = sem_identifier.getTyped(); union semun un; diff --git a/hphp/runtime/ext/ext_ipc.h b/hphp/runtime/ext/ext_ipc.h index 831864b0d..5b99ad3f9 100644 --- a/hphp/runtime/ext/ext_ipc.h +++ b/hphp/runtime/ext/ext_ipc.h @@ -28,24 +28,24 @@ int64_t f_ftok(CStrRef pathname, CStrRef proj); Variant f_msg_get_queue(int64_t key, int64_t perms = 0666); bool f_msg_queue_exists(int64_t key); -bool f_msg_send(CObjRef queue, int64_t msgtype, CVarRef message, +bool f_msg_send(CResRef queue, int64_t msgtype, CVarRef message, bool serialize = true, bool blocking = true, VRefParam errorcode = uninit_null()); -bool f_msg_receive(CObjRef queue, int64_t desiredmsgtype, VRefParam msgtype, +bool f_msg_receive(CResRef queue, int64_t desiredmsgtype, VRefParam msgtype, int64_t maxsize, VRefParam message, bool unserialize = true, int64_t flags = 0, VRefParam errorcode = uninit_null()); -bool f_msg_remove_queue(CObjRef queue); -bool f_msg_set_queue(CObjRef queue, CArrRef data); -Array f_msg_stat_queue(CObjRef queue); +bool f_msg_remove_queue(CResRef queue); +bool f_msg_set_queue(CResRef queue, CArrRef data); +Array f_msg_stat_queue(CResRef queue); /////////////////////////////////////////////////////////////////////////////// // semaphore -bool f_sem_acquire(CObjRef sem_identifier); +bool f_sem_acquire(CResRef sem_identifier); Variant f_sem_get(int64_t key, int64_t max_acquire = 1, int64_t perm = 0666, bool auto_release = true); -bool f_sem_release(CObjRef sem_identifier); -bool f_sem_remove(CObjRef sem_identifier); +bool f_sem_release(CResRef sem_identifier); +bool f_sem_remove(CResRef sem_identifier); /////////////////////////////////////////////////////////////////////////////// // shared memory diff --git a/hphp/runtime/ext/ext_ldap.cpp b/hphp/runtime/ext/ext_ldap.cpp index 2b5e3ecd4..73b3ccc4b 100644 --- a/hphp/runtime/ext/ext_ldap.cpp +++ b/hphp/runtime/ext/ext_ldap.cpp @@ -114,7 +114,7 @@ public: LDAPMessage *data; BerElement *ber; - Object result; // Reference to LdapResult to avoid premature deallocation + Resource result; // Reference to LdapResult to avoid premature deallocation }; IMPLEMENT_OBJECT_ALLOCATION_NO_DEFAULT_SWEEP(LdapResultEntry) void LdapResultEntry::sweep() { @@ -131,7 +131,7 @@ static int _get_lderrno(LDAP *ldap) { return lderr; } -static bool php_ldap_do_modify(CObjRef link, CStrRef dn, CArrRef entry, +static bool php_ldap_do_modify(CResRef link, CStrRef dn, CArrRef entry, int oper) { bool is_full_add = false; /* flag for full add operation so ldap_mod_add can be put back into oper, gerrit THomson */ @@ -352,7 +352,7 @@ static Variant php_ldap_do_search(CVarRef link, CVarRef base_dn, ArrayIter iterdn(base_dn.toArray()); ArrayIter iterfilter(filter.toArray()); for (int i = 0; i < nlinks; i++) { - ld = iter.second().toObject().getTyped(true, true); + ld = iter.second().toResource().getTyped(true, true); if (ld == NULL) { ldap_err = 0; goto cleanup_parallel; @@ -394,7 +394,7 @@ static Variant php_ldap_do_search(CVarRef link, CVarRef base_dn, NULL, &ldap_res); } if (rcs[i] != -1) { - ret.append(Object(NEWOBJ(LdapResult)(ldap_res))); + ret.append(Resource(NEWOBJ(LdapResult)(ldap_res))); } else { ret.append(false); } @@ -413,7 +413,7 @@ cleanup_parallel: ldap_base_dn = (char*)base_dn.toString().data(); } - ld = link.toObject().getTyped(true, true); + ld = link.toResource().getTyped(true, true); if (ld == NULL) { ldap_err = 0; goto cleanup; @@ -447,7 +447,7 @@ cleanup_parallel: } #endif parallel_search = 0; - ret.append(Object(NEWOBJ(LdapResult)(ldap_res))); + ret.append(Resource(NEWOBJ(LdapResult)(ldap_res))); } } cleanup: @@ -483,7 +483,7 @@ static int _ldap_rebind_proc(LDAP *ldap, const char *url, ber_tag_t req, /* callback */ Variant ret = vm_call_user_func - (ld->rebindproc, CREATE_VECTOR2(Object(ld), String(url, CopyString))); + (ld->rebindproc, CREATE_VECTOR2(Resource(ld), String(url, CopyString))); return ret.toInt64(); } @@ -536,7 +536,7 @@ Variant f_ldap_connect(CStrRef hostname /* = null_string */, } LdapLink *ld = NEWOBJ(LdapLink)(); - Object ret(ld); + Resource ret(ld); LDAP *ldap = NULL; if (!hostname.empty() && hostname.find('/') >= 0) { @@ -595,27 +595,27 @@ String f_ldap_err2str(int errnum) { return String(ldap_err2string(errnum), CopyString); } -bool f_ldap_add(CObjRef link, CStrRef dn, CArrRef entry) { +bool f_ldap_add(CResRef link, CStrRef dn, CArrRef entry) { return php_ldap_do_modify(link, dn, entry, PHP_LD_FULL_ADD); } -bool f_ldap_mod_add(CObjRef link, CStrRef dn, CArrRef entry) { +bool f_ldap_mod_add(CResRef link, CStrRef dn, CArrRef entry) { return php_ldap_do_modify(link, dn, entry, LDAP_MOD_ADD); } -bool f_ldap_mod_del(CObjRef link, CStrRef dn, CArrRef entry) { +bool f_ldap_mod_del(CResRef link, CStrRef dn, CArrRef entry) { return php_ldap_do_modify(link, dn, entry, LDAP_MOD_DELETE); } -bool f_ldap_mod_replace(CObjRef link, CStrRef dn, CArrRef entry) { +bool f_ldap_mod_replace(CResRef link, CStrRef dn, CArrRef entry) { return php_ldap_do_modify(link, dn, entry, LDAP_MOD_REPLACE); } -bool f_ldap_modify(CObjRef link, CStrRef dn, CArrRef entry) { +bool f_ldap_modify(CResRef link, CStrRef dn, CArrRef entry) { return php_ldap_do_modify(link, dn, entry, LDAP_MOD_REPLACE); } -bool f_ldap_bind(CObjRef link, CStrRef bind_rdn /* = null_string */, +bool f_ldap_bind(CResRef link, CStrRef bind_rdn /* = null_string */, CStrRef bind_password /* = null_string */) { int rc; LdapLink *ld = link.getTyped(); @@ -628,7 +628,7 @@ bool f_ldap_bind(CObjRef link, CStrRef bind_rdn /* = null_string */, return true; } -bool f_ldap_set_rebind_proc(CObjRef link, CVarRef callback) { +bool f_ldap_set_rebind_proc(CResRef link, CVarRef callback) { LdapLink *ld = link.getTyped(); if (callback.isString() && callback.toString().empty()) { @@ -657,7 +657,7 @@ bool f_ldap_set_rebind_proc(CObjRef link, CVarRef callback) { return true; } -bool f_ldap_sort(CObjRef link, CObjRef result, CStrRef sortfilter) { +bool f_ldap_sort(CResRef link, CResRef result, CStrRef sortfilter) { LdapLink *ld = link.getTyped(); LdapResult *res = result.getTyped(); @@ -670,7 +670,7 @@ bool f_ldap_sort(CObjRef link, CObjRef result, CStrRef sortfilter) { return true; } -bool f_ldap_start_tls(CObjRef link) { +bool f_ldap_start_tls(CResRef link) { LdapLink *ld = link.getTyped(); int rc, protocol = LDAP_VERSION3; if (((rc = ldap_set_option(ld->link, LDAP_OPT_PROTOCOL_VERSION, &protocol)) @@ -682,13 +682,13 @@ bool f_ldap_start_tls(CObjRef link) { return true; } -bool f_ldap_unbind(CObjRef link) { +bool f_ldap_unbind(CResRef link) { LdapLink *ld = link.getTyped(); ld->close(); return true; } -bool f_ldap_get_option(CObjRef link, int option, VRefParam retval) { +bool f_ldap_get_option(CResRef link, int option, VRefParam retval) { LdapLink *ld = link.getTyped(); switch (option) { @@ -779,7 +779,7 @@ const StaticString bool f_ldap_set_option(CVarRef link, int option, CVarRef newval) { LDAP *ldap = NULL; if (!link.isNull()) { - LdapLink *ld = link.toObject().getTyped(); + LdapLink *ld = link.toResource().getTyped(); ldap = ld->link; } @@ -921,7 +921,7 @@ bool f_ldap_set_option(CVarRef link, int option, CVarRef newval) { return true; } -bool f_ldap_close(CObjRef link) { +bool f_ldap_close(CResRef link) { return f_ldap_unbind(link); } @@ -949,7 +949,7 @@ Variant f_ldap_search(CVarRef link, CVarRef base_dn, CVarRef filter, sizelimit, timelimit, deref, LDAP_SCOPE_SUBTREE); } -bool f_ldap_rename(CObjRef link, CStrRef dn, CStrRef newrdn, CStrRef newparent, +bool f_ldap_rename(CResRef link, CStrRef dn, CStrRef newrdn, CStrRef newparent, bool deleteoldrdn) { LdapLink *ld = link.getTyped(); int rc = ldap_rename_s(ld->link, (char*)dn.data(), (char*)newrdn.data(), @@ -958,7 +958,7 @@ bool f_ldap_rename(CObjRef link, CStrRef dn, CStrRef newrdn, CStrRef newparent, return rc == LDAP_SUCCESS; } -bool f_ldap_delete(CObjRef link, CStrRef dn) { +bool f_ldap_delete(CResRef link, CStrRef dn) { LdapLink *ld = link.getTyped(); int rc; if ((rc = ldap_delete_s(ld->link, (char*)dn.data())) != LDAP_SUCCESS) { @@ -968,7 +968,7 @@ bool f_ldap_delete(CObjRef link, CStrRef dn) { return true; } -Variant f_ldap_compare(CObjRef link, CStrRef dn, CStrRef attribute, +Variant f_ldap_compare(CResRef link, CStrRef dn, CStrRef attribute, CStrRef value) { LdapLink *ld = link.getTyped(); int rc = ldap_compare_s(ld->link, (char*)dn.data(), (char*)attribute.data(), @@ -981,18 +981,18 @@ Variant f_ldap_compare(CObjRef link, CStrRef dn, CStrRef attribute, return -1LL; } -int64_t f_ldap_errno(CObjRef link) { +int64_t f_ldap_errno(CResRef link) { LdapLink *ld = link.getTyped(); return _get_lderrno(ld->link); } -String f_ldap_error(CObjRef link) { +String f_ldap_error(CResRef link) { LdapLink *ld = link.getTyped(); int ld_errno = _get_lderrno(ld->link); return String(ldap_err2string(ld_errno), CopyString); } -Variant f_ldap_get_dn(CObjRef link, CObjRef result_entry) { +Variant f_ldap_get_dn(CResRef link, CResRef result_entry) { LdapLink *ld = link.getTyped(); LdapResultEntry *entry = result_entry.getTyped(); @@ -1005,13 +1005,13 @@ Variant f_ldap_get_dn(CObjRef link, CObjRef result_entry) { return false; } -int64_t f_ldap_count_entries(CObjRef link, CObjRef result) { +int64_t f_ldap_count_entries(CResRef link, CResRef result) { LdapLink *ld = link.getTyped(); LdapResult *res = result.getTyped(); return ldap_count_entries(ld->link, res->data); } -Variant f_ldap_get_entries(CObjRef link, CObjRef result) { +Variant f_ldap_get_entries(CResRef link, CResRef result) { LdapLink *ld = link.getTyped(); LdapResult *res = result.getTyped(); @@ -1048,7 +1048,7 @@ Variant f_ldap_get_entries(CObjRef link, CObjRef result) { return ret; } -Variant f_ldap_first_entry(CObjRef link, CObjRef result) { +Variant f_ldap_first_entry(CResRef link, CResRef result) { LdapLink *ld = link.getTyped(); LdapResult *res = result.getTyped(); @@ -1060,7 +1060,7 @@ Variant f_ldap_first_entry(CObjRef link, CObjRef result) { return NEWOBJ(LdapResultEntry)(entry, res); } -Variant f_ldap_next_entry(CObjRef link, CObjRef result_entry) { +Variant f_ldap_next_entry(CResRef link, CResRef result_entry) { LdapLink *ld = link.getTyped(); LdapResultEntry *entry = result_entry.getTyped(); @@ -1072,7 +1072,7 @@ Variant f_ldap_next_entry(CObjRef link, CObjRef result_entry) { return NEWOBJ(LdapResultEntry)(msg, entry->result.get()); } -Array f_ldap_get_attributes(CObjRef link, CObjRef result_entry) { +Array f_ldap_get_attributes(CResRef link, CResRef result_entry) { LdapLink *ld = link.getTyped(); LdapResultEntry *entry = result_entry.getTyped(); Array ret = Array::Create(); @@ -1080,7 +1080,7 @@ Array f_ldap_get_attributes(CObjRef link, CObjRef result_entry) { return ret; } -Variant f_ldap_first_attribute(CObjRef link, CObjRef result_entry) { +Variant f_ldap_first_attribute(CResRef link, CResRef result_entry) { LdapLink *ld = link.getTyped(); LdapResultEntry *entry = result_entry.getTyped(); @@ -1094,7 +1094,7 @@ Variant f_ldap_first_attribute(CObjRef link, CObjRef result_entry) { return ret; } -Variant f_ldap_next_attribute(CObjRef link, CObjRef result_entry) { +Variant f_ldap_next_attribute(CResRef link, CResRef result_entry) { LdapLink *ld = link.getTyped(); LdapResultEntry *entry = result_entry.getTyped(); @@ -1118,7 +1118,7 @@ Variant f_ldap_next_attribute(CObjRef link, CObjRef result_entry) { return ret; } -Variant f_ldap_first_reference(CObjRef link, CObjRef result) { +Variant f_ldap_first_reference(CResRef link, CResRef result) { LdapLink *ld = link.getTyped(); LdapResult *res = result.getTyped(); @@ -1130,7 +1130,7 @@ Variant f_ldap_first_reference(CObjRef link, CObjRef result) { return NEWOBJ(LdapResultEntry)(entry, res); } -Variant f_ldap_next_reference(CObjRef link, CObjRef result_entry) { +Variant f_ldap_next_reference(CResRef link, CResRef result_entry) { LdapLink *ld = link.getTyped(); LdapResultEntry *entry = result_entry.getTyped(); @@ -1142,7 +1142,7 @@ Variant f_ldap_next_reference(CObjRef link, CObjRef result_entry) { return NEWOBJ(LdapResultEntry)(entry_next, entry->result.get()); } -bool f_ldap_parse_reference(CObjRef link, CObjRef result_entry, +bool f_ldap_parse_reference(CResRef link, CResRef result_entry, VRefParam referrals) { LdapLink *ld = link.getTyped(); LdapResultEntry *entry = result_entry.getTyped(); @@ -1166,7 +1166,7 @@ bool f_ldap_parse_reference(CObjRef link, CObjRef result_entry, return true; } -bool f_ldap_parse_result(CObjRef link, CObjRef result, VRefParam errcode, +bool f_ldap_parse_result(CResRef link, CResRef result, VRefParam errcode, VRefParam matcheddn /* = null */, VRefParam errmsg /* = null */, VRefParam referrals /* = null */) { @@ -1214,13 +1214,13 @@ bool f_ldap_parse_result(CObjRef link, CObjRef result, VRefParam errcode, return true; } -bool f_ldap_free_result(CObjRef result) { +bool f_ldap_free_result(CResRef result) { LdapResult *res = result.getTyped(); res->close(); return true; } -Variant f_ldap_get_values_len(CObjRef link, CObjRef result_entry, +Variant f_ldap_get_values_len(CResRef link, CResRef result_entry, CStrRef attribute) { LdapLink *ld = link.getTyped(); LdapResultEntry *entry = result_entry.getTyped(); @@ -1245,7 +1245,7 @@ Variant f_ldap_get_values_len(CObjRef link, CObjRef result_entry, return ret; } -Variant f_ldap_get_values(CObjRef link, CObjRef result_entry, +Variant f_ldap_get_values(CResRef link, CResRef result_entry, CStrRef attribute) { return f_ldap_get_values_len(link, result_entry, attribute); } diff --git a/hphp/runtime/ext/ext_ldap.h b/hphp/runtime/ext/ext_ldap.h index b818525e1..9453e6ccc 100644 --- a/hphp/runtime/ext/ext_ldap.h +++ b/hphp/runtime/ext/ext_ldap.h @@ -29,42 +29,42 @@ Variant f_ldap_connect(CStrRef hostname = null_string, int port = 389); Variant f_ldap_explode_dn(CStrRef dn, int with_attrib); Variant f_ldap_dn2ufn(CStrRef db); String f_ldap_err2str(int errnum); -bool f_ldap_add(CObjRef link, CStrRef dn, CArrRef entry); -bool f_ldap_mod_add(CObjRef link, CStrRef dn, CArrRef entry); -bool f_ldap_mod_del(CObjRef link, CStrRef dn, CArrRef entry); -bool f_ldap_mod_replace(CObjRef link, CStrRef dn, CArrRef entry); -bool f_ldap_modify(CObjRef link, CStrRef dn, CArrRef entry); -bool f_ldap_bind(CObjRef link, CStrRef bind_rdn = null_string, CStrRef bind_password = null_string); -bool f_ldap_set_rebind_proc(CObjRef link, CVarRef callback); -bool f_ldap_sort(CObjRef link, CObjRef result, CStrRef sortfilter); -bool f_ldap_start_tls(CObjRef link); -bool f_ldap_unbind(CObjRef link); -bool f_ldap_get_option(CObjRef link, int option, VRefParam retval); +bool f_ldap_add(CResRef link, CStrRef dn, CArrRef entry); +bool f_ldap_mod_add(CResRef link, CStrRef dn, CArrRef entry); +bool f_ldap_mod_del(CResRef link, CStrRef dn, CArrRef entry); +bool f_ldap_mod_replace(CResRef link, CStrRef dn, CArrRef entry); +bool f_ldap_modify(CResRef link, CStrRef dn, CArrRef entry); +bool f_ldap_bind(CResRef link, CStrRef bind_rdn = null_string, CStrRef bind_password = null_string); +bool f_ldap_set_rebind_proc(CResRef link, CVarRef callback); +bool f_ldap_sort(CResRef link, CResRef result, CStrRef sortfilter); +bool f_ldap_start_tls(CResRef link); +bool f_ldap_unbind(CResRef link); +bool f_ldap_get_option(CResRef link, int option, VRefParam retval); bool f_ldap_set_option(CVarRef link, int option, CVarRef newval); -bool f_ldap_close(CObjRef link); +bool f_ldap_close(CResRef link); Variant f_ldap_list(CVarRef link, CVarRef base_dn, CVarRef filter, CArrRef attributes = null_array, int attrsonly = 0, int sizelimit = -1, int timelimit = -1, int deref = -1); Variant f_ldap_read(CVarRef link, CVarRef base_dn, CVarRef filter, CArrRef attributes = null_array, int attrsonly = 0, int sizelimit = -1, int timelimit = -1, int deref = -1); Variant f_ldap_search(CVarRef link, CVarRef base_dn, CVarRef filter, CArrRef attributes = null_array, int attrsonly = 0, int sizelimit = -1, int timelimit = -1, int deref = -1); -bool f_ldap_rename(CObjRef link, CStrRef dn, CStrRef newrdn, CStrRef newparent, bool deleteoldrdn); -bool f_ldap_delete(CObjRef link, CStrRef dn); -Variant f_ldap_compare(CObjRef link, CStrRef dn, CStrRef attribute, CStrRef value); -int64_t f_ldap_errno(CObjRef link); -String f_ldap_error(CObjRef link); -Variant f_ldap_get_dn(CObjRef link, CObjRef result_entry); -int64_t f_ldap_count_entries(CObjRef link, CObjRef result); -Variant f_ldap_get_entries(CObjRef link, CObjRef result); -Variant f_ldap_first_entry(CObjRef link, CObjRef result); -Variant f_ldap_next_entry(CObjRef link, CObjRef result_entry); -Array f_ldap_get_attributes(CObjRef link, CObjRef result_entry); -Variant f_ldap_first_attribute(CObjRef link, CObjRef result_entry); -Variant f_ldap_next_attribute(CObjRef link, CObjRef result_entry); -Variant f_ldap_first_reference(CObjRef link, CObjRef result); -Variant f_ldap_next_reference(CObjRef link, CObjRef result_entry); -bool f_ldap_parse_reference(CObjRef link, CObjRef result_entry, VRefParam referrals); -bool f_ldap_parse_result(CObjRef link, CObjRef result, VRefParam errcode, VRefParam matcheddn = uninit_null(), VRefParam errmsg = uninit_null(), VRefParam referrals = uninit_null()); -bool f_ldap_free_result(CObjRef result); -Variant f_ldap_get_values_len(CObjRef link, CObjRef result_entry, CStrRef attribute); -Variant f_ldap_get_values(CObjRef link, CObjRef result_entry, CStrRef attribute); +bool f_ldap_rename(CResRef link, CStrRef dn, CStrRef newrdn, CStrRef newparent, bool deleteoldrdn); +bool f_ldap_delete(CResRef link, CStrRef dn); +Variant f_ldap_compare(CResRef link, CStrRef dn, CStrRef attribute, CStrRef value); +int64_t f_ldap_errno(CResRef link); +String f_ldap_error(CResRef link); +Variant f_ldap_get_dn(CResRef link, CResRef result_entry); +int64_t f_ldap_count_entries(CResRef link, CResRef result); +Variant f_ldap_get_entries(CResRef link, CResRef result); +Variant f_ldap_first_entry(CResRef link, CResRef result); +Variant f_ldap_next_entry(CResRef link, CResRef result_entry); +Array f_ldap_get_attributes(CResRef link, CResRef result_entry); +Variant f_ldap_first_attribute(CResRef link, CResRef result_entry); +Variant f_ldap_next_attribute(CResRef link, CResRef result_entry); +Variant f_ldap_first_reference(CResRef link, CResRef result); +Variant f_ldap_next_reference(CResRef link, CResRef result_entry); +bool f_ldap_parse_reference(CResRef link, CResRef result_entry, VRefParam referrals); +bool f_ldap_parse_result(CResRef link, CResRef result, VRefParam errcode, VRefParam matcheddn = uninit_null(), VRefParam errmsg = uninit_null(), VRefParam referrals = uninit_null()); +bool f_ldap_free_result(CResRef result); +Variant f_ldap_get_values_len(CResRef link, CResRef result_entry, CStrRef attribute); +Variant f_ldap_get_values(CResRef link, CResRef result_entry, CStrRef attribute); /////////////////////////////////////////////////////////////////////////////// } diff --git a/hphp/runtime/ext/ext_magick.cpp b/hphp/runtime/ext/ext_magick.cpp index 03dc98aed..7922f799a 100644 --- a/hphp/runtime/ext/ext_magick.cpp +++ b/hphp/runtime/ext/ext_magick.cpp @@ -76,23 +76,24 @@ bool f_magicksetresourcelimit(int resource_type, double limit) { throw NotImplementedException(__func__); } -Object f_newdrawingwand() { +Resource f_newdrawingwand() { throw NotImplementedException(__func__); } -Object f_newmagickwand() { +Resource f_newmagickwand() { throw NotImplementedException(__func__); } -Object f_newpixeliterator(CObjRef mgck_wnd) { +Resource f_newpixeliterator(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Object f_newpixelregioniterator(CObjRef mgck_wnd, int x, int y, int columns, int rows) { +Resource f_newpixelregioniterator(CResRef mgck_wnd, int x, int y, int columns, + int rows) { throw NotImplementedException(__func__); } -Object f_newpixelwand(CStrRef imagemagick_col_str /* = null_string */) { +Resource f_newpixelwand(CStrRef imagemagick_col_str /* = null_string */) { throw NotImplementedException(__func__); } @@ -104,19 +105,19 @@ Array f_newpixelwands(int num_pxl_wnds) { throw NotImplementedException(__func__); } -void f_destroydrawingwand(CObjRef drw_wnd) { +void f_destroydrawingwand(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_destroymagickwand(CObjRef mgck_wnd) { +void f_destroymagickwand(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -void f_destroypixeliterator(CObjRef pxl_iter) { +void f_destroypixeliterator(CResRef pxl_iter) { throw NotImplementedException(__func__); } -void f_destroypixelwand(CObjRef pxl_wnd) { +void f_destroypixelwand(CResRef pxl_wnd) { throw NotImplementedException(__func__); } @@ -144,1591 +145,1666 @@ bool f_ispixelwand(CVarRef var) { throw NotImplementedException(__func__); } -void f_cleardrawingwand(CObjRef drw_wnd) { +void f_cleardrawingwand(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_clearmagickwand(CObjRef mgck_wnd) { +void f_clearmagickwand(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -void f_clearpixeliterator(CObjRef pxl_iter) { +void f_clearpixeliterator(CResRef pxl_iter) { throw NotImplementedException(__func__); } -void f_clearpixelwand(CObjRef pxl_wnd) { +void f_clearpixelwand(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -Object f_clonedrawingwand(CObjRef drw_wnd) { +Resource f_clonedrawingwand(CResRef drw_wnd) { throw NotImplementedException(__func__); } -Object f_clonemagickwand(CObjRef mgck_wnd) { +Resource f_clonemagickwand(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Array f_wandgetexception(CObjRef wnd) { +Array f_wandgetexception(CResRef wnd) { throw NotImplementedException(__func__); } -String f_wandgetexceptionstring(CObjRef wnd) { +String f_wandgetexceptionstring(CResRef wnd) { throw NotImplementedException(__func__); } -int64_t f_wandgetexceptiontype(CObjRef wnd) { +int64_t f_wandgetexceptiontype(CResRef wnd) { throw NotImplementedException(__func__); } -bool f_wandhasexception(CObjRef wnd) { +bool f_wandhasexception(CResRef wnd) { throw NotImplementedException(__func__); } -void f_drawaffine(CObjRef drw_wnd, double sx, double sy, double rx, double ry, double tx, double ty) { +void f_drawaffine(CResRef drw_wnd, double sx, double sy, double rx, double ry, + double tx, double ty) { throw NotImplementedException(__func__); } -void f_drawannotation(CObjRef drw_wnd, double x, double y, CStrRef text) { +void f_drawannotation(CResRef drw_wnd, double x, double y, CStrRef text) { throw NotImplementedException(__func__); } -void f_drawarc(CObjRef drw_wnd, double sx, double sy, double ex, double ey, double sd, double ed) { +void f_drawarc(CResRef drw_wnd, double sx, double sy, double ex, double ey, + double sd, double ed) { throw NotImplementedException(__func__); } -void f_drawbezier(CObjRef drw_wnd, CArrRef x_y_points_array) { +void f_drawbezier(CResRef drw_wnd, CArrRef x_y_points_array) { throw NotImplementedException(__func__); } -void f_drawcircle(CObjRef drw_wnd, double ox, double oy, double px, double py) { +void f_drawcircle(CResRef drw_wnd, double ox, double oy, double px, double py) { throw NotImplementedException(__func__); } -void f_drawcolor(CObjRef drw_wnd, double x, double y, int paint_method) { +void f_drawcolor(CResRef drw_wnd, double x, double y, int paint_method) { throw NotImplementedException(__func__); } -void f_drawcomment(CObjRef drw_wnd, CStrRef comment) { +void f_drawcomment(CResRef drw_wnd, CStrRef comment) { throw NotImplementedException(__func__); } -bool f_drawcomposite(CObjRef drw_wnd, int composite_operator, double x, double y, double width, double height, CObjRef mgck_wnd) { +bool f_drawcomposite(CResRef drw_wnd, int composite_operator, double x, + double y, double width, double height, CResRef mgck_wnd) { throw NotImplementedException(__func__); } -void f_drawellipse(CObjRef drw_wnd, double ox, double oy, double rx, double ry, double start, double end) { +void f_drawellipse(CResRef drw_wnd, double ox, double oy, double rx, double ry, + double start, double end) { throw NotImplementedException(__func__); } -String f_drawgetclippath(CObjRef drw_wnd) { +String f_drawgetclippath(CResRef drw_wnd) { throw NotImplementedException(__func__); } -int64_t f_drawgetcliprule(CObjRef drw_wnd) { +int64_t f_drawgetcliprule(CResRef drw_wnd) { throw NotImplementedException(__func__); } -int64_t f_drawgetclipunits(CObjRef drw_wnd) { +int64_t f_drawgetclipunits(CResRef drw_wnd) { throw NotImplementedException(__func__); } -Array f_drawgetexception(CObjRef drw_wnd) { +Array f_drawgetexception(CResRef drw_wnd) { throw NotImplementedException(__func__); } -String f_drawgetexceptionstring(CObjRef drw_wnd) { +String f_drawgetexceptionstring(CResRef drw_wnd) { throw NotImplementedException(__func__); } -int64_t f_drawgetexceptiontype(CObjRef drw_wnd) { +int64_t f_drawgetexceptiontype(CResRef drw_wnd) { throw NotImplementedException(__func__); } -double f_drawgetfillalpha(CObjRef drw_wnd) { +double f_drawgetfillalpha(CResRef drw_wnd) { throw NotImplementedException(__func__); } -Object f_drawgetfillcolor(CObjRef drw_wnd) { +Resource f_drawgetfillcolor(CResRef drw_wnd) { throw NotImplementedException(__func__); } -double f_drawgetfillopacity(CObjRef drw_wnd) { +double f_drawgetfillopacity(CResRef drw_wnd) { throw NotImplementedException(__func__); } -int64_t f_drawgetfillrule(CObjRef drw_wnd) { +int64_t f_drawgetfillrule(CResRef drw_wnd) { throw NotImplementedException(__func__); } -String f_drawgetfont(CObjRef drw_wnd) { +String f_drawgetfont(CResRef drw_wnd) { throw NotImplementedException(__func__); } -String f_drawgetfontfamily(CObjRef drw_wnd) { +String f_drawgetfontfamily(CResRef drw_wnd) { throw NotImplementedException(__func__); } -double f_drawgetfontsize(CObjRef drw_wnd) { +double f_drawgetfontsize(CResRef drw_wnd) { throw NotImplementedException(__func__); } -int64_t f_drawgetfontstretch(CObjRef drw_wnd) { +int64_t f_drawgetfontstretch(CResRef drw_wnd) { throw NotImplementedException(__func__); } -int64_t f_drawgetfontstyle(CObjRef drw_wnd) { +int64_t f_drawgetfontstyle(CResRef drw_wnd) { throw NotImplementedException(__func__); } -double f_drawgetfontweight(CObjRef drw_wnd) { +double f_drawgetfontweight(CResRef drw_wnd) { throw NotImplementedException(__func__); } -int64_t f_drawgetgravity(CObjRef drw_wnd) { +int64_t f_drawgetgravity(CResRef drw_wnd) { throw NotImplementedException(__func__); } -double f_drawgetstrokealpha(CObjRef drw_wnd) { +double f_drawgetstrokealpha(CResRef drw_wnd) { throw NotImplementedException(__func__); } -bool f_drawgetstrokeantialias(CObjRef drw_wnd) { +bool f_drawgetstrokeantialias(CResRef drw_wnd) { throw NotImplementedException(__func__); } -Object f_drawgetstrokecolor(CObjRef drw_wnd) { +Resource f_drawgetstrokecolor(CResRef drw_wnd) { throw NotImplementedException(__func__); } -Array f_drawgetstrokedasharray(CObjRef drw_wnd) { +Array f_drawgetstrokedasharray(CResRef drw_wnd) { throw NotImplementedException(__func__); } -double f_drawgetstrokedashoffset(CObjRef drw_wnd) { +double f_drawgetstrokedashoffset(CResRef drw_wnd) { throw NotImplementedException(__func__); } -int64_t f_drawgetstrokelinecap(CObjRef drw_wnd) { +int64_t f_drawgetstrokelinecap(CResRef drw_wnd) { throw NotImplementedException(__func__); } -int64_t f_drawgetstrokelinejoin(CObjRef drw_wnd) { +int64_t f_drawgetstrokelinejoin(CResRef drw_wnd) { throw NotImplementedException(__func__); } -double f_drawgetstrokemiterlimit(CObjRef drw_wnd) { +double f_drawgetstrokemiterlimit(CResRef drw_wnd) { throw NotImplementedException(__func__); } -double f_drawgetstrokeopacity(CObjRef drw_wnd) { +double f_drawgetstrokeopacity(CResRef drw_wnd) { throw NotImplementedException(__func__); } -double f_drawgetstrokewidth(CObjRef drw_wnd) { +double f_drawgetstrokewidth(CResRef drw_wnd) { throw NotImplementedException(__func__); } -int64_t f_drawgettextalignment(CObjRef drw_wnd) { +int64_t f_drawgettextalignment(CResRef drw_wnd) { throw NotImplementedException(__func__); } -bool f_drawgettextantialias(CObjRef drw_wnd) { +bool f_drawgettextantialias(CResRef drw_wnd) { throw NotImplementedException(__func__); } -int64_t f_drawgettextdecoration(CObjRef drw_wnd) { +int64_t f_drawgettextdecoration(CResRef drw_wnd) { throw NotImplementedException(__func__); } -String f_drawgettextencoding(CObjRef drw_wnd) { +String f_drawgettextencoding(CResRef drw_wnd) { throw NotImplementedException(__func__); } -Object f_drawgettextundercolor(CObjRef drw_wnd) { +Resource f_drawgettextundercolor(CResRef drw_wnd) { throw NotImplementedException(__func__); } -String f_drawgetvectorgraphics(CObjRef drw_wnd) { +String f_drawgetvectorgraphics(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_drawline(CObjRef drw_wnd, double sx, double sy, double ex, double ey) { +void f_drawline(CResRef drw_wnd, double sx, double sy, double ex, double ey) { throw NotImplementedException(__func__); } -void f_drawmatte(CObjRef drw_wnd, double x, double y, int paint_method) { +void f_drawmatte(CResRef drw_wnd, double x, double y, int paint_method) { throw NotImplementedException(__func__); } -void f_drawpathclose(CObjRef drw_wnd) { +void f_drawpathclose(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_drawpathcurvetoabsolute(CObjRef drw_wnd, double x1, double y1, double x2, double y2, double x, double y) { +void f_drawpathcurvetoabsolute(CResRef drw_wnd, double x1, double y1, double x2, + double y2, double x, double y) { throw NotImplementedException(__func__); } -void f_drawpathcurvetoquadraticbezierabsolute(CObjRef drw_wnd, double x1, double y1, double x, double y) { +void f_drawpathcurvetoquadraticbezierabsolute(CResRef drw_wnd, + double x1, + double y1, + double x, + double y) { throw NotImplementedException(__func__); } -void f_drawpathcurvetoquadraticbezierrelative(CObjRef drw_wnd, double x1, double y1, double x, double y) { +void f_drawpathcurvetoquadraticbezierrelative(CResRef drw_wnd, + double x1, + double y1, + double x, + double y) { throw NotImplementedException(__func__); } -void f_drawpathcurvetoquadraticbeziersmoothabsolute(CObjRef drw_wnd, double x, double y) { +void f_drawpathcurvetoquadraticbeziersmoothabsolute(CResRef drw_wnd, + double x, + double y) { throw NotImplementedException(__func__); } -void f_drawpathcurvetoquadraticbeziersmoothrelative(CObjRef drw_wnd, double x, double y) { +void f_drawpathcurvetoquadraticbeziersmoothrelative(CResRef drw_wnd, + double x, + double y) { throw NotImplementedException(__func__); } -void f_drawpathcurvetorelative(CObjRef drw_wnd, double x1, double y1, double x2, double y2, double x, double y) { +void f_drawpathcurvetorelative(CResRef drw_wnd, double x1, double y1, double x2, + double y2, double x, double y) { throw NotImplementedException(__func__); } -void f_drawpathcurvetosmoothabsolute(CObjRef drw_wnd, double x2, double y2, double x, double y) { +void f_drawpathcurvetosmoothabsolute(CResRef drw_wnd, double x2, double y2, + double x, double y) { throw NotImplementedException(__func__); } -void f_drawpathcurvetosmoothrelative(CObjRef drw_wnd, double x2, double y2, double x, double y) { +void f_drawpathcurvetosmoothrelative(CResRef drw_wnd, double x2, double y2, + double x, double y) { throw NotImplementedException(__func__); } -void f_drawpathellipticarcabsolute(CObjRef drw_wnd, double rx, double ry, double x_axis_rotation, bool large_arc_flag, bool sweep_flag, double x, double y) { +void f_drawpathellipticarcabsolute(CResRef drw_wnd, double rx, double ry, + double x_axis_rotation, bool large_arc_flag, + bool sweep_flag, double x, double y) { throw NotImplementedException(__func__); } -void f_drawpathellipticarcrelative(CObjRef drw_wnd, double rx, double ry, double x_axis_rotation, bool large_arc_flag, bool sweep_flag, double x, double y) { +void f_drawpathellipticarcrelative(CResRef drw_wnd, double rx, double ry, + double x_axis_rotation, bool large_arc_flag, + bool sweep_flag, double x, double y) { throw NotImplementedException(__func__); } -void f_drawpathfinish(CObjRef drw_wnd) { +void f_drawpathfinish(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_drawpathlinetoabsolute(CObjRef drw_wnd, double x, double y) { +void f_drawpathlinetoabsolute(CResRef drw_wnd, double x, double y) { throw NotImplementedException(__func__); } -void f_drawpathlinetohorizontalabsolute(CObjRef drw_wnd, double x) { +void f_drawpathlinetohorizontalabsolute(CResRef drw_wnd, double x) { throw NotImplementedException(__func__); } -void f_drawpathlinetohorizontalrelative(CObjRef drw_wnd, double x) { +void f_drawpathlinetohorizontalrelative(CResRef drw_wnd, double x) { throw NotImplementedException(__func__); } -void f_drawpathlinetorelative(CObjRef drw_wnd, double x, double y) { +void f_drawpathlinetorelative(CResRef drw_wnd, double x, double y) { throw NotImplementedException(__func__); } -void f_drawpathlinetoverticalabsolute(CObjRef drw_wnd, double y) { +void f_drawpathlinetoverticalabsolute(CResRef drw_wnd, double y) { throw NotImplementedException(__func__); } -void f_drawpathlinetoverticalrelative(CObjRef drw_wnd, double y) { +void f_drawpathlinetoverticalrelative(CResRef drw_wnd, double y) { throw NotImplementedException(__func__); } -void f_drawpathmovetoabsolute(CObjRef drw_wnd, double x, double y) { +void f_drawpathmovetoabsolute(CResRef drw_wnd, double x, double y) { throw NotImplementedException(__func__); } -void f_drawpathmovetorelative(CObjRef drw_wnd, double x, double y) { +void f_drawpathmovetorelative(CResRef drw_wnd, double x, double y) { throw NotImplementedException(__func__); } -void f_drawpathstart(CObjRef drw_wnd) { +void f_drawpathstart(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_drawpoint(CObjRef drw_wnd, double x, double y) { +void f_drawpoint(CResRef drw_wnd, double x, double y) { throw NotImplementedException(__func__); } -void f_drawpolygon(CObjRef drw_wnd, CArrRef x_y_points_array) { +void f_drawpolygon(CResRef drw_wnd, CArrRef x_y_points_array) { throw NotImplementedException(__func__); } -void f_drawpolyline(CObjRef drw_wnd, CArrRef x_y_points_array) { +void f_drawpolyline(CResRef drw_wnd, CArrRef x_y_points_array) { throw NotImplementedException(__func__); } -void f_drawrectangle(CObjRef drw_wnd, double x1, double y1, double x2, double y2) { +void f_drawrectangle(CResRef drw_wnd, double x1, double y1, double x2, + double y2) { throw NotImplementedException(__func__); } -bool f_drawrender(CObjRef drw_wnd) { +bool f_drawrender(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_drawrotate(CObjRef drw_wnd, double degrees) { +void f_drawrotate(CResRef drw_wnd, double degrees) { throw NotImplementedException(__func__); } -void f_drawroundrectangle(CObjRef drw_wnd, double x1, double y1, double x2, double y2, double rx, double ry) { +void f_drawroundrectangle(CResRef drw_wnd, double x1, double y1, double x2, + double y2, double rx, double ry) { throw NotImplementedException(__func__); } -void f_drawscale(CObjRef drw_wnd, double x, double y) { +void f_drawscale(CResRef drw_wnd, double x, double y) { throw NotImplementedException(__func__); } -bool f_drawsetclippath(CObjRef drw_wnd, CStrRef clip_path) { +bool f_drawsetclippath(CResRef drw_wnd, CStrRef clip_path) { throw NotImplementedException(__func__); } -void f_drawsetcliprule(CObjRef drw_wnd, int fill_rule) { +void f_drawsetcliprule(CResRef drw_wnd, int fill_rule) { throw NotImplementedException(__func__); } -void f_drawsetclipunits(CObjRef drw_wnd, int clip_path_units) { +void f_drawsetclipunits(CResRef drw_wnd, int clip_path_units) { throw NotImplementedException(__func__); } -void f_drawsetfillalpha(CObjRef drw_wnd, double fill_opacity) { +void f_drawsetfillalpha(CResRef drw_wnd, double fill_opacity) { throw NotImplementedException(__func__); } -void f_drawsetfillcolor(CObjRef drw_wnd, CObjRef fill_pxl_wnd) { +void f_drawsetfillcolor(CResRef drw_wnd, CResRef fill_pxl_wnd) { throw NotImplementedException(__func__); } -void f_drawsetfillopacity(CObjRef drw_wnd, double fill_opacity) { +void f_drawsetfillopacity(CResRef drw_wnd, double fill_opacity) { throw NotImplementedException(__func__); } -bool f_drawsetfillpatternurl(CObjRef drw_wnd, CStrRef fill_url) { +bool f_drawsetfillpatternurl(CResRef drw_wnd, CStrRef fill_url) { throw NotImplementedException(__func__); } -void f_drawsetfillrule(CObjRef drw_wnd, int fill_rule) { +void f_drawsetfillrule(CResRef drw_wnd, int fill_rule) { throw NotImplementedException(__func__); } -bool f_drawsetfont(CObjRef drw_wnd, CStrRef font_file) { +bool f_drawsetfont(CResRef drw_wnd, CStrRef font_file) { throw NotImplementedException(__func__); } -bool f_drawsetfontfamily(CObjRef drw_wnd, CStrRef font_family) { +bool f_drawsetfontfamily(CResRef drw_wnd, CStrRef font_family) { throw NotImplementedException(__func__); } -void f_drawsetfontsize(CObjRef drw_wnd, double pointsize) { +void f_drawsetfontsize(CResRef drw_wnd, double pointsize) { throw NotImplementedException(__func__); } -void f_drawsetfontstretch(CObjRef drw_wnd, int stretch_type) { +void f_drawsetfontstretch(CResRef drw_wnd, int stretch_type) { throw NotImplementedException(__func__); } -void f_drawsetfontstyle(CObjRef drw_wnd, int style_type) { +void f_drawsetfontstyle(CResRef drw_wnd, int style_type) { throw NotImplementedException(__func__); } -void f_drawsetfontweight(CObjRef drw_wnd, double font_weight) { +void f_drawsetfontweight(CResRef drw_wnd, double font_weight) { throw NotImplementedException(__func__); } -void f_drawsetgravity(CObjRef drw_wnd, int gravity_type) { +void f_drawsetgravity(CResRef drw_wnd, int gravity_type) { throw NotImplementedException(__func__); } -void f_drawsetstrokealpha(CObjRef drw_wnd, double stroke_opacity) { +void f_drawsetstrokealpha(CResRef drw_wnd, double stroke_opacity) { throw NotImplementedException(__func__); } -void f_drawsetstrokeantialias(CObjRef drw_wnd, bool stroke_antialias /* = true */) { +void f_drawsetstrokeantialias(CResRef drw_wnd, + bool stroke_antialias /* = true */) { throw NotImplementedException(__func__); } -void f_drawsetstrokecolor(CObjRef drw_wnd, CObjRef strokecolor_pxl_wnd) { +void f_drawsetstrokecolor(CResRef drw_wnd, CResRef strokecolor_pxl_wnd) { throw NotImplementedException(__func__); } -void f_drawsetstrokedasharray(CObjRef drw_wnd, CArrRef dash_array /* = null_array */) { +void f_drawsetstrokedasharray(CResRef drw_wnd, + CArrRef dash_array /* = null_array */) { throw NotImplementedException(__func__); } -void f_drawsetstrokedashoffset(CObjRef drw_wnd, double dash_offset) { +void f_drawsetstrokedashoffset(CResRef drw_wnd, double dash_offset) { throw NotImplementedException(__func__); } -void f_drawsetstrokelinecap(CObjRef drw_wnd, int line_cap) { +void f_drawsetstrokelinecap(CResRef drw_wnd, int line_cap) { throw NotImplementedException(__func__); } -void f_drawsetstrokelinejoin(CObjRef drw_wnd, int line_join) { +void f_drawsetstrokelinejoin(CResRef drw_wnd, int line_join) { throw NotImplementedException(__func__); } -void f_drawsetstrokemiterlimit(CObjRef drw_wnd, double miterlimit) { +void f_drawsetstrokemiterlimit(CResRef drw_wnd, double miterlimit) { throw NotImplementedException(__func__); } -void f_drawsetstrokeopacity(CObjRef drw_wnd, double stroke_opacity) { +void f_drawsetstrokeopacity(CResRef drw_wnd, double stroke_opacity) { throw NotImplementedException(__func__); } -bool f_drawsetstrokepatternurl(CObjRef drw_wnd, CStrRef stroke_url) { +bool f_drawsetstrokepatternurl(CResRef drw_wnd, CStrRef stroke_url) { throw NotImplementedException(__func__); } -void f_drawsetstrokewidth(CObjRef drw_wnd, double stroke_width) { +void f_drawsetstrokewidth(CResRef drw_wnd, double stroke_width) { throw NotImplementedException(__func__); } -void f_drawsettextalignment(CObjRef drw_wnd, int align_type) { +void f_drawsettextalignment(CResRef drw_wnd, int align_type) { throw NotImplementedException(__func__); } -void f_drawsettextantialias(CObjRef drw_wnd, bool text_antialias /* = true */) { +void f_drawsettextantialias(CResRef drw_wnd, bool text_antialias /* = true */) { throw NotImplementedException(__func__); } -void f_drawsettextdecoration(CObjRef drw_wnd, int decoration_type) { +void f_drawsettextdecoration(CResRef drw_wnd, int decoration_type) { throw NotImplementedException(__func__); } -void f_drawsettextencoding(CObjRef drw_wnd, CStrRef encoding) { +void f_drawsettextencoding(CResRef drw_wnd, CStrRef encoding) { throw NotImplementedException(__func__); } -void f_drawsettextundercolor(CObjRef drw_wnd, CObjRef undercolor_pxl_wnd) { +void f_drawsettextundercolor(CResRef drw_wnd, CResRef undercolor_pxl_wnd) { throw NotImplementedException(__func__); } -bool f_drawsetvectorgraphics(CObjRef drw_wnd, CStrRef vector_graphics) { +bool f_drawsetvectorgraphics(CResRef drw_wnd, CStrRef vector_graphics) { throw NotImplementedException(__func__); } -void f_drawsetviewbox(CObjRef drw_wnd, double x1, double y1, double x2, double y2) { +void f_drawsetviewbox(CResRef drw_wnd, double x1, double y1, double x2, + double y2) { throw NotImplementedException(__func__); } -void f_drawskewx(CObjRef drw_wnd, double degrees) { +void f_drawskewx(CResRef drw_wnd, double degrees) { throw NotImplementedException(__func__); } -void f_drawskewy(CObjRef drw_wnd, double degrees) { +void f_drawskewy(CResRef drw_wnd, double degrees) { throw NotImplementedException(__func__); } -void f_drawtranslate(CObjRef drw_wnd, double x, double y) { +void f_drawtranslate(CResRef drw_wnd, double x, double y) { throw NotImplementedException(__func__); } -void f_pushdrawingwand(CObjRef drw_wnd) { +void f_pushdrawingwand(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_drawpushclippath(CObjRef drw_wnd, CStrRef clip_path_id) { +void f_drawpushclippath(CResRef drw_wnd, CStrRef clip_path_id) { throw NotImplementedException(__func__); } -void f_drawpushdefs(CObjRef drw_wnd) { +void f_drawpushdefs(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_drawpushpattern(CObjRef drw_wnd, CStrRef pattern_id, double x, double y, double width, double height) { +void f_drawpushpattern(CResRef drw_wnd, CStrRef pattern_id, double x, double y, + double width, double height) { throw NotImplementedException(__func__); } -void f_popdrawingwand(CObjRef drw_wnd) { +void f_popdrawingwand(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_drawpopclippath(CObjRef drw_wnd) { +void f_drawpopclippath(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_drawpopdefs(CObjRef drw_wnd) { +void f_drawpopdefs(CResRef drw_wnd) { throw NotImplementedException(__func__); } -void f_drawpoppattern(CObjRef drw_wnd) { +void f_drawpoppattern(CResRef drw_wnd) { throw NotImplementedException(__func__); } -bool f_magickadaptivethresholdimage(CObjRef mgck_wnd, double width, double height, double offset) { +bool f_magickadaptivethresholdimage(CResRef mgck_wnd, double width, + double height, double offset) { throw NotImplementedException(__func__); } -bool f_magickaddimage(CObjRef mgck_wnd, CObjRef add_wand) { +bool f_magickaddimage(CResRef mgck_wnd, CResRef add_wand) { throw NotImplementedException(__func__); } -bool f_magickaddnoiseimage(CObjRef mgck_wnd, int noise_type) { +bool f_magickaddnoiseimage(CResRef mgck_wnd, int noise_type) { throw NotImplementedException(__func__); } -bool f_magickaffinetransformimage(CObjRef mgck_wnd, CObjRef drw_wnd) { +bool f_magickaffinetransformimage(CResRef mgck_wnd, CResRef drw_wnd) { throw NotImplementedException(__func__); } -bool f_magickannotateimage(CObjRef mgck_wnd, CObjRef drw_wnd, double x, double y, double angle, CStrRef text) { +bool f_magickannotateimage(CResRef mgck_wnd, CResRef drw_wnd, double x, + double y, double angle, CStrRef text) { throw NotImplementedException(__func__); } -Object f_magickappendimages(CObjRef mgck_wnd, bool stack_vertical /* = false */) { +Resource f_magickappendimages(CResRef mgck_wnd, + bool stack_vertical /* = false */) { throw NotImplementedException(__func__); } -Object f_magickaverageimages(CObjRef mgck_wnd) { +Resource f_magickaverageimages(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickblackthresholdimage(CObjRef mgck_wnd, CObjRef threshold_pxl_wnd) { +bool f_magickblackthresholdimage(CResRef mgck_wnd, CResRef threshold_pxl_wnd) { throw NotImplementedException(__func__); } -bool f_magickblurimage(CObjRef mgck_wnd, double radius, double sigma, int channel_type /* = 0 */) { +bool f_magickblurimage(CResRef mgck_wnd, double radius, double sigma, + int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -bool f_magickborderimage(CObjRef mgck_wnd, CObjRef bordercolor, double width, double height) { +bool f_magickborderimage(CResRef mgck_wnd, CResRef bordercolor, double width, + double height) { throw NotImplementedException(__func__); } -bool f_magickcharcoalimage(CObjRef mgck_wnd, double radius, double sigma) { +bool f_magickcharcoalimage(CResRef mgck_wnd, double radius, double sigma) { throw NotImplementedException(__func__); } -bool f_magickchopimage(CObjRef mgck_wnd, double width, double height, int x, int y) { +bool f_magickchopimage(CResRef mgck_wnd, double width, double height, int x, + int y) { throw NotImplementedException(__func__); } -bool f_magickclipimage(CObjRef mgck_wnd) { +bool f_magickclipimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickclippathimage(CObjRef mgck_wnd, CStrRef pathname, bool inside) { +bool f_magickclippathimage(CResRef mgck_wnd, CStrRef pathname, bool inside) { throw NotImplementedException(__func__); } -Object f_magickcoalesceimages(CObjRef mgck_wnd) { +Resource f_magickcoalesceimages(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickcolorfloodfillimage(CObjRef mgck_wnd, CObjRef fillcolor_pxl_wnd, double fuzz, CObjRef bordercolor_pxl_wnd, int x, int y) { +bool f_magickcolorfloodfillimage(CResRef mgck_wnd, CResRef fillcolor_pxl_wnd, + double fuzz, CResRef bordercolor_pxl_wnd, + int x, int y) { throw NotImplementedException(__func__); } -bool f_magickcolorizeimage(CObjRef mgck_wnd, CObjRef colorize, CObjRef opacity_pxl_wnd) { +bool f_magickcolorizeimage(CResRef mgck_wnd, CResRef colorize, + CResRef opacity_pxl_wnd) { throw NotImplementedException(__func__); } -Object f_magickcombineimages(CObjRef mgck_wnd, int channel_type) { +Resource f_magickcombineimages(CResRef mgck_wnd, int channel_type) { throw NotImplementedException(__func__); } -bool f_magickcommentimage(CObjRef mgck_wnd, CStrRef comment) { +bool f_magickcommentimage(CResRef mgck_wnd, CStrRef comment) { throw NotImplementedException(__func__); } -Array f_magickcompareimages(CObjRef mgck_wnd, CObjRef reference_wnd, int metric_type, int channel_type /* = 0 */) { +Array f_magickcompareimages(CResRef mgck_wnd, CResRef reference_wnd, + int metric_type, int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -bool f_magickcompositeimage(CObjRef mgck_wnd, CObjRef composite_wnd, int composite_operator, int x, int y) { +bool f_magickcompositeimage(CResRef mgck_wnd, CResRef composite_wnd, + int composite_operator, int x, int y) { throw NotImplementedException(__func__); } -bool f_magickconstituteimage(CObjRef mgck_wnd, double columns, double rows, CStrRef smap, int storage_type, CArrRef pixel_array) { +bool f_magickconstituteimage(CResRef mgck_wnd, double columns, double rows, + CStrRef smap, int storage_type, + CArrRef pixel_array) { throw NotImplementedException(__func__); } -bool f_magickcontrastimage(CObjRef mgck_wnd, bool sharpen) { +bool f_magickcontrastimage(CResRef mgck_wnd, bool sharpen) { throw NotImplementedException(__func__); } -bool f_magickconvolveimage(CObjRef mgck_wnd, CArrRef kernel_array, int channel_type /* = 0 */) { +bool f_magickconvolveimage(CResRef mgck_wnd, CArrRef kernel_array, + int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -bool f_magickcropimage(CObjRef mgck_wnd, double width, double height, int x, int y) { +bool f_magickcropimage(CResRef mgck_wnd, double width, double height, int x, + int y) { throw NotImplementedException(__func__); } -bool f_magickcyclecolormapimage(CObjRef mgck_wnd, int num_positions) { +bool f_magickcyclecolormapimage(CResRef mgck_wnd, int num_positions) { throw NotImplementedException(__func__); } -Object f_magickdeconstructimages(CObjRef mgck_wnd) { +Resource f_magickdeconstructimages(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -String f_magickdescribeimage(CObjRef mgck_wnd) { +String f_magickdescribeimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickdespeckleimage(CObjRef mgck_wnd) { +bool f_magickdespeckleimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickdrawimage(CObjRef mgck_wnd, CObjRef drw_wnd) { +bool f_magickdrawimage(CResRef mgck_wnd, CResRef drw_wnd) { throw NotImplementedException(__func__); } -bool f_magickechoimageblob(CObjRef mgck_wnd) { +bool f_magickechoimageblob(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickechoimagesblob(CObjRef mgck_wnd) { +bool f_magickechoimagesblob(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickedgeimage(CObjRef mgck_wnd, double radius) { +bool f_magickedgeimage(CResRef mgck_wnd, double radius) { throw NotImplementedException(__func__); } -bool f_magickembossimage(CObjRef mgck_wnd, double radius, double sigma) { +bool f_magickembossimage(CResRef mgck_wnd, double radius, double sigma) { throw NotImplementedException(__func__); } -bool f_magickenhanceimage(CObjRef mgck_wnd) { +bool f_magickenhanceimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickequalizeimage(CObjRef mgck_wnd) { +bool f_magickequalizeimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickevaluateimage(CObjRef mgck_wnd, int evaluate_op, double constant, int channel_type /* = 0 */) { +bool f_magickevaluateimage(CResRef mgck_wnd, int evaluate_op, double constant, + int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -Object f_magickflattenimages(CObjRef mgck_wnd) { +Resource f_magickflattenimages(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickflipimage(CObjRef mgck_wnd) { +bool f_magickflipimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickflopimage(CObjRef mgck_wnd) { +bool f_magickflopimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickframeimage(CObjRef mgck_wnd, CObjRef matte_color, double width, double height, int inner_bevel, int outer_bevel) { +bool f_magickframeimage(CResRef mgck_wnd, CResRef matte_color, double width, + double height, int inner_bevel, int outer_bevel) { throw NotImplementedException(__func__); } -Object f_magickfximage(CObjRef mgck_wnd, CStrRef expression, int channel_type /* = 0 */) { +Resource f_magickfximage(CResRef mgck_wnd, CStrRef expression, + int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -bool f_magickgammaimage(CObjRef mgck_wnd, double gamma, int channel_type /* = 0 */) { +bool f_magickgammaimage(CResRef mgck_wnd, double gamma, + int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -bool f_magickgaussianblurimage(CObjRef mgck_wnd, double radius, double sigma, int channel_type /* = 0 */) { +bool f_magickgaussianblurimage(CResRef mgck_wnd, double radius, double sigma, + int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -double f_magickgetcharheight(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline /* = false */) { +double f_magickgetcharheight(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, + bool multiline /* = false */) { throw NotImplementedException(__func__); } -double f_magickgetcharwidth(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline /* = false */) { +double f_magickgetcharwidth(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, + bool multiline /* = false */) { throw NotImplementedException(__func__); } -Array f_magickgetexception(CObjRef mgck_wnd) { +Array f_magickgetexception(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -String f_magickgetexceptionstring(CObjRef mgck_wnd) { +String f_magickgetexceptionstring(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetexceptiontype(CObjRef mgck_wnd) { +int64_t f_magickgetexceptiontype(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -String f_magickgetfilename(CObjRef mgck_wnd) { +String f_magickgetfilename(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -String f_magickgetformat(CObjRef mgck_wnd) { +String f_magickgetformat(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Object f_magickgetimage(CObjRef mgck_wnd) { +Resource f_magickgetimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Object f_magickgetimagebackgroundcolor(CObjRef mgck_wnd) { +Resource f_magickgetimagebackgroundcolor(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -String f_magickgetimageblob(CObjRef mgck_wnd) { +String f_magickgetimageblob(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Array f_magickgetimageblueprimary(CObjRef mgck_wnd) { +Array f_magickgetimageblueprimary(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Object f_magickgetimagebordercolor(CObjRef mgck_wnd) { +Resource f_magickgetimagebordercolor(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Array f_magickgetimagechannelmean(CObjRef mgck_wnd, int channel_type) { +Array f_magickgetimagechannelmean(CResRef mgck_wnd, int channel_type) { throw NotImplementedException(__func__); } -Object f_magickgetimagecolormapcolor(CObjRef mgck_wnd, double index) { +Resource f_magickgetimagecolormapcolor(CResRef mgck_wnd, double index) { throw NotImplementedException(__func__); } -double f_magickgetimagecolors(CObjRef mgck_wnd) { +double f_magickgetimagecolors(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetimagecolorspace(CObjRef mgck_wnd) { +int64_t f_magickgetimagecolorspace(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetimagecompose(CObjRef mgck_wnd) { +int64_t f_magickgetimagecompose(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetimagecompression(CObjRef mgck_wnd) { +int64_t f_magickgetimagecompression(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -double f_magickgetimagecompressionquality(CObjRef mgck_wnd) { +double f_magickgetimagecompressionquality(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -double f_magickgetimagedelay(CObjRef mgck_wnd) { +double f_magickgetimagedelay(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -double f_magickgetimagedepth(CObjRef mgck_wnd, int channel_type /* = 0 */) { +double f_magickgetimagedepth(CResRef mgck_wnd, int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -int64_t f_magickgetimagedispose(CObjRef mgck_wnd) { +int64_t f_magickgetimagedispose(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Array f_magickgetimageextrema(CObjRef mgck_wnd, int channel_type /* = 0 */) { +Array f_magickgetimageextrema(CResRef mgck_wnd, int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -String f_magickgetimagefilename(CObjRef mgck_wnd) { +String f_magickgetimagefilename(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -String f_magickgetimageformat(CObjRef mgck_wnd) { +String f_magickgetimageformat(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -double f_magickgetimagegamma(CObjRef mgck_wnd) { +double f_magickgetimagegamma(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Array f_magickgetimagegreenprimary(CObjRef mgck_wnd) { +Array f_magickgetimagegreenprimary(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -double f_magickgetimageheight(CObjRef mgck_wnd) { +double f_magickgetimageheight(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Array f_magickgetimagehistogram(CObjRef mgck_wnd) { +Array f_magickgetimagehistogram(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetimageindex(CObjRef mgck_wnd) { +int64_t f_magickgetimageindex(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetimageinterlacescheme(CObjRef mgck_wnd) { +int64_t f_magickgetimageinterlacescheme(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -double f_magickgetimageiterations(CObjRef mgck_wnd) { +double f_magickgetimageiterations(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Object f_magickgetimagemattecolor(CObjRef mgck_wnd) { +Resource f_magickgetimagemattecolor(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -String f_magickgetimagemimetype(CObjRef mgck_wnd) { +String f_magickgetimagemimetype(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Array f_magickgetimagepixels(CObjRef mgck_wnd, int x_offset, int y_offset, double columns, double rows, CStrRef smap, int storage_type) { +Array f_magickgetimagepixels(CResRef mgck_wnd, int x_offset, int y_offset, + double columns, double rows, CStrRef smap, + int storage_type) { throw NotImplementedException(__func__); } -String f_magickgetimageprofile(CObjRef mgck_wnd, CStrRef name) { +String f_magickgetimageprofile(CResRef mgck_wnd, CStrRef name) { throw NotImplementedException(__func__); } -Array f_magickgetimageredprimary(CObjRef mgck_wnd) { +Array f_magickgetimageredprimary(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetimagerenderingintent(CObjRef mgck_wnd) { +int64_t f_magickgetimagerenderingintent(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Array f_magickgetimageresolution(CObjRef mgck_wnd) { +Array f_magickgetimageresolution(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -double f_magickgetimagescene(CObjRef mgck_wnd) { +double f_magickgetimagescene(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -String f_magickgetimagesignature(CObjRef mgck_wnd) { +String f_magickgetimagesignature(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetimagesize(CObjRef mgck_wnd) { +int64_t f_magickgetimagesize(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetimagetype(CObjRef mgck_wnd) { +int64_t f_magickgetimagetype(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetimageunits(CObjRef mgck_wnd) { +int64_t f_magickgetimageunits(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetimagevirtualpixelmethod(CObjRef mgck_wnd) { +int64_t f_magickgetimagevirtualpixelmethod(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Array f_magickgetimagewhitepoint(CObjRef mgck_wnd) { +Array f_magickgetimagewhitepoint(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -double f_magickgetimagewidth(CObjRef mgck_wnd) { +double f_magickgetimagewidth(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -String f_magickgetimagesblob(CObjRef mgck_wnd) { +String f_magickgetimagesblob(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -int64_t f_magickgetinterlacescheme(CObjRef mgck_wnd) { +int64_t f_magickgetinterlacescheme(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -double f_magickgetmaxtextadvance(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline /* = false */) { +double f_magickgetmaxtextadvance(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, + bool multiline /* = false */) { throw NotImplementedException(__func__); } -String f_magickgetmimetype(CObjRef mgck_wnd) { +String f_magickgetmimetype(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -double f_magickgetnumberimages(CObjRef mgck_wnd) { +double f_magickgetnumberimages(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Array f_magickgetsamplingfactors(CObjRef mgck_wnd) { +Array f_magickgetsamplingfactors(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -Array f_magickgetsize(CObjRef mgck_wnd) { +Array f_magickgetsize(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -double f_magickgetstringheight(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline /* = false */) { +double f_magickgetstringheight(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, + bool multiline /* = false */) { throw NotImplementedException(__func__); } -double f_magickgetstringwidth(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline /* = false */) { +double f_magickgetstringwidth(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, + bool multiline /* = false */) { throw NotImplementedException(__func__); } -double f_magickgettextascent(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline /* = false */) { +double f_magickgettextascent(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, + bool multiline /* = false */) { throw NotImplementedException(__func__); } -double f_magickgettextdescent(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline /* = false */) { +double f_magickgettextdescent(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, + bool multiline /* = false */) { throw NotImplementedException(__func__); } -Array f_magickgetwandsize(CObjRef mgck_wnd) { +Array f_magickgetwandsize(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickhasnextimage(CObjRef mgck_wnd) { +bool f_magickhasnextimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickhaspreviousimage(CObjRef mgck_wnd) { +bool f_magickhaspreviousimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickimplodeimage(CObjRef mgck_wnd, double amount) { +bool f_magickimplodeimage(CResRef mgck_wnd, double amount) { throw NotImplementedException(__func__); } -bool f_magicklabelimage(CObjRef mgck_wnd, CStrRef label) { +bool f_magicklabelimage(CResRef mgck_wnd, CStrRef label) { throw NotImplementedException(__func__); } -bool f_magicklevelimage(CObjRef mgck_wnd, double black_point, double gamma, double white_point, int channel_type /* = 0 */) { +bool f_magicklevelimage(CResRef mgck_wnd, double black_point, double gamma, + double white_point, int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -bool f_magickmagnifyimage(CObjRef mgck_wnd) { +bool f_magickmagnifyimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickmapimage(CObjRef mgck_wnd, CObjRef map_wand, bool dither) { +bool f_magickmapimage(CResRef mgck_wnd, CResRef map_wand, bool dither) { throw NotImplementedException(__func__); } -bool f_magickmattefloodfillimage(CObjRef mgck_wnd, double opacity, double fuzz, CObjRef bordercolor_pxl_wnd, int x, int y) { +bool f_magickmattefloodfillimage(CResRef mgck_wnd, double opacity, double fuzz, + CResRef bordercolor_pxl_wnd, int x, int y) { throw NotImplementedException(__func__); } -bool f_magickmedianfilterimage(CObjRef mgck_wnd, double radius) { +bool f_magickmedianfilterimage(CResRef mgck_wnd, double radius) { throw NotImplementedException(__func__); } -bool f_magickminifyimage(CObjRef mgck_wnd) { +bool f_magickminifyimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickmodulateimage(CObjRef mgck_wnd, double brightness, double saturation, double hue) { +bool f_magickmodulateimage(CResRef mgck_wnd, double brightness, + double saturation, double hue) { throw NotImplementedException(__func__); } -Object f_magickmontageimage(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef tile_geometry, CStrRef thumbnail_geometry, int montage_mode, CStrRef frame) { +Resource f_magickmontageimage(CResRef mgck_wnd, + CResRef drw_wnd, + CStrRef tile_geometry, + CStrRef thumbnail_geometry, + int montage_mode, + CStrRef frame) { throw NotImplementedException(__func__); } -Object f_magickmorphimages(CObjRef mgck_wnd, double number_frames) { +Resource f_magickmorphimages(CResRef mgck_wnd, double number_frames) { throw NotImplementedException(__func__); } -Object f_magickmosaicimages(CObjRef mgck_wnd) { +Resource f_magickmosaicimages(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickmotionblurimage(CObjRef mgck_wnd, double radius, double sigma, double angle) { +bool f_magickmotionblurimage(CResRef mgck_wnd, double radius, double sigma, + double angle) { throw NotImplementedException(__func__); } -bool f_magicknegateimage(CObjRef mgck_wnd, bool only_the_gray /* = false */, int channel_type /* = 0 */) { +bool f_magicknegateimage(CResRef mgck_wnd, bool only_the_gray /* = false */, + int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -bool f_magicknewimage(CObjRef mgck_wnd, double width, double height, CStrRef imagemagick_col_str /* = null_string */) { +bool f_magicknewimage(CResRef mgck_wnd, double width, double height, + CStrRef imagemagick_col_str /* = null_string */) { throw NotImplementedException(__func__); } -bool f_magicknextimage(CObjRef mgck_wnd) { +bool f_magicknextimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magicknormalizeimage(CObjRef mgck_wnd) { +bool f_magicknormalizeimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickoilpaintimage(CObjRef mgck_wnd, double radius) { +bool f_magickoilpaintimage(CResRef mgck_wnd, double radius) { throw NotImplementedException(__func__); } -bool f_magickpaintopaqueimage(CObjRef mgck_wnd, CObjRef target_pxl_wnd, CObjRef fill_pxl_wnd, double fuzz /* = 0.0 */) { +bool f_magickpaintopaqueimage(CResRef mgck_wnd, CResRef target_pxl_wnd, + CResRef fill_pxl_wnd, double fuzz /* = 0.0 */) { throw NotImplementedException(__func__); } -bool f_magickpainttransparentimage(CObjRef mgck_wnd, CObjRef target, double opacity /* = k_MW_TransparentOpacity */, double fuzz /* = 0.0 */) { +bool +f_magickpainttransparentimage(CResRef mgck_wnd, + CResRef target, + double opacity /* = k_MW_TransparentOpacity */, + double fuzz /* = 0.0 */) { throw NotImplementedException(__func__); } -bool f_magickpingimage(CObjRef mgck_wnd, CStrRef filename) { +bool f_magickpingimage(CResRef mgck_wnd, CStrRef filename) { throw NotImplementedException(__func__); } -bool f_magickposterizeimage(CObjRef mgck_wnd, double levels, bool dither) { +bool f_magickposterizeimage(CResRef mgck_wnd, double levels, bool dither) { throw NotImplementedException(__func__); } -Object f_magickpreviewimages(CObjRef mgck_wnd, int preview) { +Resource f_magickpreviewimages(CResRef mgck_wnd, int preview) { throw NotImplementedException(__func__); } -bool f_magickpreviousimage(CObjRef mgck_wnd) { +bool f_magickpreviousimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickprofileimage(CObjRef mgck_wnd, CStrRef name, CStrRef profile /* = null_string */) { +bool f_magickprofileimage(CResRef mgck_wnd, CStrRef name, CStrRef profile /* = null_string */) { throw NotImplementedException(__func__); } -bool f_magickquantizeimage(CObjRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error) { +bool f_magickquantizeimage(CResRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error) { throw NotImplementedException(__func__); } -bool f_magickquantizeimages(CObjRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error) { +bool f_magickquantizeimages(CResRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error) { throw NotImplementedException(__func__); } -Array f_magickqueryfontmetrics(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline /* = false */) { +Array f_magickqueryfontmetrics(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline /* = false */) { throw NotImplementedException(__func__); } -bool f_magickradialblurimage(CObjRef mgck_wnd, double angle) { +bool f_magickradialblurimage(CResRef mgck_wnd, double angle) { throw NotImplementedException(__func__); } -bool f_magickraiseimage(CObjRef mgck_wnd, double width, double height, int x, int y, bool raise) { +bool f_magickraiseimage(CResRef mgck_wnd, double width, double height, int x, int y, bool raise) { throw NotImplementedException(__func__); } -bool f_magickreadimage(CObjRef mgck_wnd, CStrRef filename) { +bool f_magickreadimage(CResRef mgck_wnd, CStrRef filename) { throw NotImplementedException(__func__); } -bool f_magickreadimageblob(CObjRef mgck_wnd, CStrRef blob) { +bool f_magickreadimageblob(CResRef mgck_wnd, CStrRef blob) { throw NotImplementedException(__func__); } -bool f_magickreadimagefile(CObjRef mgck_wnd, CObjRef handle) { +bool f_magickreadimagefile(CResRef mgck_wnd, CResRef handle) { throw NotImplementedException(__func__); } -bool f_magickreadimages(CObjRef mgck_wnd, CArrRef img_filenames_array) { +bool f_magickreadimages(CResRef mgck_wnd, CArrRef img_filenames_array) { throw NotImplementedException(__func__); } -bool f_magickreducenoiseimage(CObjRef mgck_wnd, double radius) { +bool f_magickreducenoiseimage(CResRef mgck_wnd, double radius) { throw NotImplementedException(__func__); } -bool f_magickremoveimage(CObjRef mgck_wnd) { +bool f_magickremoveimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -String f_magickremoveimageprofile(CObjRef mgck_wnd, CStrRef name) { +String f_magickremoveimageprofile(CResRef mgck_wnd, CStrRef name) { throw NotImplementedException(__func__); } -bool f_magickremoveimageprofiles(CObjRef mgck_wnd) { +bool f_magickremoveimageprofiles(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickresampleimage(CObjRef mgck_wnd, double x_resolution, double y_resolution, int filter_type, double blur) { +bool f_magickresampleimage(CResRef mgck_wnd, double x_resolution, double y_resolution, int filter_type, double blur) { throw NotImplementedException(__func__); } -void f_magickresetiterator(CObjRef mgck_wnd) { +void f_magickresetiterator(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickresizeimage(CObjRef mgck_wnd, double columns, double rows, int filter_type, double blur) { +bool f_magickresizeimage(CResRef mgck_wnd, double columns, double rows, int filter_type, double blur) { throw NotImplementedException(__func__); } -bool f_magickrollimage(CObjRef mgck_wnd, int x_offset, int y_offset) { +bool f_magickrollimage(CResRef mgck_wnd, int x_offset, int y_offset) { throw NotImplementedException(__func__); } -bool f_magickrotateimage(CObjRef mgck_wnd, CObjRef background, double degrees) { +bool f_magickrotateimage(CResRef mgck_wnd, CResRef background, double degrees) { throw NotImplementedException(__func__); } -bool f_magicksampleimage(CObjRef mgck_wnd, double columns, double rows) { +bool f_magicksampleimage(CResRef mgck_wnd, double columns, double rows) { throw NotImplementedException(__func__); } -bool f_magickscaleimage(CObjRef mgck_wnd, double columns, double rows) { +bool f_magickscaleimage(CResRef mgck_wnd, double columns, double rows) { throw NotImplementedException(__func__); } -bool f_magickseparateimagechannel(CObjRef mgck_wnd, int channel_type) { +bool f_magickseparateimagechannel(CResRef mgck_wnd, int channel_type) { throw NotImplementedException(__func__); } -bool f_magicksetcompressionquality(CObjRef mgck_wnd, double quality) { +bool f_magicksetcompressionquality(CResRef mgck_wnd, double quality) { throw NotImplementedException(__func__); } -bool f_magicksetfilename(CObjRef mgck_wnd, CStrRef filename /* = null_string */) { +bool f_magicksetfilename(CResRef mgck_wnd, CStrRef filename /* = null_string */) { throw NotImplementedException(__func__); } -void f_magicksetfirstiterator(CObjRef mgck_wnd) { +void f_magicksetfirstiterator(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magicksetformat(CObjRef mgck_wnd, CStrRef format) { +bool f_magicksetformat(CResRef mgck_wnd, CStrRef format) { throw NotImplementedException(__func__); } -bool f_magicksetimage(CObjRef mgck_wnd, CObjRef replace_wand) { +bool f_magicksetimage(CResRef mgck_wnd, CResRef replace_wand) { throw NotImplementedException(__func__); } -bool f_magicksetimagebackgroundcolor(CObjRef mgck_wnd, CObjRef background_pxl_wnd) { +bool f_magicksetimagebackgroundcolor(CResRef mgck_wnd, CResRef background_pxl_wnd) { throw NotImplementedException(__func__); } -bool f_magicksetimagebias(CObjRef mgck_wnd, double bias) { +bool f_magicksetimagebias(CResRef mgck_wnd, double bias) { throw NotImplementedException(__func__); } -bool f_magicksetimageblueprimary(CObjRef mgck_wnd, double x, double y) { +bool f_magicksetimageblueprimary(CResRef mgck_wnd, double x, double y) { throw NotImplementedException(__func__); } -bool f_magicksetimagebordercolor(CObjRef mgck_wnd, CObjRef border_pxl_wnd) { +bool f_magicksetimagebordercolor(CResRef mgck_wnd, CResRef border_pxl_wnd) { throw NotImplementedException(__func__); } -bool f_magicksetimagecolormapcolor(CObjRef mgck_wnd, double index, CObjRef mapcolor_pxl_wnd) { +bool f_magicksetimagecolormapcolor(CResRef mgck_wnd, double index, CResRef mapcolor_pxl_wnd) { throw NotImplementedException(__func__); } -bool f_magicksetimagecolorspace(CObjRef mgck_wnd, int colorspace_type) { +bool f_magicksetimagecolorspace(CResRef mgck_wnd, int colorspace_type) { throw NotImplementedException(__func__); } -bool f_magicksetimagecompose(CObjRef mgck_wnd, int composite_operator) { +bool f_magicksetimagecompose(CResRef mgck_wnd, int composite_operator) { throw NotImplementedException(__func__); } -bool f_magicksetimagecompression(CObjRef mgck_wnd, int compression_type) { +bool f_magicksetimagecompression(CResRef mgck_wnd, int compression_type) { throw NotImplementedException(__func__); } -bool f_magicksetimagecompressionquality(CObjRef mgck_wnd, double quality) { +bool f_magicksetimagecompressionquality(CResRef mgck_wnd, double quality) { throw NotImplementedException(__func__); } -bool f_magicksetimagedelay(CObjRef mgck_wnd, double delay) { +bool f_magicksetimagedelay(CResRef mgck_wnd, double delay) { throw NotImplementedException(__func__); } -bool f_magicksetimagedepth(CObjRef mgck_wnd, int depth, int channel_type /* = 0 */) { +bool f_magicksetimagedepth(CResRef mgck_wnd, int depth, int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -bool f_magicksetimagedispose(CObjRef mgck_wnd, int dispose_type) { +bool f_magicksetimagedispose(CResRef mgck_wnd, int dispose_type) { throw NotImplementedException(__func__); } -bool f_magicksetimagefilename(CObjRef mgck_wnd, CStrRef filename /* = null_string */) { +bool f_magicksetimagefilename(CResRef mgck_wnd, CStrRef filename /* = null_string */) { throw NotImplementedException(__func__); } -bool f_magicksetimageformat(CObjRef mgck_wnd, CStrRef format) { +bool f_magicksetimageformat(CResRef mgck_wnd, CStrRef format) { throw NotImplementedException(__func__); } -bool f_magicksetimagegamma(CObjRef mgck_wnd, double gamma) { +bool f_magicksetimagegamma(CResRef mgck_wnd, double gamma) { throw NotImplementedException(__func__); } -bool f_magicksetimagegreenprimary(CObjRef mgck_wnd, double x, double y) { +bool f_magicksetimagegreenprimary(CResRef mgck_wnd, double x, double y) { throw NotImplementedException(__func__); } -bool f_magicksetimageindex(CObjRef mgck_wnd, int index) { +bool f_magicksetimageindex(CResRef mgck_wnd, int index) { throw NotImplementedException(__func__); } -bool f_magicksetimageinterlacescheme(CObjRef mgck_wnd, int interlace_type) { +bool f_magicksetimageinterlacescheme(CResRef mgck_wnd, int interlace_type) { throw NotImplementedException(__func__); } -bool f_magicksetimageiterations(CObjRef mgck_wnd, double iterations) { +bool f_magicksetimageiterations(CResRef mgck_wnd, double iterations) { throw NotImplementedException(__func__); } -bool f_magicksetimagemattecolor(CObjRef mgck_wnd, CObjRef matte_pxl_wnd) { +bool f_magicksetimagemattecolor(CResRef mgck_wnd, CResRef matte_pxl_wnd) { throw NotImplementedException(__func__); } -bool f_magicksetimageoption(CObjRef mgck_wnd, CStrRef format, CStrRef key, CStrRef value) { +bool f_magicksetimageoption(CResRef mgck_wnd, CStrRef format, CStrRef key, CStrRef value) { throw NotImplementedException(__func__); } -bool f_magicksetimagepixels(CObjRef mgck_wnd, int x_offset, int y_offset, double columns, double rows, CStrRef smap, int storage_type, CArrRef pixel_array) { +bool f_magicksetimagepixels(CResRef mgck_wnd, int x_offset, int y_offset, double columns, double rows, CStrRef smap, int storage_type, CArrRef pixel_array) { throw NotImplementedException(__func__); } -bool f_magicksetimageprofile(CObjRef mgck_wnd, CStrRef name, CStrRef profile) { +bool f_magicksetimageprofile(CResRef mgck_wnd, CStrRef name, CStrRef profile) { throw NotImplementedException(__func__); } -bool f_magicksetimageredprimary(CObjRef mgck_wnd, double x, double y) { +bool f_magicksetimageredprimary(CResRef mgck_wnd, double x, double y) { throw NotImplementedException(__func__); } -bool f_magicksetimagerenderingintent(CObjRef mgck_wnd, int rendering_intent) { +bool f_magicksetimagerenderingintent(CResRef mgck_wnd, int rendering_intent) { throw NotImplementedException(__func__); } -bool f_magicksetimageresolution(CObjRef mgck_wnd, double x_resolution, double y_resolution) { +bool f_magicksetimageresolution(CResRef mgck_wnd, double x_resolution, double y_resolution) { throw NotImplementedException(__func__); } -bool f_magicksetimagescene(CObjRef mgck_wnd, double scene) { +bool f_magicksetimagescene(CResRef mgck_wnd, double scene) { throw NotImplementedException(__func__); } -bool f_magicksetimagetype(CObjRef mgck_wnd, int image_type) { +bool f_magicksetimagetype(CResRef mgck_wnd, int image_type) { throw NotImplementedException(__func__); } -bool f_magicksetimageunits(CObjRef mgck_wnd, int resolution_type) { +bool f_magicksetimageunits(CResRef mgck_wnd, int resolution_type) { throw NotImplementedException(__func__); } -bool f_magicksetimagevirtualpixelmethod(CObjRef mgck_wnd, int virtual_pixel_method) { +bool f_magicksetimagevirtualpixelmethod(CResRef mgck_wnd, int virtual_pixel_method) { throw NotImplementedException(__func__); } -bool f_magicksetimagewhitepoint(CObjRef mgck_wnd, double x, double y) { +bool f_magicksetimagewhitepoint(CResRef mgck_wnd, double x, double y) { throw NotImplementedException(__func__); } -bool f_magicksetinterlacescheme(CObjRef mgck_wnd, int interlace_type) { +bool f_magicksetinterlacescheme(CResRef mgck_wnd, int interlace_type) { throw NotImplementedException(__func__); } -void f_magicksetlastiterator(CObjRef mgck_wnd) { +void f_magicksetlastiterator(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magicksetpassphrase(CObjRef mgck_wnd, CStrRef passphrase) { +bool f_magicksetpassphrase(CResRef mgck_wnd, CStrRef passphrase) { throw NotImplementedException(__func__); } -bool f_magicksetresolution(CObjRef mgck_wnd, double x_resolution, double y_resolution) { +bool f_magicksetresolution(CResRef mgck_wnd, double x_resolution, double y_resolution) { throw NotImplementedException(__func__); } -bool f_magicksetsamplingfactors(CObjRef mgck_wnd, double number_factors, CArrRef sampling_factors) { +bool f_magicksetsamplingfactors(CResRef mgck_wnd, double number_factors, CArrRef sampling_factors) { throw NotImplementedException(__func__); } -bool f_magicksetsize(CObjRef mgck_wnd, int columns, int rows) { +bool f_magicksetsize(CResRef mgck_wnd, int columns, int rows) { throw NotImplementedException(__func__); } -bool f_magicksetwandsize(CObjRef mgck_wnd, int columns, int rows) { +bool f_magicksetwandsize(CResRef mgck_wnd, int columns, int rows) { throw NotImplementedException(__func__); } -bool f_magicksharpenimage(CObjRef mgck_wnd, double radius, double sigma, int channel_type /* = 0 */) { +bool f_magicksharpenimage(CResRef mgck_wnd, double radius, double sigma, int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -bool f_magickshaveimage(CObjRef mgck_wnd, int columns, int rows) { +bool f_magickshaveimage(CResRef mgck_wnd, int columns, int rows) { throw NotImplementedException(__func__); } -bool f_magickshearimage(CObjRef mgck_wnd, CObjRef background, double x_shear, double y_shear) { +bool f_magickshearimage(CResRef mgck_wnd, CResRef background, double x_shear, double y_shear) { throw NotImplementedException(__func__); } -bool f_magicksolarizeimage(CObjRef mgck_wnd, double threshold) { +bool f_magicksolarizeimage(CResRef mgck_wnd, double threshold) { throw NotImplementedException(__func__); } -bool f_magickspliceimage(CObjRef mgck_wnd, double width, double height, int x, int y) { +bool f_magickspliceimage(CResRef mgck_wnd, double width, double height, int x, int y) { throw NotImplementedException(__func__); } -bool f_magickspreadimage(CObjRef mgck_wnd, double radius) { +bool f_magickspreadimage(CResRef mgck_wnd, double radius) { throw NotImplementedException(__func__); } -Object f_magicksteganoimage(CObjRef mgck_wnd, CObjRef watermark_wand, int offset) { +Resource f_magicksteganoimage(CResRef mgck_wnd, CResRef watermark_wand, int offset) { throw NotImplementedException(__func__); } -bool f_magickstereoimage(CObjRef mgck_wnd, CObjRef offset_wand) { +bool f_magickstereoimage(CResRef mgck_wnd, CResRef offset_wand) { throw NotImplementedException(__func__); } -bool f_magickstripimage(CObjRef mgck_wnd) { +bool f_magickstripimage(CResRef mgck_wnd) { throw NotImplementedException(__func__); } -bool f_magickswirlimage(CObjRef mgck_wnd, double degrees) { +bool f_magickswirlimage(CResRef mgck_wnd, double degrees) { throw NotImplementedException(__func__); } -Object f_magicktextureimage(CObjRef mgck_wnd, CObjRef texture_wand) { +Resource f_magicktextureimage(CResRef mgck_wnd, CResRef texture_wand) { throw NotImplementedException(__func__); } -bool f_magickthresholdimage(CObjRef mgck_wnd, double threshold, int channel_type /* = 0 */) { +bool f_magickthresholdimage(CResRef mgck_wnd, double threshold, int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -bool f_magicktintimage(CObjRef mgck_wnd, int tint_pxl_wnd, CObjRef opacity_pxl_wnd) { +bool f_magicktintimage(CResRef mgck_wnd, int tint_pxl_wnd, CResRef opacity_pxl_wnd) { throw NotImplementedException(__func__); } -Object f_magicktransformimage(CObjRef mgck_wnd, CStrRef crop, CStrRef geometry) { +Resource f_magicktransformimage(CResRef mgck_wnd, CStrRef crop, CStrRef geometry) { throw NotImplementedException(__func__); } -bool f_magicktrimimage(CObjRef mgck_wnd, double fuzz) { +bool f_magicktrimimage(CResRef mgck_wnd, double fuzz) { throw NotImplementedException(__func__); } -bool f_magickunsharpmaskimage(CObjRef mgck_wnd, double radius, double sigma, double amount, double threshold, int channel_type /* = 0 */) { +bool f_magickunsharpmaskimage(CResRef mgck_wnd, double radius, double sigma, double amount, double threshold, int channel_type /* = 0 */) { throw NotImplementedException(__func__); } -bool f_magickwaveimage(CObjRef mgck_wnd, double amplitude, double wave_length) { +bool f_magickwaveimage(CResRef mgck_wnd, double amplitude, double wave_length) { throw NotImplementedException(__func__); } -bool f_magickwhitethresholdimage(CObjRef mgck_wnd, CObjRef threshold_pxl_wnd) { +bool f_magickwhitethresholdimage(CResRef mgck_wnd, CResRef threshold_pxl_wnd) { throw NotImplementedException(__func__); } -bool f_magickwriteimage(CObjRef mgck_wnd, CStrRef filename) { +bool f_magickwriteimage(CResRef mgck_wnd, CStrRef filename) { throw NotImplementedException(__func__); } -bool f_magickwriteimagefile(CObjRef mgck_wnd, CObjRef handle) { +bool f_magickwriteimagefile(CResRef mgck_wnd, CResRef handle) { throw NotImplementedException(__func__); } -bool f_magickwriteimages(CObjRef mgck_wnd, CStrRef filename /* = "" */, bool join_images /* = false */) { +bool f_magickwriteimages(CResRef mgck_wnd, CStrRef filename /* = "" */, bool join_images /* = false */) { throw NotImplementedException(__func__); } -bool f_magickwriteimagesfile(CObjRef mgck_wnd, CObjRef handle) { +bool f_magickwriteimagesfile(CResRef mgck_wnd, CResRef handle) { throw NotImplementedException(__func__); } -double f_pixelgetalpha(CObjRef pxl_wnd) { +double f_pixelgetalpha(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetalphaquantum(CObjRef pxl_wnd) { +double f_pixelgetalphaquantum(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetblack(CObjRef pxl_wnd) { +double f_pixelgetblack(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetblackquantum(CObjRef pxl_wnd) { +double f_pixelgetblackquantum(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetblue(CObjRef pxl_wnd) { +double f_pixelgetblue(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetbluequantum(CObjRef pxl_wnd) { +double f_pixelgetbluequantum(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -String f_pixelgetcolorasstring(CObjRef pxl_wnd) { +String f_pixelgetcolorasstring(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetcolorcount(CObjRef pxl_wnd) { +double f_pixelgetcolorcount(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetcyan(CObjRef pxl_wnd) { +double f_pixelgetcyan(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetcyanquantum(CObjRef pxl_wnd) { +double f_pixelgetcyanquantum(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -Array f_pixelgetexception(CObjRef pxl_wnd) { +Array f_pixelgetexception(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -String f_pixelgetexceptionstring(CObjRef pxl_wnd) { +String f_pixelgetexceptionstring(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -int64_t f_pixelgetexceptiontype(CObjRef pxl_wnd) { +int64_t f_pixelgetexceptiontype(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetgreen(CObjRef pxl_wnd) { +double f_pixelgetgreen(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetgreenquantum(CObjRef pxl_wnd) { +double f_pixelgetgreenquantum(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetindex(CObjRef pxl_wnd) { +double f_pixelgetindex(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetmagenta(CObjRef pxl_wnd) { +double f_pixelgetmagenta(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetmagentaquantum(CObjRef pxl_wnd) { +double f_pixelgetmagentaquantum(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetopacity(CObjRef pxl_wnd) { +double f_pixelgetopacity(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetopacityquantum(CObjRef pxl_wnd) { +double f_pixelgetopacityquantum(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -Array f_pixelgetquantumcolor(CObjRef pxl_wnd) { +Array f_pixelgetquantumcolor(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetred(CObjRef pxl_wnd) { +double f_pixelgetred(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetredquantum(CObjRef pxl_wnd) { +double f_pixelgetredquantum(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetyellow(CObjRef pxl_wnd) { +double f_pixelgetyellow(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -double f_pixelgetyellowquantum(CObjRef pxl_wnd) { +double f_pixelgetyellowquantum(CResRef pxl_wnd) { throw NotImplementedException(__func__); } -void f_pixelsetalpha(CObjRef pxl_wnd, double alpha) { +void f_pixelsetalpha(CResRef pxl_wnd, double alpha) { throw NotImplementedException(__func__); } -void f_pixelsetalphaquantum(CObjRef pxl_wnd, double alpha) { +void f_pixelsetalphaquantum(CResRef pxl_wnd, double alpha) { throw NotImplementedException(__func__); } -void f_pixelsetblack(CObjRef pxl_wnd, double black) { +void f_pixelsetblack(CResRef pxl_wnd, double black) { throw NotImplementedException(__func__); } -void f_pixelsetblackquantum(CObjRef pxl_wnd, double black) { +void f_pixelsetblackquantum(CResRef pxl_wnd, double black) { throw NotImplementedException(__func__); } -void f_pixelsetblue(CObjRef pxl_wnd, double blue) { +void f_pixelsetblue(CResRef pxl_wnd, double blue) { throw NotImplementedException(__func__); } -void f_pixelsetbluequantum(CObjRef pxl_wnd, double blue) { +void f_pixelsetbluequantum(CResRef pxl_wnd, double blue) { throw NotImplementedException(__func__); } -void f_pixelsetcolor(CObjRef pxl_wnd, CStrRef imagemagick_col_str) { +void f_pixelsetcolor(CResRef pxl_wnd, CStrRef imagemagick_col_str) { throw NotImplementedException(__func__); } -void f_pixelsetcolorcount(CObjRef pxl_wnd, int count) { +void f_pixelsetcolorcount(CResRef pxl_wnd, int count) { throw NotImplementedException(__func__); } -void f_pixelsetcyan(CObjRef pxl_wnd, double cyan) { +void f_pixelsetcyan(CResRef pxl_wnd, double cyan) { throw NotImplementedException(__func__); } -void f_pixelsetcyanquantum(CObjRef pxl_wnd, double cyan) { +void f_pixelsetcyanquantum(CResRef pxl_wnd, double cyan) { throw NotImplementedException(__func__); } -void f_pixelsetgreen(CObjRef pxl_wnd, double green) { +void f_pixelsetgreen(CResRef pxl_wnd, double green) { throw NotImplementedException(__func__); } -void f_pixelsetgreenquantum(CObjRef pxl_wnd, double green) { +void f_pixelsetgreenquantum(CResRef pxl_wnd, double green) { throw NotImplementedException(__func__); } -void f_pixelsetindex(CObjRef pxl_wnd, double index) { +void f_pixelsetindex(CResRef pxl_wnd, double index) { throw NotImplementedException(__func__); } -void f_pixelsetmagenta(CObjRef pxl_wnd, double magenta) { +void f_pixelsetmagenta(CResRef pxl_wnd, double magenta) { throw NotImplementedException(__func__); } -void f_pixelsetmagentaquantum(CObjRef pxl_wnd, double magenta) { +void f_pixelsetmagentaquantum(CResRef pxl_wnd, double magenta) { throw NotImplementedException(__func__); } -void f_pixelsetopacity(CObjRef pxl_wnd, double opacity) { +void f_pixelsetopacity(CResRef pxl_wnd, double opacity) { throw NotImplementedException(__func__); } -void f_pixelsetopacityquantum(CObjRef pxl_wnd, double opacity) { +void f_pixelsetopacityquantum(CResRef pxl_wnd, double opacity) { throw NotImplementedException(__func__); } -void f_pixelsetquantumcolor(CObjRef pxl_wnd, double red, double green, double blue, double opacity /* = 0.0 */) { +void f_pixelsetquantumcolor(CResRef pxl_wnd, double red, double green, double blue, double opacity /* = 0.0 */) { throw NotImplementedException(__func__); } -void f_pixelsetred(CObjRef pxl_wnd, double red) { +void f_pixelsetred(CResRef pxl_wnd, double red) { throw NotImplementedException(__func__); } -void f_pixelsetredquantum(CObjRef pxl_wnd, double red) { +void f_pixelsetredquantum(CResRef pxl_wnd, double red) { throw NotImplementedException(__func__); } -void f_pixelsetyellow(CObjRef pxl_wnd, double yellow) { +void f_pixelsetyellow(CResRef pxl_wnd, double yellow) { throw NotImplementedException(__func__); } -void f_pixelsetyellowquantum(CObjRef pxl_wnd, double yellow) { +void f_pixelsetyellowquantum(CResRef pxl_wnd, double yellow) { throw NotImplementedException(__func__); } -Array f_pixelgetiteratorexception(CObjRef pxl_iter) { +Array f_pixelgetiteratorexception(CResRef pxl_iter) { throw NotImplementedException(__func__); } -String f_pixelgetiteratorexceptionstring(CObjRef pxl_iter) { +String f_pixelgetiteratorexceptionstring(CResRef pxl_iter) { throw NotImplementedException(__func__); } -int64_t f_pixelgetiteratorexceptiontype(CObjRef pxl_iter) { +int64_t f_pixelgetiteratorexceptiontype(CResRef pxl_iter) { throw NotImplementedException(__func__); } -Array f_pixelgetnextiteratorrow(CObjRef pxl_iter) { +Array f_pixelgetnextiteratorrow(CResRef pxl_iter) { throw NotImplementedException(__func__); } -void f_pixelresetiterator(CObjRef pxl_iter) { +void f_pixelresetiterator(CResRef pxl_iter) { throw NotImplementedException(__func__); } -bool f_pixelsetiteratorrow(CObjRef pxl_iter, int row) { +bool f_pixelsetiteratorrow(CResRef pxl_iter, int row) { throw NotImplementedException(__func__); } -bool f_pixelsynciterator(CObjRef pxl_iter) { +bool f_pixelsynciterator(CResRef pxl_iter) { throw NotImplementedException(__func__); } diff --git a/hphp/runtime/ext/ext_magick.h b/hphp/runtime/ext/ext_magick.h index 50c6b03e7..7601e14a3 100644 --- a/hphp/runtime/ext/ext_magick.h +++ b/hphp/runtime/ext/ext_magick.h @@ -39,420 +39,420 @@ Array f_magickqueryconfigureoptions(CStrRef pattern); Array f_magickqueryfonts(CStrRef pattern); Array f_magickqueryformats(CStrRef pattern); bool f_magicksetresourcelimit(int resource_type, double limit); -Object f_newdrawingwand(); -Object f_newmagickwand(); -Object f_newpixeliterator(CObjRef mgck_wnd); -Object f_newpixelregioniterator(CObjRef mgck_wnd, int x, int y, int columns, int rows); -Object f_newpixelwand(CStrRef imagemagick_col_str = null_string); +Resource f_newdrawingwand(); +Resource f_newmagickwand(); +Resource f_newpixeliterator(CResRef mgck_wnd); +Resource f_newpixelregioniterator(CResRef mgck_wnd, int x, int y, int columns, int rows); +Resource f_newpixelwand(CStrRef imagemagick_col_str = null_string); Array f_newpixelwandarray(int num_pxl_wnds); Array f_newpixelwands(int num_pxl_wnds); -void f_destroydrawingwand(CObjRef drw_wnd); -void f_destroymagickwand(CObjRef mgck_wnd); -void f_destroypixeliterator(CObjRef pxl_iter); -void f_destroypixelwand(CObjRef pxl_wnd); +void f_destroydrawingwand(CResRef drw_wnd); +void f_destroymagickwand(CResRef mgck_wnd); +void f_destroypixeliterator(CResRef pxl_iter); +void f_destroypixelwand(CResRef pxl_wnd); void f_destroypixelwandarray(CArrRef pxl_wnd_array); void f_destroypixelwands(CArrRef pxl_wnd_array); bool f_isdrawingwand(CVarRef var); bool f_ismagickwand(CVarRef var); bool f_ispixeliterator(CVarRef var); bool f_ispixelwand(CVarRef var); -void f_cleardrawingwand(CObjRef drw_wnd); -void f_clearmagickwand(CObjRef mgck_wnd); -void f_clearpixeliterator(CObjRef pxl_iter); -void f_clearpixelwand(CObjRef pxl_wnd); -Object f_clonedrawingwand(CObjRef drw_wnd); -Object f_clonemagickwand(CObjRef mgck_wnd); -Array f_wandgetexception(CObjRef wnd); -String f_wandgetexceptionstring(CObjRef wnd); -int64_t f_wandgetexceptiontype(CObjRef wnd); -bool f_wandhasexception(CObjRef wnd); -void f_drawaffine(CObjRef drw_wnd, double sx, double sy, double rx, double ry, double tx, double ty); -void f_drawannotation(CObjRef drw_wnd, double x, double y, CStrRef text); -void f_drawarc(CObjRef drw_wnd, double sx, double sy, double ex, double ey, double sd, double ed); -void f_drawbezier(CObjRef drw_wnd, CArrRef x_y_points_array); -void f_drawcircle(CObjRef drw_wnd, double ox, double oy, double px, double py); -void f_drawcolor(CObjRef drw_wnd, double x, double y, int paint_method); -void f_drawcomment(CObjRef drw_wnd, CStrRef comment); -bool f_drawcomposite(CObjRef drw_wnd, int composite_operator, double x, double y, double width, double height, CObjRef mgck_wnd); -void f_drawellipse(CObjRef drw_wnd, double ox, double oy, double rx, double ry, double start, double end); -String f_drawgetclippath(CObjRef drw_wnd); -int64_t f_drawgetcliprule(CObjRef drw_wnd); -int64_t f_drawgetclipunits(CObjRef drw_wnd); -Array f_drawgetexception(CObjRef drw_wnd); -String f_drawgetexceptionstring(CObjRef drw_wnd); -int64_t f_drawgetexceptiontype(CObjRef drw_wnd); -double f_drawgetfillalpha(CObjRef drw_wnd); -Object f_drawgetfillcolor(CObjRef drw_wnd); -double f_drawgetfillopacity(CObjRef drw_wnd); -int64_t f_drawgetfillrule(CObjRef drw_wnd); -String f_drawgetfont(CObjRef drw_wnd); -String f_drawgetfontfamily(CObjRef drw_wnd); -double f_drawgetfontsize(CObjRef drw_wnd); -int64_t f_drawgetfontstretch(CObjRef drw_wnd); -int64_t f_drawgetfontstyle(CObjRef drw_wnd); -double f_drawgetfontweight(CObjRef drw_wnd); -int64_t f_drawgetgravity(CObjRef drw_wnd); -double f_drawgetstrokealpha(CObjRef drw_wnd); -bool f_drawgetstrokeantialias(CObjRef drw_wnd); -Object f_drawgetstrokecolor(CObjRef drw_wnd); -Array f_drawgetstrokedasharray(CObjRef drw_wnd); -double f_drawgetstrokedashoffset(CObjRef drw_wnd); -int64_t f_drawgetstrokelinecap(CObjRef drw_wnd); -int64_t f_drawgetstrokelinejoin(CObjRef drw_wnd); -double f_drawgetstrokemiterlimit(CObjRef drw_wnd); -double f_drawgetstrokeopacity(CObjRef drw_wnd); -double f_drawgetstrokewidth(CObjRef drw_wnd); -int64_t f_drawgettextalignment(CObjRef drw_wnd); -bool f_drawgettextantialias(CObjRef drw_wnd); -int64_t f_drawgettextdecoration(CObjRef drw_wnd); -String f_drawgettextencoding(CObjRef drw_wnd); -Object f_drawgettextundercolor(CObjRef drw_wnd); -String f_drawgetvectorgraphics(CObjRef drw_wnd); -void f_drawline(CObjRef drw_wnd, double sx, double sy, double ex, double ey); -void f_drawmatte(CObjRef drw_wnd, double x, double y, int paint_method); -void f_drawpathclose(CObjRef drw_wnd); -void f_drawpathcurvetoabsolute(CObjRef drw_wnd, double x1, double y1, double x2, double y2, double x, double y); -void f_drawpathcurvetoquadraticbezierabsolute(CObjRef drw_wnd, double x1, double y1, double x, double y); -void f_drawpathcurvetoquadraticbezierrelative(CObjRef drw_wnd, double x1, double y1, double x, double y); -void f_drawpathcurvetoquadraticbeziersmoothabsolute(CObjRef drw_wnd, double x, double y); -void f_drawpathcurvetoquadraticbeziersmoothrelative(CObjRef drw_wnd, double x, double y); -void f_drawpathcurvetorelative(CObjRef drw_wnd, double x1, double y1, double x2, double y2, double x, double y); -void f_drawpathcurvetosmoothabsolute(CObjRef drw_wnd, double x2, double y2, double x, double y); -void f_drawpathcurvetosmoothrelative(CObjRef drw_wnd, double x2, double y2, double x, double y); -void f_drawpathellipticarcabsolute(CObjRef drw_wnd, double rx, double ry, double x_axis_rotation, bool large_arc_flag, bool sweep_flag, double x, double y); -void f_drawpathellipticarcrelative(CObjRef drw_wnd, double rx, double ry, double x_axis_rotation, bool large_arc_flag, bool sweep_flag, double x, double y); -void f_drawpathfinish(CObjRef drw_wnd); -void f_drawpathlinetoabsolute(CObjRef drw_wnd, double x, double y); -void f_drawpathlinetohorizontalabsolute(CObjRef drw_wnd, double x); -void f_drawpathlinetohorizontalrelative(CObjRef drw_wnd, double x); -void f_drawpathlinetorelative(CObjRef drw_wnd, double x, double y); -void f_drawpathlinetoverticalabsolute(CObjRef drw_wnd, double y); -void f_drawpathlinetoverticalrelative(CObjRef drw_wnd, double y); -void f_drawpathmovetoabsolute(CObjRef drw_wnd, double x, double y); -void f_drawpathmovetorelative(CObjRef drw_wnd, double x, double y); -void f_drawpathstart(CObjRef drw_wnd); -void f_drawpoint(CObjRef drw_wnd, double x, double y); -void f_drawpolygon(CObjRef drw_wnd, CArrRef x_y_points_array); -void f_drawpolyline(CObjRef drw_wnd, CArrRef x_y_points_array); -void f_drawrectangle(CObjRef drw_wnd, double x1, double y1, double x2, double y2); -bool f_drawrender(CObjRef drw_wnd); -void f_drawrotate(CObjRef drw_wnd, double degrees); -void f_drawroundrectangle(CObjRef drw_wnd, double x1, double y1, double x2, double y2, double rx, double ry); -void f_drawscale(CObjRef drw_wnd, double x, double y); -bool f_drawsetclippath(CObjRef drw_wnd, CStrRef clip_path); -void f_drawsetcliprule(CObjRef drw_wnd, int fill_rule); -void f_drawsetclipunits(CObjRef drw_wnd, int clip_path_units); -void f_drawsetfillalpha(CObjRef drw_wnd, double fill_opacity); -void f_drawsetfillcolor(CObjRef drw_wnd, CObjRef fill_pxl_wnd); -void f_drawsetfillopacity(CObjRef drw_wnd, double fill_opacity); -bool f_drawsetfillpatternurl(CObjRef drw_wnd, CStrRef fill_url); -void f_drawsetfillrule(CObjRef drw_wnd, int fill_rule); -bool f_drawsetfont(CObjRef drw_wnd, CStrRef font_file); -bool f_drawsetfontfamily(CObjRef drw_wnd, CStrRef font_family); -void f_drawsetfontsize(CObjRef drw_wnd, double pointsize); -void f_drawsetfontstretch(CObjRef drw_wnd, int stretch_type); -void f_drawsetfontstyle(CObjRef drw_wnd, int style_type); -void f_drawsetfontweight(CObjRef drw_wnd, double font_weight); -void f_drawsetgravity(CObjRef drw_wnd, int gravity_type); -void f_drawsetstrokealpha(CObjRef drw_wnd, double stroke_opacity); -void f_drawsetstrokeantialias(CObjRef drw_wnd, bool stroke_antialias = true); -void f_drawsetstrokecolor(CObjRef drw_wnd, CObjRef strokecolor_pxl_wnd); -void f_drawsetstrokedasharray(CObjRef drw_wnd, CArrRef dash_array = null_array); -void f_drawsetstrokedashoffset(CObjRef drw_wnd, double dash_offset); -void f_drawsetstrokelinecap(CObjRef drw_wnd, int line_cap); -void f_drawsetstrokelinejoin(CObjRef drw_wnd, int line_join); -void f_drawsetstrokemiterlimit(CObjRef drw_wnd, double miterlimit); -void f_drawsetstrokeopacity(CObjRef drw_wnd, double stroke_opacity); -bool f_drawsetstrokepatternurl(CObjRef drw_wnd, CStrRef stroke_url); -void f_drawsetstrokewidth(CObjRef drw_wnd, double stroke_width); -void f_drawsettextalignment(CObjRef drw_wnd, int align_type); -void f_drawsettextantialias(CObjRef drw_wnd, bool text_antialias = true); -void f_drawsettextdecoration(CObjRef drw_wnd, int decoration_type); -void f_drawsettextencoding(CObjRef drw_wnd, CStrRef encoding); -void f_drawsettextundercolor(CObjRef drw_wnd, CObjRef undercolor_pxl_wnd); -bool f_drawsetvectorgraphics(CObjRef drw_wnd, CStrRef vector_graphics); -void f_drawsetviewbox(CObjRef drw_wnd, double x1, double y1, double x2, double y2); -void f_drawskewx(CObjRef drw_wnd, double degrees); -void f_drawskewy(CObjRef drw_wnd, double degrees); -void f_drawtranslate(CObjRef drw_wnd, double x, double y); -void f_pushdrawingwand(CObjRef drw_wnd); -void f_drawpushclippath(CObjRef drw_wnd, CStrRef clip_path_id); -void f_drawpushdefs(CObjRef drw_wnd); -void f_drawpushpattern(CObjRef drw_wnd, CStrRef pattern_id, double x, double y, double width, double height); -void f_popdrawingwand(CObjRef drw_wnd); -void f_drawpopclippath(CObjRef drw_wnd); -void f_drawpopdefs(CObjRef drw_wnd); -void f_drawpoppattern(CObjRef drw_wnd); -bool f_magickadaptivethresholdimage(CObjRef mgck_wnd, double width, double height, double offset); -bool f_magickaddimage(CObjRef mgck_wnd, CObjRef add_wand); -bool f_magickaddnoiseimage(CObjRef mgck_wnd, int noise_type); -bool f_magickaffinetransformimage(CObjRef mgck_wnd, CObjRef drw_wnd); -bool f_magickannotateimage(CObjRef mgck_wnd, CObjRef drw_wnd, double x, double y, double angle, CStrRef text); -Object f_magickappendimages(CObjRef mgck_wnd, bool stack_vertical = false); -Object f_magickaverageimages(CObjRef mgck_wnd); -bool f_magickblackthresholdimage(CObjRef mgck_wnd, CObjRef threshold_pxl_wnd); -bool f_magickblurimage(CObjRef mgck_wnd, double radius, double sigma, int channel_type = 0); -bool f_magickborderimage(CObjRef mgck_wnd, CObjRef bordercolor, double width, double height); -bool f_magickcharcoalimage(CObjRef mgck_wnd, double radius, double sigma); -bool f_magickchopimage(CObjRef mgck_wnd, double width, double height, int x, int y); -bool f_magickclipimage(CObjRef mgck_wnd); -bool f_magickclippathimage(CObjRef mgck_wnd, CStrRef pathname, bool inside); -Object f_magickcoalesceimages(CObjRef mgck_wnd); -bool f_magickcolorfloodfillimage(CObjRef mgck_wnd, CObjRef fillcolor_pxl_wnd, double fuzz, CObjRef bordercolor_pxl_wnd, int x, int y); -bool f_magickcolorizeimage(CObjRef mgck_wnd, CObjRef colorize, CObjRef opacity_pxl_wnd); -Object f_magickcombineimages(CObjRef mgck_wnd, int channel_type); -bool f_magickcommentimage(CObjRef mgck_wnd, CStrRef comment); -Array f_magickcompareimages(CObjRef mgck_wnd, CObjRef reference_wnd, int metric_type, int channel_type = 0); -bool f_magickcompositeimage(CObjRef mgck_wnd, CObjRef composite_wnd, int composite_operator, int x, int y); -bool f_magickconstituteimage(CObjRef mgck_wnd, double columns, double rows, CStrRef smap, int storage_type, CArrRef pixel_array); -bool f_magickcontrastimage(CObjRef mgck_wnd, bool sharpen); -bool f_magickconvolveimage(CObjRef mgck_wnd, CArrRef kernel_array, int channel_type = 0); -bool f_magickcropimage(CObjRef mgck_wnd, double width, double height, int x, int y); -bool f_magickcyclecolormapimage(CObjRef mgck_wnd, int num_positions); -Object f_magickdeconstructimages(CObjRef mgck_wnd); -String f_magickdescribeimage(CObjRef mgck_wnd); -bool f_magickdespeckleimage(CObjRef mgck_wnd); -bool f_magickdrawimage(CObjRef mgck_wnd, CObjRef drw_wnd); -bool f_magickechoimageblob(CObjRef mgck_wnd); -bool f_magickechoimagesblob(CObjRef mgck_wnd); -bool f_magickedgeimage(CObjRef mgck_wnd, double radius); -bool f_magickembossimage(CObjRef mgck_wnd, double radius, double sigma); -bool f_magickenhanceimage(CObjRef mgck_wnd); -bool f_magickequalizeimage(CObjRef mgck_wnd); -bool f_magickevaluateimage(CObjRef mgck_wnd, int evaluate_op, double constant, int channel_type = 0); -Object f_magickflattenimages(CObjRef mgck_wnd); -bool f_magickflipimage(CObjRef mgck_wnd); -bool f_magickflopimage(CObjRef mgck_wnd); -bool f_magickframeimage(CObjRef mgck_wnd, CObjRef matte_color, double width, double height, int inner_bevel, int outer_bevel); -Object f_magickfximage(CObjRef mgck_wnd, CStrRef expression, int channel_type = 0); -bool f_magickgammaimage(CObjRef mgck_wnd, double gamma, int channel_type = 0); -bool f_magickgaussianblurimage(CObjRef mgck_wnd, double radius, double sigma, int channel_type = 0); -double f_magickgetcharheight(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false); -double f_magickgetcharwidth(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false); -Array f_magickgetexception(CObjRef mgck_wnd); -String f_magickgetexceptionstring(CObjRef mgck_wnd); -int64_t f_magickgetexceptiontype(CObjRef mgck_wnd); -String f_magickgetfilename(CObjRef mgck_wnd); -String f_magickgetformat(CObjRef mgck_wnd); -Object f_magickgetimage(CObjRef mgck_wnd); -Object f_magickgetimagebackgroundcolor(CObjRef mgck_wnd); -String f_magickgetimageblob(CObjRef mgck_wnd); -Array f_magickgetimageblueprimary(CObjRef mgck_wnd); -Object f_magickgetimagebordercolor(CObjRef mgck_wnd); -Array f_magickgetimagechannelmean(CObjRef mgck_wnd, int channel_type); -Object f_magickgetimagecolormapcolor(CObjRef mgck_wnd, double index); -double f_magickgetimagecolors(CObjRef mgck_wnd); -int64_t f_magickgetimagecolorspace(CObjRef mgck_wnd); -int64_t f_magickgetimagecompose(CObjRef mgck_wnd); -int64_t f_magickgetimagecompression(CObjRef mgck_wnd); -double f_magickgetimagecompressionquality(CObjRef mgck_wnd); -double f_magickgetimagedelay(CObjRef mgck_wnd); -double f_magickgetimagedepth(CObjRef mgck_wnd, int channel_type = 0); -int64_t f_magickgetimagedispose(CObjRef mgck_wnd); -Array f_magickgetimageextrema(CObjRef mgck_wnd, int channel_type = 0); -String f_magickgetimagefilename(CObjRef mgck_wnd); -String f_magickgetimageformat(CObjRef mgck_wnd); -double f_magickgetimagegamma(CObjRef mgck_wnd); -Array f_magickgetimagegreenprimary(CObjRef mgck_wnd); -double f_magickgetimageheight(CObjRef mgck_wnd); -Array f_magickgetimagehistogram(CObjRef mgck_wnd); -int64_t f_magickgetimageindex(CObjRef mgck_wnd); -int64_t f_magickgetimageinterlacescheme(CObjRef mgck_wnd); -double f_magickgetimageiterations(CObjRef mgck_wnd); -Object f_magickgetimagemattecolor(CObjRef mgck_wnd); -String f_magickgetimagemimetype(CObjRef mgck_wnd); -Array f_magickgetimagepixels(CObjRef mgck_wnd, int x_offset, int y_offset, double columns, double rows, CStrRef smap, int storage_type); -String f_magickgetimageprofile(CObjRef mgck_wnd, CStrRef name); -Array f_magickgetimageredprimary(CObjRef mgck_wnd); -int64_t f_magickgetimagerenderingintent(CObjRef mgck_wnd); -Array f_magickgetimageresolution(CObjRef mgck_wnd); -double f_magickgetimagescene(CObjRef mgck_wnd); -String f_magickgetimagesignature(CObjRef mgck_wnd); -int64_t f_magickgetimagesize(CObjRef mgck_wnd); -int64_t f_magickgetimagetype(CObjRef mgck_wnd); -int64_t f_magickgetimageunits(CObjRef mgck_wnd); -int64_t f_magickgetimagevirtualpixelmethod(CObjRef mgck_wnd); -Array f_magickgetimagewhitepoint(CObjRef mgck_wnd); -double f_magickgetimagewidth(CObjRef mgck_wnd); -String f_magickgetimagesblob(CObjRef mgck_wnd); -int64_t f_magickgetinterlacescheme(CObjRef mgck_wnd); -double f_magickgetmaxtextadvance(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false); -String f_magickgetmimetype(CObjRef mgck_wnd); -double f_magickgetnumberimages(CObjRef mgck_wnd); -Array f_magickgetsamplingfactors(CObjRef mgck_wnd); -Array f_magickgetsize(CObjRef mgck_wnd); -double f_magickgetstringheight(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false); -double f_magickgetstringwidth(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false); -double f_magickgettextascent(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false); -double f_magickgettextdescent(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false); -Array f_magickgetwandsize(CObjRef mgck_wnd); -bool f_magickhasnextimage(CObjRef mgck_wnd); -bool f_magickhaspreviousimage(CObjRef mgck_wnd); -bool f_magickimplodeimage(CObjRef mgck_wnd, double amount); -bool f_magicklabelimage(CObjRef mgck_wnd, CStrRef label); -bool f_magicklevelimage(CObjRef mgck_wnd, double black_point, double gamma, double white_point, int channel_type = 0); -bool f_magickmagnifyimage(CObjRef mgck_wnd); -bool f_magickmapimage(CObjRef mgck_wnd, CObjRef map_wand, bool dither); -bool f_magickmattefloodfillimage(CObjRef mgck_wnd, double opacity, double fuzz, CObjRef bordercolor_pxl_wnd, int x, int y); -bool f_magickmedianfilterimage(CObjRef mgck_wnd, double radius); -bool f_magickminifyimage(CObjRef mgck_wnd); -bool f_magickmodulateimage(CObjRef mgck_wnd, double brightness, double saturation, double hue); -Object f_magickmontageimage(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef tile_geometry, CStrRef thumbnail_geometry, int montage_mode, CStrRef frame); -Object f_magickmorphimages(CObjRef mgck_wnd, double number_frames); -Object f_magickmosaicimages(CObjRef mgck_wnd); -bool f_magickmotionblurimage(CObjRef mgck_wnd, double radius, double sigma, double angle); -bool f_magicknegateimage(CObjRef mgck_wnd, bool only_the_gray = false, int channel_type = 0); -bool f_magicknewimage(CObjRef mgck_wnd, double width, double height, CStrRef imagemagick_col_str = null_string); -bool f_magicknextimage(CObjRef mgck_wnd); -bool f_magicknormalizeimage(CObjRef mgck_wnd); -bool f_magickoilpaintimage(CObjRef mgck_wnd, double radius); -bool f_magickpaintopaqueimage(CObjRef mgck_wnd, CObjRef target_pxl_wnd, CObjRef fill_pxl_wnd, double fuzz = 0.0); -bool f_magickpainttransparentimage(CObjRef mgck_wnd, CObjRef target, double opacity = k_MW_TransparentOpacity, double fuzz = 0.0); -bool f_magickpingimage(CObjRef mgck_wnd, CStrRef filename); -bool f_magickposterizeimage(CObjRef mgck_wnd, double levels, bool dither); -Object f_magickpreviewimages(CObjRef mgck_wnd, int preview); -bool f_magickpreviousimage(CObjRef mgck_wnd); -bool f_magickprofileimage(CObjRef mgck_wnd, CStrRef name, CStrRef profile = null_string); -bool f_magickquantizeimage(CObjRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error); -bool f_magickquantizeimages(CObjRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error); -Array f_magickqueryfontmetrics(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false); -bool f_magickradialblurimage(CObjRef mgck_wnd, double angle); -bool f_magickraiseimage(CObjRef mgck_wnd, double width, double height, int x, int y, bool raise); -bool f_magickreadimage(CObjRef mgck_wnd, CStrRef filename); -bool f_magickreadimageblob(CObjRef mgck_wnd, CStrRef blob); -bool f_magickreadimagefile(CObjRef mgck_wnd, CObjRef handle); -bool f_magickreadimages(CObjRef mgck_wnd, CArrRef img_filenames_array); -bool f_magickreducenoiseimage(CObjRef mgck_wnd, double radius); -bool f_magickremoveimage(CObjRef mgck_wnd); -String f_magickremoveimageprofile(CObjRef mgck_wnd, CStrRef name); -bool f_magickremoveimageprofiles(CObjRef mgck_wnd); -bool f_magickresampleimage(CObjRef mgck_wnd, double x_resolution, double y_resolution, int filter_type, double blur); -void f_magickresetiterator(CObjRef mgck_wnd); -bool f_magickresizeimage(CObjRef mgck_wnd, double columns, double rows, int filter_type, double blur); -bool f_magickrollimage(CObjRef mgck_wnd, int x_offset, int y_offset); -bool f_magickrotateimage(CObjRef mgck_wnd, CObjRef background, double degrees); -bool f_magicksampleimage(CObjRef mgck_wnd, double columns, double rows); -bool f_magickscaleimage(CObjRef mgck_wnd, double columns, double rows); -bool f_magickseparateimagechannel(CObjRef mgck_wnd, int channel_type); -bool f_magicksetcompressionquality(CObjRef mgck_wnd, double quality); -bool f_magicksetfilename(CObjRef mgck_wnd, CStrRef filename = null_string); -void f_magicksetfirstiterator(CObjRef mgck_wnd); -bool f_magicksetformat(CObjRef mgck_wnd, CStrRef format); -bool f_magicksetimage(CObjRef mgck_wnd, CObjRef replace_wand); -bool f_magicksetimagebackgroundcolor(CObjRef mgck_wnd, CObjRef background_pxl_wnd); -bool f_magicksetimagebias(CObjRef mgck_wnd, double bias); -bool f_magicksetimageblueprimary(CObjRef mgck_wnd, double x, double y); -bool f_magicksetimagebordercolor(CObjRef mgck_wnd, CObjRef border_pxl_wnd); -bool f_magicksetimagecolormapcolor(CObjRef mgck_wnd, double index, CObjRef mapcolor_pxl_wnd); -bool f_magicksetimagecolorspace(CObjRef mgck_wnd, int colorspace_type); -bool f_magicksetimagecompose(CObjRef mgck_wnd, int composite_operator); -bool f_magicksetimagecompression(CObjRef mgck_wnd, int compression_type); -bool f_magicksetimagecompressionquality(CObjRef mgck_wnd, double quality); -bool f_magicksetimagedelay(CObjRef mgck_wnd, double delay); -bool f_magicksetimagedepth(CObjRef mgck_wnd, int depth, int channel_type = 0); -bool f_magicksetimagedispose(CObjRef mgck_wnd, int dispose_type); -bool f_magicksetimagefilename(CObjRef mgck_wnd, CStrRef filename = null_string); -bool f_magicksetimageformat(CObjRef mgck_wnd, CStrRef format); -bool f_magicksetimagegamma(CObjRef mgck_wnd, double gamma); -bool f_magicksetimagegreenprimary(CObjRef mgck_wnd, double x, double y); -bool f_magicksetimageindex(CObjRef mgck_wnd, int index); -bool f_magicksetimageinterlacescheme(CObjRef mgck_wnd, int interlace_type); -bool f_magicksetimageiterations(CObjRef mgck_wnd, double iterations); -bool f_magicksetimagemattecolor(CObjRef mgck_wnd, CObjRef matte_pxl_wnd); -bool f_magicksetimageoption(CObjRef mgck_wnd, CStrRef format, CStrRef key, CStrRef value); -bool f_magicksetimagepixels(CObjRef mgck_wnd, int x_offset, int y_offset, double columns, double rows, CStrRef smap, int storage_type, CArrRef pixel_array); -bool f_magicksetimageprofile(CObjRef mgck_wnd, CStrRef name, CStrRef profile); -bool f_magicksetimageredprimary(CObjRef mgck_wnd, double x, double y); -bool f_magicksetimagerenderingintent(CObjRef mgck_wnd, int rendering_intent); -bool f_magicksetimageresolution(CObjRef mgck_wnd, double x_resolution, double y_resolution); -bool f_magicksetimagescene(CObjRef mgck_wnd, double scene); -bool f_magicksetimagetype(CObjRef mgck_wnd, int image_type); -bool f_magicksetimageunits(CObjRef mgck_wnd, int resolution_type); -bool f_magicksetimagevirtualpixelmethod(CObjRef mgck_wnd, int virtual_pixel_method); -bool f_magicksetimagewhitepoint(CObjRef mgck_wnd, double x, double y); -bool f_magicksetinterlacescheme(CObjRef mgck_wnd, int interlace_type); -void f_magicksetlastiterator(CObjRef mgck_wnd); -bool f_magicksetpassphrase(CObjRef mgck_wnd, CStrRef passphrase); -bool f_magicksetresolution(CObjRef mgck_wnd, double x_resolution, double y_resolution); -bool f_magicksetsamplingfactors(CObjRef mgck_wnd, double number_factors, CArrRef sampling_factors); -bool f_magicksetsize(CObjRef mgck_wnd, int columns, int rows); -bool f_magicksetwandsize(CObjRef mgck_wnd, int columns, int rows); -bool f_magicksharpenimage(CObjRef mgck_wnd, double radius, double sigma, int channel_type = 0); -bool f_magickshaveimage(CObjRef mgck_wnd, int columns, int rows); -bool f_magickshearimage(CObjRef mgck_wnd, CObjRef background, double x_shear, double y_shear); -bool f_magicksolarizeimage(CObjRef mgck_wnd, double threshold); -bool f_magickspliceimage(CObjRef mgck_wnd, double width, double height, int x, int y); -bool f_magickspreadimage(CObjRef mgck_wnd, double radius); -Object f_magicksteganoimage(CObjRef mgck_wnd, CObjRef watermark_wand, int offset); -bool f_magickstereoimage(CObjRef mgck_wnd, CObjRef offset_wand); -bool f_magickstripimage(CObjRef mgck_wnd); -bool f_magickswirlimage(CObjRef mgck_wnd, double degrees); -Object f_magicktextureimage(CObjRef mgck_wnd, CObjRef texture_wand); -bool f_magickthresholdimage(CObjRef mgck_wnd, double threshold, int channel_type = 0); -bool f_magicktintimage(CObjRef mgck_wnd, int tint_pxl_wnd, CObjRef opacity_pxl_wnd); -Object f_magicktransformimage(CObjRef mgck_wnd, CStrRef crop, CStrRef geometry); -bool f_magicktrimimage(CObjRef mgck_wnd, double fuzz); -bool f_magickunsharpmaskimage(CObjRef mgck_wnd, double radius, double sigma, double amount, double threshold, int channel_type = 0); -bool f_magickwaveimage(CObjRef mgck_wnd, double amplitude, double wave_length); -bool f_magickwhitethresholdimage(CObjRef mgck_wnd, CObjRef threshold_pxl_wnd); -bool f_magickwriteimage(CObjRef mgck_wnd, CStrRef filename); -bool f_magickwriteimagefile(CObjRef mgck_wnd, CObjRef handle); -bool f_magickwriteimages(CObjRef mgck_wnd, CStrRef filename = "", bool join_images = false); -bool f_magickwriteimagesfile(CObjRef mgck_wnd, CObjRef handle); -double f_pixelgetalpha(CObjRef pxl_wnd); -double f_pixelgetalphaquantum(CObjRef pxl_wnd); -double f_pixelgetblack(CObjRef pxl_wnd); -double f_pixelgetblackquantum(CObjRef pxl_wnd); -double f_pixelgetblue(CObjRef pxl_wnd); -double f_pixelgetbluequantum(CObjRef pxl_wnd); -String f_pixelgetcolorasstring(CObjRef pxl_wnd); -double f_pixelgetcolorcount(CObjRef pxl_wnd); -double f_pixelgetcyan(CObjRef pxl_wnd); -double f_pixelgetcyanquantum(CObjRef pxl_wnd); -Array f_pixelgetexception(CObjRef pxl_wnd); -String f_pixelgetexceptionstring(CObjRef pxl_wnd); -int64_t f_pixelgetexceptiontype(CObjRef pxl_wnd); -double f_pixelgetgreen(CObjRef pxl_wnd); -double f_pixelgetgreenquantum(CObjRef pxl_wnd); -double f_pixelgetindex(CObjRef pxl_wnd); -double f_pixelgetmagenta(CObjRef pxl_wnd); -double f_pixelgetmagentaquantum(CObjRef pxl_wnd); -double f_pixelgetopacity(CObjRef pxl_wnd); -double f_pixelgetopacityquantum(CObjRef pxl_wnd); -Array f_pixelgetquantumcolor(CObjRef pxl_wnd); -double f_pixelgetred(CObjRef pxl_wnd); -double f_pixelgetredquantum(CObjRef pxl_wnd); -double f_pixelgetyellow(CObjRef pxl_wnd); -double f_pixelgetyellowquantum(CObjRef pxl_wnd); -void f_pixelsetalpha(CObjRef pxl_wnd, double alpha); -void f_pixelsetalphaquantum(CObjRef pxl_wnd, double alpha); -void f_pixelsetblack(CObjRef pxl_wnd, double black); -void f_pixelsetblackquantum(CObjRef pxl_wnd, double black); -void f_pixelsetblue(CObjRef pxl_wnd, double blue); -void f_pixelsetbluequantum(CObjRef pxl_wnd, double blue); -void f_pixelsetcolor(CObjRef pxl_wnd, CStrRef imagemagick_col_str); -void f_pixelsetcolorcount(CObjRef pxl_wnd, int count); -void f_pixelsetcyan(CObjRef pxl_wnd, double cyan); -void f_pixelsetcyanquantum(CObjRef pxl_wnd, double cyan); -void f_pixelsetgreen(CObjRef pxl_wnd, double green); -void f_pixelsetgreenquantum(CObjRef pxl_wnd, double green); -void f_pixelsetindex(CObjRef pxl_wnd, double index); -void f_pixelsetmagenta(CObjRef pxl_wnd, double magenta); -void f_pixelsetmagentaquantum(CObjRef pxl_wnd, double magenta); -void f_pixelsetopacity(CObjRef pxl_wnd, double opacity); -void f_pixelsetopacityquantum(CObjRef pxl_wnd, double opacity); -void f_pixelsetquantumcolor(CObjRef pxl_wnd, double red, double green, double blue, double opacity = 0.0); -void f_pixelsetred(CObjRef pxl_wnd, double red); -void f_pixelsetredquantum(CObjRef pxl_wnd, double red); -void f_pixelsetyellow(CObjRef pxl_wnd, double yellow); -void f_pixelsetyellowquantum(CObjRef pxl_wnd, double yellow); -Array f_pixelgetiteratorexception(CObjRef pxl_iter); -String f_pixelgetiteratorexceptionstring(CObjRef pxl_iter); -int64_t f_pixelgetiteratorexceptiontype(CObjRef pxl_iter); -Array f_pixelgetnextiteratorrow(CObjRef pxl_iter); -void f_pixelresetiterator(CObjRef pxl_iter); -bool f_pixelsetiteratorrow(CObjRef pxl_iter, int row); -bool f_pixelsynciterator(CObjRef pxl_iter); +void f_cleardrawingwand(CResRef drw_wnd); +void f_clearmagickwand(CResRef mgck_wnd); +void f_clearpixeliterator(CResRef pxl_iter); +void f_clearpixelwand(CResRef pxl_wnd); +Resource f_clonedrawingwand(CResRef drw_wnd); +Resource f_clonemagickwand(CResRef mgck_wnd); +Array f_wandgetexception(CResRef wnd); +String f_wandgetexceptionstring(CResRef wnd); +int64_t f_wandgetexceptiontype(CResRef wnd); +bool f_wandhasexception(CResRef wnd); +void f_drawaffine(CResRef drw_wnd, double sx, double sy, double rx, double ry, double tx, double ty); +void f_drawannotation(CResRef drw_wnd, double x, double y, CStrRef text); +void f_drawarc(CResRef drw_wnd, double sx, double sy, double ex, double ey, double sd, double ed); +void f_drawbezier(CResRef drw_wnd, CArrRef x_y_points_array); +void f_drawcircle(CResRef drw_wnd, double ox, double oy, double px, double py); +void f_drawcolor(CResRef drw_wnd, double x, double y, int paint_method); +void f_drawcomment(CResRef drw_wnd, CStrRef comment); +bool f_drawcomposite(CResRef drw_wnd, int composite_operator, double x, double y, double width, double height, CResRef mgck_wnd); +void f_drawellipse(CResRef drw_wnd, double ox, double oy, double rx, double ry, double start, double end); +String f_drawgetclippath(CResRef drw_wnd); +int64_t f_drawgetcliprule(CResRef drw_wnd); +int64_t f_drawgetclipunits(CResRef drw_wnd); +Array f_drawgetexception(CResRef drw_wnd); +String f_drawgetexceptionstring(CResRef drw_wnd); +int64_t f_drawgetexceptiontype(CResRef drw_wnd); +double f_drawgetfillalpha(CResRef drw_wnd); +Resource f_drawgetfillcolor(CResRef drw_wnd); +double f_drawgetfillopacity(CResRef drw_wnd); +int64_t f_drawgetfillrule(CResRef drw_wnd); +String f_drawgetfont(CResRef drw_wnd); +String f_drawgetfontfamily(CResRef drw_wnd); +double f_drawgetfontsize(CResRef drw_wnd); +int64_t f_drawgetfontstretch(CResRef drw_wnd); +int64_t f_drawgetfontstyle(CResRef drw_wnd); +double f_drawgetfontweight(CResRef drw_wnd); +int64_t f_drawgetgravity(CResRef drw_wnd); +double f_drawgetstrokealpha(CResRef drw_wnd); +bool f_drawgetstrokeantialias(CResRef drw_wnd); +Resource f_drawgetstrokecolor(CResRef drw_wnd); +Array f_drawgetstrokedasharray(CResRef drw_wnd); +double f_drawgetstrokedashoffset(CResRef drw_wnd); +int64_t f_drawgetstrokelinecap(CResRef drw_wnd); +int64_t f_drawgetstrokelinejoin(CResRef drw_wnd); +double f_drawgetstrokemiterlimit(CResRef drw_wnd); +double f_drawgetstrokeopacity(CResRef drw_wnd); +double f_drawgetstrokewidth(CResRef drw_wnd); +int64_t f_drawgettextalignment(CResRef drw_wnd); +bool f_drawgettextantialias(CResRef drw_wnd); +int64_t f_drawgettextdecoration(CResRef drw_wnd); +String f_drawgettextencoding(CResRef drw_wnd); +Resource f_drawgettextundercolor(CResRef drw_wnd); +String f_drawgetvectorgraphics(CResRef drw_wnd); +void f_drawline(CResRef drw_wnd, double sx, double sy, double ex, double ey); +void f_drawmatte(CResRef drw_wnd, double x, double y, int paint_method); +void f_drawpathclose(CResRef drw_wnd); +void f_drawpathcurvetoabsolute(CResRef drw_wnd, double x1, double y1, double x2, double y2, double x, double y); +void f_drawpathcurvetoquadraticbezierabsolute(CResRef drw_wnd, double x1, double y1, double x, double y); +void f_drawpathcurvetoquadraticbezierrelative(CResRef drw_wnd, double x1, double y1, double x, double y); +void f_drawpathcurvetoquadraticbeziersmoothabsolute(CResRef drw_wnd, double x, double y); +void f_drawpathcurvetoquadraticbeziersmoothrelative(CResRef drw_wnd, double x, double y); +void f_drawpathcurvetorelative(CResRef drw_wnd, double x1, double y1, double x2, double y2, double x, double y); +void f_drawpathcurvetosmoothabsolute(CResRef drw_wnd, double x2, double y2, double x, double y); +void f_drawpathcurvetosmoothrelative(CResRef drw_wnd, double x2, double y2, double x, double y); +void f_drawpathellipticarcabsolute(CResRef drw_wnd, double rx, double ry, double x_axis_rotation, bool large_arc_flag, bool sweep_flag, double x, double y); +void f_drawpathellipticarcrelative(CResRef drw_wnd, double rx, double ry, double x_axis_rotation, bool large_arc_flag, bool sweep_flag, double x, double y); +void f_drawpathfinish(CResRef drw_wnd); +void f_drawpathlinetoabsolute(CResRef drw_wnd, double x, double y); +void f_drawpathlinetohorizontalabsolute(CResRef drw_wnd, double x); +void f_drawpathlinetohorizontalrelative(CResRef drw_wnd, double x); +void f_drawpathlinetorelative(CResRef drw_wnd, double x, double y); +void f_drawpathlinetoverticalabsolute(CResRef drw_wnd, double y); +void f_drawpathlinetoverticalrelative(CResRef drw_wnd, double y); +void f_drawpathmovetoabsolute(CResRef drw_wnd, double x, double y); +void f_drawpathmovetorelative(CResRef drw_wnd, double x, double y); +void f_drawpathstart(CResRef drw_wnd); +void f_drawpoint(CResRef drw_wnd, double x, double y); +void f_drawpolygon(CResRef drw_wnd, CArrRef x_y_points_array); +void f_drawpolyline(CResRef drw_wnd, CArrRef x_y_points_array); +void f_drawrectangle(CResRef drw_wnd, double x1, double y1, double x2, double y2); +bool f_drawrender(CResRef drw_wnd); +void f_drawrotate(CResRef drw_wnd, double degrees); +void f_drawroundrectangle(CResRef drw_wnd, double x1, double y1, double x2, double y2, double rx, double ry); +void f_drawscale(CResRef drw_wnd, double x, double y); +bool f_drawsetclippath(CResRef drw_wnd, CStrRef clip_path); +void f_drawsetcliprule(CResRef drw_wnd, int fill_rule); +void f_drawsetclipunits(CResRef drw_wnd, int clip_path_units); +void f_drawsetfillalpha(CResRef drw_wnd, double fill_opacity); +void f_drawsetfillcolor(CResRef drw_wnd, CResRef fill_pxl_wnd); +void f_drawsetfillopacity(CResRef drw_wnd, double fill_opacity); +bool f_drawsetfillpatternurl(CResRef drw_wnd, CStrRef fill_url); +void f_drawsetfillrule(CResRef drw_wnd, int fill_rule); +bool f_drawsetfont(CResRef drw_wnd, CStrRef font_file); +bool f_drawsetfontfamily(CResRef drw_wnd, CStrRef font_family); +void f_drawsetfontsize(CResRef drw_wnd, double pointsize); +void f_drawsetfontstretch(CResRef drw_wnd, int stretch_type); +void f_drawsetfontstyle(CResRef drw_wnd, int style_type); +void f_drawsetfontweight(CResRef drw_wnd, double font_weight); +void f_drawsetgravity(CResRef drw_wnd, int gravity_type); +void f_drawsetstrokealpha(CResRef drw_wnd, double stroke_opacity); +void f_drawsetstrokeantialias(CResRef drw_wnd, bool stroke_antialias = true); +void f_drawsetstrokecolor(CResRef drw_wnd, CResRef strokecolor_pxl_wnd); +void f_drawsetstrokedasharray(CResRef drw_wnd, CArrRef dash_array = null_array); +void f_drawsetstrokedashoffset(CResRef drw_wnd, double dash_offset); +void f_drawsetstrokelinecap(CResRef drw_wnd, int line_cap); +void f_drawsetstrokelinejoin(CResRef drw_wnd, int line_join); +void f_drawsetstrokemiterlimit(CResRef drw_wnd, double miterlimit); +void f_drawsetstrokeopacity(CResRef drw_wnd, double stroke_opacity); +bool f_drawsetstrokepatternurl(CResRef drw_wnd, CStrRef stroke_url); +void f_drawsetstrokewidth(CResRef drw_wnd, double stroke_width); +void f_drawsettextalignment(CResRef drw_wnd, int align_type); +void f_drawsettextantialias(CResRef drw_wnd, bool text_antialias = true); +void f_drawsettextdecoration(CResRef drw_wnd, int decoration_type); +void f_drawsettextencoding(CResRef drw_wnd, CStrRef encoding); +void f_drawsettextundercolor(CResRef drw_wnd, CResRef undercolor_pxl_wnd); +bool f_drawsetvectorgraphics(CResRef drw_wnd, CStrRef vector_graphics); +void f_drawsetviewbox(CResRef drw_wnd, double x1, double y1, double x2, double y2); +void f_drawskewx(CResRef drw_wnd, double degrees); +void f_drawskewy(CResRef drw_wnd, double degrees); +void f_drawtranslate(CResRef drw_wnd, double x, double y); +void f_pushdrawingwand(CResRef drw_wnd); +void f_drawpushclippath(CResRef drw_wnd, CStrRef clip_path_id); +void f_drawpushdefs(CResRef drw_wnd); +void f_drawpushpattern(CResRef drw_wnd, CStrRef pattern_id, double x, double y, double width, double height); +void f_popdrawingwand(CResRef drw_wnd); +void f_drawpopclippath(CResRef drw_wnd); +void f_drawpopdefs(CResRef drw_wnd); +void f_drawpoppattern(CResRef drw_wnd); +bool f_magickadaptivethresholdimage(CResRef mgck_wnd, double width, double height, double offset); +bool f_magickaddimage(CResRef mgck_wnd, CResRef add_wand); +bool f_magickaddnoiseimage(CResRef mgck_wnd, int noise_type); +bool f_magickaffinetransformimage(CResRef mgck_wnd, CResRef drw_wnd); +bool f_magickannotateimage(CResRef mgck_wnd, CResRef drw_wnd, double x, double y, double angle, CStrRef text); +Resource f_magickappendimages(CResRef mgck_wnd, bool stack_vertical = false); +Resource f_magickaverageimages(CResRef mgck_wnd); +bool f_magickblackthresholdimage(CResRef mgck_wnd, CResRef threshold_pxl_wnd); +bool f_magickblurimage(CResRef mgck_wnd, double radius, double sigma, int channel_type = 0); +bool f_magickborderimage(CResRef mgck_wnd, CResRef bordercolor, double width, double height); +bool f_magickcharcoalimage(CResRef mgck_wnd, double radius, double sigma); +bool f_magickchopimage(CResRef mgck_wnd, double width, double height, int x, int y); +bool f_magickclipimage(CResRef mgck_wnd); +bool f_magickclippathimage(CResRef mgck_wnd, CStrRef pathname, bool inside); +Resource f_magickcoalesceimages(CResRef mgck_wnd); +bool f_magickcolorfloodfillimage(CResRef mgck_wnd, CResRef fillcolor_pxl_wnd, double fuzz, CResRef bordercolor_pxl_wnd, int x, int y); +bool f_magickcolorizeimage(CResRef mgck_wnd, CResRef colorize, CResRef opacity_pxl_wnd); +Resource f_magickcombineimages(CResRef mgck_wnd, int channel_type); +bool f_magickcommentimage(CResRef mgck_wnd, CStrRef comment); +Array f_magickcompareimages(CResRef mgck_wnd, CResRef reference_wnd, int metric_type, int channel_type = 0); +bool f_magickcompositeimage(CResRef mgck_wnd, CResRef composite_wnd, int composite_operator, int x, int y); +bool f_magickconstituteimage(CResRef mgck_wnd, double columns, double rows, CStrRef smap, int storage_type, CArrRef pixel_array); +bool f_magickcontrastimage(CResRef mgck_wnd, bool sharpen); +bool f_magickconvolveimage(CResRef mgck_wnd, CArrRef kernel_array, int channel_type = 0); +bool f_magickcropimage(CResRef mgck_wnd, double width, double height, int x, int y); +bool f_magickcyclecolormapimage(CResRef mgck_wnd, int num_positions); +Resource f_magickdeconstructimages(CResRef mgck_wnd); +String f_magickdescribeimage(CResRef mgck_wnd); +bool f_magickdespeckleimage(CResRef mgck_wnd); +bool f_magickdrawimage(CResRef mgck_wnd, CResRef drw_wnd); +bool f_magickechoimageblob(CResRef mgck_wnd); +bool f_magickechoimagesblob(CResRef mgck_wnd); +bool f_magickedgeimage(CResRef mgck_wnd, double radius); +bool f_magickembossimage(CResRef mgck_wnd, double radius, double sigma); +bool f_magickenhanceimage(CResRef mgck_wnd); +bool f_magickequalizeimage(CResRef mgck_wnd); +bool f_magickevaluateimage(CResRef mgck_wnd, int evaluate_op, double constant, int channel_type = 0); +Resource f_magickflattenimages(CResRef mgck_wnd); +bool f_magickflipimage(CResRef mgck_wnd); +bool f_magickflopimage(CResRef mgck_wnd); +bool f_magickframeimage(CResRef mgck_wnd, CResRef matte_color, double width, double height, int inner_bevel, int outer_bevel); +Resource f_magickfximage(CResRef mgck_wnd, CStrRef expression, int channel_type = 0); +bool f_magickgammaimage(CResRef mgck_wnd, double gamma, int channel_type = 0); +bool f_magickgaussianblurimage(CResRef mgck_wnd, double radius, double sigma, int channel_type = 0); +double f_magickgetcharheight(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false); +double f_magickgetcharwidth(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false); +Array f_magickgetexception(CResRef mgck_wnd); +String f_magickgetexceptionstring(CResRef mgck_wnd); +int64_t f_magickgetexceptiontype(CResRef mgck_wnd); +String f_magickgetfilename(CResRef mgck_wnd); +String f_magickgetformat(CResRef mgck_wnd); +Resource f_magickgetimage(CResRef mgck_wnd); +Resource f_magickgetimagebackgroundcolor(CResRef mgck_wnd); +String f_magickgetimageblob(CResRef mgck_wnd); +Array f_magickgetimageblueprimary(CResRef mgck_wnd); +Resource f_magickgetimagebordercolor(CResRef mgck_wnd); +Array f_magickgetimagechannelmean(CResRef mgck_wnd, int channel_type); +Resource f_magickgetimagecolormapcolor(CResRef mgck_wnd, double index); +double f_magickgetimagecolors(CResRef mgck_wnd); +int64_t f_magickgetimagecolorspace(CResRef mgck_wnd); +int64_t f_magickgetimagecompose(CResRef mgck_wnd); +int64_t f_magickgetimagecompression(CResRef mgck_wnd); +double f_magickgetimagecompressionquality(CResRef mgck_wnd); +double f_magickgetimagedelay(CResRef mgck_wnd); +double f_magickgetimagedepth(CResRef mgck_wnd, int channel_type = 0); +int64_t f_magickgetimagedispose(CResRef mgck_wnd); +Array f_magickgetimageextrema(CResRef mgck_wnd, int channel_type = 0); +String f_magickgetimagefilename(CResRef mgck_wnd); +String f_magickgetimageformat(CResRef mgck_wnd); +double f_magickgetimagegamma(CResRef mgck_wnd); +Array f_magickgetimagegreenprimary(CResRef mgck_wnd); +double f_magickgetimageheight(CResRef mgck_wnd); +Array f_magickgetimagehistogram(CResRef mgck_wnd); +int64_t f_magickgetimageindex(CResRef mgck_wnd); +int64_t f_magickgetimageinterlacescheme(CResRef mgck_wnd); +double f_magickgetimageiterations(CResRef mgck_wnd); +Resource f_magickgetimagemattecolor(CResRef mgck_wnd); +String f_magickgetimagemimetype(CResRef mgck_wnd); +Array f_magickgetimagepixels(CResRef mgck_wnd, int x_offset, int y_offset, double columns, double rows, CStrRef smap, int storage_type); +String f_magickgetimageprofile(CResRef mgck_wnd, CStrRef name); +Array f_magickgetimageredprimary(CResRef mgck_wnd); +int64_t f_magickgetimagerenderingintent(CResRef mgck_wnd); +Array f_magickgetimageresolution(CResRef mgck_wnd); +double f_magickgetimagescene(CResRef mgck_wnd); +String f_magickgetimagesignature(CResRef mgck_wnd); +int64_t f_magickgetimagesize(CResRef mgck_wnd); +int64_t f_magickgetimagetype(CResRef mgck_wnd); +int64_t f_magickgetimageunits(CResRef mgck_wnd); +int64_t f_magickgetimagevirtualpixelmethod(CResRef mgck_wnd); +Array f_magickgetimagewhitepoint(CResRef mgck_wnd); +double f_magickgetimagewidth(CResRef mgck_wnd); +String f_magickgetimagesblob(CResRef mgck_wnd); +int64_t f_magickgetinterlacescheme(CResRef mgck_wnd); +double f_magickgetmaxtextadvance(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false); +String f_magickgetmimetype(CResRef mgck_wnd); +double f_magickgetnumberimages(CResRef mgck_wnd); +Array f_magickgetsamplingfactors(CResRef mgck_wnd); +Array f_magickgetsize(CResRef mgck_wnd); +double f_magickgetstringheight(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false); +double f_magickgetstringwidth(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false); +double f_magickgettextascent(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false); +double f_magickgettextdescent(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false); +Array f_magickgetwandsize(CResRef mgck_wnd); +bool f_magickhasnextimage(CResRef mgck_wnd); +bool f_magickhaspreviousimage(CResRef mgck_wnd); +bool f_magickimplodeimage(CResRef mgck_wnd, double amount); +bool f_magicklabelimage(CResRef mgck_wnd, CStrRef label); +bool f_magicklevelimage(CResRef mgck_wnd, double black_point, double gamma, double white_point, int channel_type = 0); +bool f_magickmagnifyimage(CResRef mgck_wnd); +bool f_magickmapimage(CResRef mgck_wnd, CResRef map_wand, bool dither); +bool f_magickmattefloodfillimage(CResRef mgck_wnd, double opacity, double fuzz, CResRef bordercolor_pxl_wnd, int x, int y); +bool f_magickmedianfilterimage(CResRef mgck_wnd, double radius); +bool f_magickminifyimage(CResRef mgck_wnd); +bool f_magickmodulateimage(CResRef mgck_wnd, double brightness, double saturation, double hue); +Resource f_magickmontageimage(CResRef mgck_wnd, CResRef drw_wnd, CStrRef tile_geometry, CStrRef thumbnail_geometry, int montage_mode, CStrRef frame); +Resource f_magickmorphimages(CResRef mgck_wnd, double number_frames); +Resource f_magickmosaicimages(CResRef mgck_wnd); +bool f_magickmotionblurimage(CResRef mgck_wnd, double radius, double sigma, double angle); +bool f_magicknegateimage(CResRef mgck_wnd, bool only_the_gray = false, int channel_type = 0); +bool f_magicknewimage(CResRef mgck_wnd, double width, double height, CStrRef imagemagick_col_str = null_string); +bool f_magicknextimage(CResRef mgck_wnd); +bool f_magicknormalizeimage(CResRef mgck_wnd); +bool f_magickoilpaintimage(CResRef mgck_wnd, double radius); +bool f_magickpaintopaqueimage(CResRef mgck_wnd, CResRef target_pxl_wnd, CResRef fill_pxl_wnd, double fuzz = 0.0); +bool f_magickpainttransparentimage(CResRef mgck_wnd, CResRef target, double opacity = k_MW_TransparentOpacity, double fuzz = 0.0); +bool f_magickpingimage(CResRef mgck_wnd, CStrRef filename); +bool f_magickposterizeimage(CResRef mgck_wnd, double levels, bool dither); +Resource f_magickpreviewimages(CResRef mgck_wnd, int preview); +bool f_magickpreviousimage(CResRef mgck_wnd); +bool f_magickprofileimage(CResRef mgck_wnd, CStrRef name, CStrRef profile = null_string); +bool f_magickquantizeimage(CResRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error); +bool f_magickquantizeimages(CResRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error); +Array f_magickqueryfontmetrics(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false); +bool f_magickradialblurimage(CResRef mgck_wnd, double angle); +bool f_magickraiseimage(CResRef mgck_wnd, double width, double height, int x, int y, bool raise); +bool f_magickreadimage(CResRef mgck_wnd, CStrRef filename); +bool f_magickreadimageblob(CResRef mgck_wnd, CStrRef blob); +bool f_magickreadimagefile(CResRef mgck_wnd, CResRef handle); +bool f_magickreadimages(CResRef mgck_wnd, CArrRef img_filenames_array); +bool f_magickreducenoiseimage(CResRef mgck_wnd, double radius); +bool f_magickremoveimage(CResRef mgck_wnd); +String f_magickremoveimageprofile(CResRef mgck_wnd, CStrRef name); +bool f_magickremoveimageprofiles(CResRef mgck_wnd); +bool f_magickresampleimage(CResRef mgck_wnd, double x_resolution, double y_resolution, int filter_type, double blur); +void f_magickresetiterator(CResRef mgck_wnd); +bool f_magickresizeimage(CResRef mgck_wnd, double columns, double rows, int filter_type, double blur); +bool f_magickrollimage(CResRef mgck_wnd, int x_offset, int y_offset); +bool f_magickrotateimage(CResRef mgck_wnd, CResRef background, double degrees); +bool f_magicksampleimage(CResRef mgck_wnd, double columns, double rows); +bool f_magickscaleimage(CResRef mgck_wnd, double columns, double rows); +bool f_magickseparateimagechannel(CResRef mgck_wnd, int channel_type); +bool f_magicksetcompressionquality(CResRef mgck_wnd, double quality); +bool f_magicksetfilename(CResRef mgck_wnd, CStrRef filename = null_string); +void f_magicksetfirstiterator(CResRef mgck_wnd); +bool f_magicksetformat(CResRef mgck_wnd, CStrRef format); +bool f_magicksetimage(CResRef mgck_wnd, CResRef replace_wand); +bool f_magicksetimagebackgroundcolor(CResRef mgck_wnd, CResRef background_pxl_wnd); +bool f_magicksetimagebias(CResRef mgck_wnd, double bias); +bool f_magicksetimageblueprimary(CResRef mgck_wnd, double x, double y); +bool f_magicksetimagebordercolor(CResRef mgck_wnd, CResRef border_pxl_wnd); +bool f_magicksetimagecolormapcolor(CResRef mgck_wnd, double index, CResRef mapcolor_pxl_wnd); +bool f_magicksetimagecolorspace(CResRef mgck_wnd, int colorspace_type); +bool f_magicksetimagecompose(CResRef mgck_wnd, int composite_operator); +bool f_magicksetimagecompression(CResRef mgck_wnd, int compression_type); +bool f_magicksetimagecompressionquality(CResRef mgck_wnd, double quality); +bool f_magicksetimagedelay(CResRef mgck_wnd, double delay); +bool f_magicksetimagedepth(CResRef mgck_wnd, int depth, int channel_type = 0); +bool f_magicksetimagedispose(CResRef mgck_wnd, int dispose_type); +bool f_magicksetimagefilename(CResRef mgck_wnd, CStrRef filename = null_string); +bool f_magicksetimageformat(CResRef mgck_wnd, CStrRef format); +bool f_magicksetimagegamma(CResRef mgck_wnd, double gamma); +bool f_magicksetimagegreenprimary(CResRef mgck_wnd, double x, double y); +bool f_magicksetimageindex(CResRef mgck_wnd, int index); +bool f_magicksetimageinterlacescheme(CResRef mgck_wnd, int interlace_type); +bool f_magicksetimageiterations(CResRef mgck_wnd, double iterations); +bool f_magicksetimagemattecolor(CResRef mgck_wnd, CResRef matte_pxl_wnd); +bool f_magicksetimageoption(CResRef mgck_wnd, CStrRef format, CStrRef key, CStrRef value); +bool f_magicksetimagepixels(CResRef mgck_wnd, int x_offset, int y_offset, double columns, double rows, CStrRef smap, int storage_type, CArrRef pixel_array); +bool f_magicksetimageprofile(CResRef mgck_wnd, CStrRef name, CStrRef profile); +bool f_magicksetimageredprimary(CResRef mgck_wnd, double x, double y); +bool f_magicksetimagerenderingintent(CResRef mgck_wnd, int rendering_intent); +bool f_magicksetimageresolution(CResRef mgck_wnd, double x_resolution, double y_resolution); +bool f_magicksetimagescene(CResRef mgck_wnd, double scene); +bool f_magicksetimagetype(CResRef mgck_wnd, int image_type); +bool f_magicksetimageunits(CResRef mgck_wnd, int resolution_type); +bool f_magicksetimagevirtualpixelmethod(CResRef mgck_wnd, int virtual_pixel_method); +bool f_magicksetimagewhitepoint(CResRef mgck_wnd, double x, double y); +bool f_magicksetinterlacescheme(CResRef mgck_wnd, int interlace_type); +void f_magicksetlastiterator(CResRef mgck_wnd); +bool f_magicksetpassphrase(CResRef mgck_wnd, CStrRef passphrase); +bool f_magicksetresolution(CResRef mgck_wnd, double x_resolution, double y_resolution); +bool f_magicksetsamplingfactors(CResRef mgck_wnd, double number_factors, CArrRef sampling_factors); +bool f_magicksetsize(CResRef mgck_wnd, int columns, int rows); +bool f_magicksetwandsize(CResRef mgck_wnd, int columns, int rows); +bool f_magicksharpenimage(CResRef mgck_wnd, double radius, double sigma, int channel_type = 0); +bool f_magickshaveimage(CResRef mgck_wnd, int columns, int rows); +bool f_magickshearimage(CResRef mgck_wnd, CResRef background, double x_shear, double y_shear); +bool f_magicksolarizeimage(CResRef mgck_wnd, double threshold); +bool f_magickspliceimage(CResRef mgck_wnd, double width, double height, int x, int y); +bool f_magickspreadimage(CResRef mgck_wnd, double radius); +Resource f_magicksteganoimage(CResRef mgck_wnd, CResRef watermark_wand, int offset); +bool f_magickstereoimage(CResRef mgck_wnd, CResRef offset_wand); +bool f_magickstripimage(CResRef mgck_wnd); +bool f_magickswirlimage(CResRef mgck_wnd, double degrees); +Resource f_magicktextureimage(CResRef mgck_wnd, CResRef texture_wand); +bool f_magickthresholdimage(CResRef mgck_wnd, double threshold, int channel_type = 0); +bool f_magicktintimage(CResRef mgck_wnd, int tint_pxl_wnd, CResRef opacity_pxl_wnd); +Resource f_magicktransformimage(CResRef mgck_wnd, CStrRef crop, CStrRef geometry); +bool f_magicktrimimage(CResRef mgck_wnd, double fuzz); +bool f_magickunsharpmaskimage(CResRef mgck_wnd, double radius, double sigma, double amount, double threshold, int channel_type = 0); +bool f_magickwaveimage(CResRef mgck_wnd, double amplitude, double wave_length); +bool f_magickwhitethresholdimage(CResRef mgck_wnd, CResRef threshold_pxl_wnd); +bool f_magickwriteimage(CResRef mgck_wnd, CStrRef filename); +bool f_magickwriteimagefile(CResRef mgck_wnd, CResRef handle); +bool f_magickwriteimages(CResRef mgck_wnd, CStrRef filename = "", bool join_images = false); +bool f_magickwriteimagesfile(CResRef mgck_wnd, CResRef handle); +double f_pixelgetalpha(CResRef pxl_wnd); +double f_pixelgetalphaquantum(CResRef pxl_wnd); +double f_pixelgetblack(CResRef pxl_wnd); +double f_pixelgetblackquantum(CResRef pxl_wnd); +double f_pixelgetblue(CResRef pxl_wnd); +double f_pixelgetbluequantum(CResRef pxl_wnd); +String f_pixelgetcolorasstring(CResRef pxl_wnd); +double f_pixelgetcolorcount(CResRef pxl_wnd); +double f_pixelgetcyan(CResRef pxl_wnd); +double f_pixelgetcyanquantum(CResRef pxl_wnd); +Array f_pixelgetexception(CResRef pxl_wnd); +String f_pixelgetexceptionstring(CResRef pxl_wnd); +int64_t f_pixelgetexceptiontype(CResRef pxl_wnd); +double f_pixelgetgreen(CResRef pxl_wnd); +double f_pixelgetgreenquantum(CResRef pxl_wnd); +double f_pixelgetindex(CResRef pxl_wnd); +double f_pixelgetmagenta(CResRef pxl_wnd); +double f_pixelgetmagentaquantum(CResRef pxl_wnd); +double f_pixelgetopacity(CResRef pxl_wnd); +double f_pixelgetopacityquantum(CResRef pxl_wnd); +Array f_pixelgetquantumcolor(CResRef pxl_wnd); +double f_pixelgetred(CResRef pxl_wnd); +double f_pixelgetredquantum(CResRef pxl_wnd); +double f_pixelgetyellow(CResRef pxl_wnd); +double f_pixelgetyellowquantum(CResRef pxl_wnd); +void f_pixelsetalpha(CResRef pxl_wnd, double alpha); +void f_pixelsetalphaquantum(CResRef pxl_wnd, double alpha); +void f_pixelsetblack(CResRef pxl_wnd, double black); +void f_pixelsetblackquantum(CResRef pxl_wnd, double black); +void f_pixelsetblue(CResRef pxl_wnd, double blue); +void f_pixelsetbluequantum(CResRef pxl_wnd, double blue); +void f_pixelsetcolor(CResRef pxl_wnd, CStrRef imagemagick_col_str); +void f_pixelsetcolorcount(CResRef pxl_wnd, int count); +void f_pixelsetcyan(CResRef pxl_wnd, double cyan); +void f_pixelsetcyanquantum(CResRef pxl_wnd, double cyan); +void f_pixelsetgreen(CResRef pxl_wnd, double green); +void f_pixelsetgreenquantum(CResRef pxl_wnd, double green); +void f_pixelsetindex(CResRef pxl_wnd, double index); +void f_pixelsetmagenta(CResRef pxl_wnd, double magenta); +void f_pixelsetmagentaquantum(CResRef pxl_wnd, double magenta); +void f_pixelsetopacity(CResRef pxl_wnd, double opacity); +void f_pixelsetopacityquantum(CResRef pxl_wnd, double opacity); +void f_pixelsetquantumcolor(CResRef pxl_wnd, double red, double green, double blue, double opacity = 0.0); +void f_pixelsetred(CResRef pxl_wnd, double red); +void f_pixelsetredquantum(CResRef pxl_wnd, double red); +void f_pixelsetyellow(CResRef pxl_wnd, double yellow); +void f_pixelsetyellowquantum(CResRef pxl_wnd, double yellow); +Array f_pixelgetiteratorexception(CResRef pxl_iter); +String f_pixelgetiteratorexceptionstring(CResRef pxl_iter); +int64_t f_pixelgetiteratorexceptiontype(CResRef pxl_iter); +Array f_pixelgetnextiteratorrow(CResRef pxl_iter); +void f_pixelresetiterator(CResRef pxl_iter); +bool f_pixelsetiteratorrow(CResRef pxl_iter, int row); +bool f_pixelsynciterator(CResRef pxl_iter); /////////////////////////////////////////////////////////////////////////////// } diff --git a/hphp/runtime/ext/ext_mailparse.cpp b/hphp/runtime/ext/ext_mailparse.cpp index 68bd70047..289264f74 100644 --- a/hphp/runtime/ext/ext_mailparse.cpp +++ b/hphp/runtime/ext/ext_mailparse.cpp @@ -127,21 +127,21 @@ int64_t f_ezmlm_hash(CStrRef addr) { /////////////////////////////////////////////////////////////////////////////// // mailparse -Object f_mailparse_msg_create() { +Resource f_mailparse_msg_create() { return NEWOBJ(MimePart)(); } -bool f_mailparse_msg_free(CObjRef mimemail) { +bool f_mailparse_msg_free(CResRef mimemail) { return true; } Variant f_mailparse_msg_parse_file(CStrRef filename) { Variant stream = File::Open(filename, "rb"); if (same(stream, false)) return false; - File *f = stream.toObject().getTyped(); + File *f = stream.toResource().getTyped(); MimePart *p = NEWOBJ(MimePart)(); - Object ret(p); + Resource ret(p); while (!f->eof()) { String line = f->readLine(); if (!line.isNull()) { @@ -153,37 +153,38 @@ Variant f_mailparse_msg_parse_file(CStrRef filename) { return ret; } -bool f_mailparse_msg_parse(CObjRef mimemail, CStrRef data) { +bool f_mailparse_msg_parse(CResRef mimemail, CStrRef data) { return mimemail.getTyped()->parse(data.data(), data.size()); } -Variant f_mailparse_msg_extract_part_file(CObjRef mimemail, CVarRef filename, +Variant f_mailparse_msg_extract_part_file(CResRef mimemail, CVarRef filename, CVarRef callbackfunc /* = "" */) { return mimemail.getTyped()-> extract(filename, callbackfunc, MimePart::Decode8Bit | MimePart::DecodeNoHeaders, true); } -Variant f_mailparse_msg_extract_whole_part_file(CObjRef mimemail, +Variant f_mailparse_msg_extract_whole_part_file(CResRef mimemail, CVarRef filename, CVarRef callbackfunc /* = "" */) { return mimemail.getTyped()-> extract(filename, callbackfunc, MimePart::DecodeNone, true); } -Variant f_mailparse_msg_extract_part(CObjRef mimemail, CVarRef msgbody, +Variant f_mailparse_msg_extract_part(CResRef mimemail, CVarRef msgbody, CVarRef callbackfunc /* = "" */) { return mimemail.getTyped()-> extract(msgbody, callbackfunc, MimePart::Decode8Bit | MimePart::DecodeNoHeaders, false); } -Array f_mailparse_msg_get_part_data(CObjRef mimemail) { +Array f_mailparse_msg_get_part_data(CResRef mimemail) { return mimemail.getTyped()->getPartData().toArray(); } -Variant f_mailparse_msg_get_part(CObjRef mimemail, CStrRef mimesection) { - Object part = mimemail.getTyped()->findByName(mimesection.c_str()); +Variant f_mailparse_msg_get_part(CResRef mimemail, CStrRef mimesection) { + Resource part = + mimemail.getTyped()->findByName(mimesection.c_str()); if (part.isNull()) { raise_warning("cannot find section %s in message", mimesection.data()); return false; @@ -191,7 +192,7 @@ Variant f_mailparse_msg_get_part(CObjRef mimemail, CStrRef mimesection) { return part; } -Array f_mailparse_msg_get_structure(CObjRef mimemail) { +Array f_mailparse_msg_get_structure(CResRef mimemail) { return mimemail.getTyped()->getStructure(); } @@ -233,7 +234,7 @@ static int mailparse_stream_flush(void *stream) { return ((File*)stream)->flush() ? 1 : 0; } -bool f_mailparse_stream_encode(CObjRef sourcefp, CObjRef destfp, +bool f_mailparse_stream_encode(CResRef sourcefp, CResRef destfp, CStrRef encoding) { File *srcstream = sourcefp.getTyped(true, true); File *deststream = destfp.getTyped(true, true); @@ -349,12 +350,12 @@ const StaticString s_filename("filename"), s_origfilename("origfilename"); -Variant f_mailparse_uudecode_all(CObjRef fp) { +Variant f_mailparse_uudecode_all(CResRef fp) { File *instream = fp.getTyped(); instream->rewind(); File *outstream = NEWOBJ(TempFile)(false); - Object deleter(outstream); + Resource deleter(outstream); Array return_value; int nparts = 0; @@ -390,7 +391,7 @@ Variant f_mailparse_uudecode_all(CObjRef fp) { /* create a temp file for the data */ File *partstream = NEWOBJ(TempFile)(false); - Object deleter(partstream); + Resource deleter(partstream); if (partstream) { nparts++; item.set(s_filename, String(((TempFile*)partstream)->getName())); @@ -412,7 +413,7 @@ Variant f_mailparse_uudecode_all(CObjRef fp) { return return_value; } -Variant f_mailparse_determine_best_xfer_encoding(CObjRef fp) { +Variant f_mailparse_determine_best_xfer_encoding(CResRef fp) { File *stream = fp.getTyped(); stream->rewind(); diff --git a/hphp/runtime/ext/ext_mailparse.h b/hphp/runtime/ext/ext_mailparse.h index 3dc025794..e5583e9b6 100644 --- a/hphp/runtime/ext/ext_mailparse.h +++ b/hphp/runtime/ext/ext_mailparse.h @@ -27,20 +27,20 @@ namespace HPHP { bool f_mail(CStrRef to, CStrRef subject, CStrRef message, CStrRef additional_headers = null_string, CStrRef additional_parameters = null_string); int64_t f_ezmlm_hash(CStrRef addr); -Object f_mailparse_msg_create(); -bool f_mailparse_msg_free(CObjRef mimemail); +Resource f_mailparse_msg_create(); +bool f_mailparse_msg_free(CResRef mimemail); Variant f_mailparse_msg_parse_file(CStrRef filename); -bool f_mailparse_msg_parse(CObjRef mimemail, CStrRef data); -Variant f_mailparse_msg_extract_part_file(CObjRef mimemail, CVarRef filename, CVarRef callbackfunc = ""); -Variant f_mailparse_msg_extract_whole_part_file(CObjRef mimemail, CVarRef filename, CVarRef callbackfunc = ""); -Variant f_mailparse_msg_extract_part(CObjRef mimemail, CVarRef msgbody, CVarRef callbackfunc = ""); -Array f_mailparse_msg_get_part_data(CObjRef mimemail); -Variant f_mailparse_msg_get_part(CObjRef mimemail, CStrRef mimesection); -Array f_mailparse_msg_get_structure(CObjRef mimemail); +bool f_mailparse_msg_parse(CResRef mimemail, CStrRef data); +Variant f_mailparse_msg_extract_part_file(CResRef mimemail, CVarRef filename, CVarRef callbackfunc = ""); +Variant f_mailparse_msg_extract_whole_part_file(CResRef mimemail, CVarRef filename, CVarRef callbackfunc = ""); +Variant f_mailparse_msg_extract_part(CResRef mimemail, CVarRef msgbody, CVarRef callbackfunc = ""); +Array f_mailparse_msg_get_part_data(CResRef mimemail); +Variant f_mailparse_msg_get_part(CResRef mimemail, CStrRef mimesection); +Array f_mailparse_msg_get_structure(CResRef mimemail); Array f_mailparse_rfc822_parse_addresses(CStrRef addresses); -bool f_mailparse_stream_encode(CObjRef sourcefp, CObjRef destfp, CStrRef encoding); -Variant f_mailparse_uudecode_all(CObjRef fp); -Variant f_mailparse_determine_best_xfer_encoding(CObjRef fp); +bool f_mailparse_stream_encode(CResRef sourcefp, CResRef destfp, CStrRef encoding); +Variant f_mailparse_uudecode_all(CResRef fp); +Variant f_mailparse_determine_best_xfer_encoding(CResRef fp); /////////////////////////////////////////////////////////////////////////////// } diff --git a/hphp/runtime/ext/ext_mcrypt.cpp b/hphp/runtime/ext/ext_mcrypt.cpp index dff032f23..cbf826e5b 100644 --- a/hphp/runtime/ext/ext_mcrypt.cpp +++ b/hphp/runtime/ext/ext_mcrypt.cpp @@ -177,7 +177,7 @@ static Variant php_mcrypt_do_crypt(CStrRef cipher, CStrRef key, CStrRef data, return s.setSize(data_size); } -static Variant mcrypt_generic(CObjRef td, CStrRef data, bool dencrypt) { +static Variant mcrypt_generic(CResRef td, CStrRef data, bool dencrypt) { MCrypt *pm = td.getTyped(); if (!pm->m_init) { raise_warning("Operation disallowed prior to mcrypt_generic_init()."); @@ -232,10 +232,10 @@ Variant f_mcrypt_module_open(CStrRef algorithm, CStrRef algorithm_directory, return false; } - return Object(new MCrypt(td)); + return Resource(new MCrypt(td)); } -bool f_mcrypt_module_close(CObjRef td) { +bool f_mcrypt_module_close(CResRef td) { td.getTyped()->close(); return true; } @@ -464,33 +464,33 @@ int64_t f_mcrypt_get_key_size(CStrRef cipher, CStrRef module) { return ret; } -String f_mcrypt_enc_get_algorithms_name(CObjRef td) { +String f_mcrypt_enc_get_algorithms_name(CResRef td) { char *name = mcrypt_enc_get_algorithms_name(td.getTyped()->m_td); String ret(name, CopyString); mcrypt_free(name); return ret; } -int64_t f_mcrypt_enc_get_block_size(CObjRef td) { +int64_t f_mcrypt_enc_get_block_size(CResRef td) { return mcrypt_enc_get_block_size(td.getTyped()->m_td); } -int64_t f_mcrypt_enc_get_iv_size(CObjRef td) { +int64_t f_mcrypt_enc_get_iv_size(CResRef td) { return mcrypt_enc_get_iv_size(td.getTyped()->m_td); } -int64_t f_mcrypt_enc_get_key_size(CObjRef td) { +int64_t f_mcrypt_enc_get_key_size(CResRef td) { return mcrypt_enc_get_key_size(td.getTyped()->m_td); } -String f_mcrypt_enc_get_modes_name(CObjRef td) { +String f_mcrypt_enc_get_modes_name(CResRef td) { char *name = mcrypt_enc_get_modes_name(td.getTyped()->m_td); String ret(name, CopyString); mcrypt_free(name); return ret; } -Array f_mcrypt_enc_get_supported_key_sizes(CObjRef td) { +Array f_mcrypt_enc_get_supported_key_sizes(CResRef td) { int count = 0; int *key_sizes = mcrypt_enc_get_supported_key_sizes(td.getTyped()->m_td, &count); @@ -503,23 +503,23 @@ Array f_mcrypt_enc_get_supported_key_sizes(CObjRef td) { return ret; } -bool f_mcrypt_enc_is_block_algorithm_mode(CObjRef td) { +bool f_mcrypt_enc_is_block_algorithm_mode(CResRef td) { return mcrypt_enc_is_block_algorithm_mode(td.getTyped()->m_td) == 1; } -bool f_mcrypt_enc_is_block_algorithm(CObjRef td) { +bool f_mcrypt_enc_is_block_algorithm(CResRef td) { return mcrypt_enc_is_block_algorithm(td.getTyped()->m_td) == 1; } -bool f_mcrypt_enc_is_block_mode(CObjRef td) { +bool f_mcrypt_enc_is_block_mode(CResRef td) { return mcrypt_enc_is_block_mode(td.getTyped()->m_td) == 1; } -int64_t f_mcrypt_enc_self_test(CObjRef td) { +int64_t f_mcrypt_enc_self_test(CResRef td) { return mcrypt_enc_self_test(td.getTyped()->m_td); } -int64_t f_mcrypt_generic_init(CObjRef td, CStrRef key, CStrRef iv) { +int64_t f_mcrypt_generic_init(CResRef td, CStrRef key, CStrRef iv) { MCrypt *pm = td.getTyped(); int max_key_size = mcrypt_enc_get_key_size(pm->m_td); int iv_size = mcrypt_enc_get_iv_size(pm->m_td); @@ -576,15 +576,15 @@ int64_t f_mcrypt_generic_init(CObjRef td, CStrRef key, CStrRef iv) { return result; } -Variant f_mcrypt_generic(CObjRef td, CStrRef data) { +Variant f_mcrypt_generic(CResRef td, CStrRef data) { return mcrypt_generic(td, data, false); } -Variant f_mdecrypt_generic(CObjRef td, CStrRef data) { +Variant f_mdecrypt_generic(CResRef td, CStrRef data) { return mcrypt_generic(td, data, true); } -bool f_mcrypt_generic_deinit(CObjRef td) { +bool f_mcrypt_generic_deinit(CResRef td) { MCrypt *pm = td.getTyped(); if (mcrypt_generic_deinit(pm->m_td) < 0) { raise_warning("Could not terminate encryption specifier"); @@ -594,7 +594,7 @@ bool f_mcrypt_generic_deinit(CObjRef td) { return true; } -bool f_mcrypt_generic_end(CObjRef td) { +bool f_mcrypt_generic_end(CResRef td) { return f_mcrypt_generic_deinit(td); } diff --git a/hphp/runtime/ext/ext_mcrypt.h b/hphp/runtime/ext/ext_mcrypt.h index 0397f3e50..70dadfadd 100644 --- a/hphp/runtime/ext/ext_mcrypt.h +++ b/hphp/runtime/ext/ext_mcrypt.h @@ -26,7 +26,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// Variant f_mcrypt_module_open(CStrRef algorithm, CStrRef algorithm_directory, CStrRef mode, CStrRef mode_directory); -bool f_mcrypt_module_close(CObjRef td); +bool f_mcrypt_module_close(CResRef td); Array f_mcrypt_list_algorithms(CStrRef lib_dir = null_string); Array f_mcrypt_list_modes(CStrRef lib_dir = null_string); int64_t f_mcrypt_module_get_algo_block_size(CStrRef algorithm, CStrRef lib_dir = null_string); @@ -47,21 +47,21 @@ Variant f_mcrypt_get_block_size(CStrRef cipher, CStrRef module = null_string); Variant f_mcrypt_get_cipher_name(CStrRef cipher); Variant f_mcrypt_get_iv_size(CStrRef cipher, CStrRef mode); int64_t f_mcrypt_get_key_size(CStrRef cipher, CStrRef module); -String f_mcrypt_enc_get_algorithms_name(CObjRef td); -int64_t f_mcrypt_enc_get_block_size(CObjRef td); -int64_t f_mcrypt_enc_get_iv_size(CObjRef td); -int64_t f_mcrypt_enc_get_key_size(CObjRef td); -String f_mcrypt_enc_get_modes_name(CObjRef td); -Array f_mcrypt_enc_get_supported_key_sizes(CObjRef td); -bool f_mcrypt_enc_is_block_algorithm_mode(CObjRef td); -bool f_mcrypt_enc_is_block_algorithm(CObjRef td); -bool f_mcrypt_enc_is_block_mode(CObjRef td); -int64_t f_mcrypt_enc_self_test(CObjRef td); -Variant f_mcrypt_generic(CObjRef td, CStrRef data); -int64_t f_mcrypt_generic_init(CObjRef td, CStrRef key, CStrRef iv); -Variant f_mdecrypt_generic(CObjRef td, CStrRef data); -bool f_mcrypt_generic_deinit(CObjRef td); -bool f_mcrypt_generic_end(CObjRef td); +String f_mcrypt_enc_get_algorithms_name(CResRef td); +int64_t f_mcrypt_enc_get_block_size(CResRef td); +int64_t f_mcrypt_enc_get_iv_size(CResRef td); +int64_t f_mcrypt_enc_get_key_size(CResRef td); +String f_mcrypt_enc_get_modes_name(CResRef td); +Array f_mcrypt_enc_get_supported_key_sizes(CResRef td); +bool f_mcrypt_enc_is_block_algorithm_mode(CResRef td); +bool f_mcrypt_enc_is_block_algorithm(CResRef td); +bool f_mcrypt_enc_is_block_mode(CResRef td); +int64_t f_mcrypt_enc_self_test(CResRef td); +Variant f_mcrypt_generic(CResRef td, CStrRef data); +int64_t f_mcrypt_generic_init(CResRef td, CStrRef key, CStrRef iv); +Variant f_mdecrypt_generic(CResRef td, CStrRef data); +bool f_mcrypt_generic_deinit(CResRef td); +bool f_mcrypt_generic_end(CResRef td); /////////////////////////////////////////////////////////////////////////////// } diff --git a/hphp/runtime/ext/ext_mysql.cpp b/hphp/runtime/ext/ext_mysql.cpp index d742ab8b4..99aea36a9 100644 --- a/hphp/runtime/ext/ext_mysql.cpp +++ b/hphp/runtime/ext/ext_mysql.cpp @@ -101,7 +101,7 @@ public: totalRowCount = 0; } - Object defaultConn; + Resource defaultConn; int readTimeout; int totalRowCount; // from all queries in current request }; @@ -116,7 +116,7 @@ MySQL *MySQL::Get(CVarRef link_identifier) { if (link_identifier.isNull()) { return GetDefaultConn(); } - MySQL *mysql = link_identifier.toObject().getTyped + MySQL *mysql = link_identifier.toResource().getTyped (!RuntimeOption::ThrowBadTypeExceptions, !RuntimeOption::ThrowBadTypeExceptions); return mysql; @@ -332,7 +332,7 @@ bool MySQL::reconnect(CStrRef host, int port, CStrRef socket, CStrRef username, // helpers static MySQLResult *get_result(CVarRef result) { - MySQLResult *res = result.toObject().getTyped + MySQLResult *res = result.toResource().getTyped (!RuntimeOption::ThrowBadTypeExceptions, !RuntimeOption::ThrowBadTypeExceptions); if (res == NULL || (res->get() == NULL && !res->isLocalized())) { @@ -533,7 +533,7 @@ static Variant php_mysql_do_connect(String server, String username, socket = MySQL::GetDefaultSocket(); } - Object ret; + Resource ret; MySQL *mySQL = NULL; if (persistent) { mySQL = MySQL::GetPersistent(host, port, socket, username, password, @@ -872,7 +872,7 @@ static Variant php_mysql_localize_result(MYSQL *mysql) { return true; } mysql->status = MYSQL_STATUS_READY; - Variant result = Object(NEWOBJ(MySQLResult)(NULL, true)); + Variant result = Resource(NEWOBJ(MySQLResult)(nullptr, true)); if (!php_mysql_read_rows(mysql, result)) { return false; } @@ -1045,7 +1045,7 @@ static Variant php_mysql_do_query_general(CStrRef query, CVarRef link_id, } MySQLResult *r = NEWOBJ(MySQLResult)(mysql_result); - Object ret(r); + Resource ret(r); if (RuntimeOption::MaxSQLRowCount > 0 && (s_mysql_data->totalRowCount += r->getRowCount()) @@ -1111,7 +1111,7 @@ Variant f_mysql_fetch_result(CVarRef link_identifier /* = null */) { return true; } - return Object(NEWOBJ(MySQLResult)(mysql_result)); + return Resource(NEWOBJ(MySQLResult)(mysql_result)); } Variant f_mysql_unbuffered_query(CStrRef query, @@ -1133,7 +1133,7 @@ Variant f_mysql_list_dbs(CVarRef link_identifier /* = null */) { raise_warning("Unable to save MySQL query result"); return false; } - return Object(NEWOBJ(MySQLResult)(res)); + return Resource(NEWOBJ(MySQLResult)(res)); } Variant f_mysql_list_tables(CStrRef database, @@ -1148,7 +1148,7 @@ Variant f_mysql_list_tables(CStrRef database, raise_warning("Unable to save MySQL query result"); return false; } - return Object(NEWOBJ(MySQLResult)(res)); + return Resource(NEWOBJ(MySQLResult)(res)); } Variant f_mysql_list_fields(CStrRef database_name, CStrRef table_name, @@ -1166,7 +1166,7 @@ Variant f_mysql_list_processes(CVarRef link_identifier /* = null */) { raise_warning("Unable to save MySQL query result"); return false; } - return Object(NEWOBJ(MySQLResult)(res)); + return Resource(NEWOBJ(MySQLResult)(res)); } /////////////////////////////////////////////////////////////////////////////// @@ -1347,12 +1347,12 @@ Variant f_mysql_async_query_result(CVarRef link_identifier) { MYSQL_RES* mysql_result = mysql_use_result(conn); MySQLResult *r = NEWOBJ(MySQLResult)(mysql_result); r->setAsyncConnection(mySQL); - Object ret(r); + Resource ret(r); return ret; } bool f_mysql_async_query_completed(CVarRef result) { - MySQLResult *res = result.toObject().getTyped + MySQLResult *res = result.toResource().getTyped (!RuntimeOption::ThrowBadTypeExceptions, !RuntimeOption::ThrowBadTypeExceptions); return !res || res->get() == NULL; @@ -1450,7 +1450,7 @@ Variant f_mysql_async_wait_actionable(CVarRef items, double timeout) { return Array::Create(); } - MySQL* mySQL = entry.rvalAt(0).toObject().getTyped(); + MySQL* mySQL = entry.rvalAt(0).toResource().getTyped(); MYSQL* conn = mySQL->get(); if (conn->async_op_status == ASYNC_OP_UNSET) { raise_warning("runtime/ext_mysql: no pending async operation in " @@ -1489,7 +1489,7 @@ Variant f_mysql_async_wait_actionable(CVarRef items, double timeout) { nfds); return Array::Create(); } - MySQL* mySQL = entry.rvalAt(0).toObject().getTyped(); + MySQL* mySQL = entry.rvalAt(0).toResource().getTyped(); MYSQL* conn = mySQL->get(); pollfd* fd = &fds[nfds++]; @@ -1637,7 +1637,7 @@ Variant f_mysql_result(CVarRef result, int row, mysql_result = res->get(); if (row < 0 || row >= (int)mysql_num_rows(mysql_result)) { raise_warning("Unable to jump to row %d on MySQL result index %d", - row, result.toObject()->o_getId()); + row, result.toResource()->o_getId()); return false; } mysql_data_seek(mysql_result, row); @@ -1682,7 +1682,7 @@ Variant f_mysql_result(CVarRef result, int row, if (!found) { /* no match found */ raise_warning("%s%s%s not found in MySQL result index %d", table_name.data(), (table_name.empty() ? "" : "."), - field_name.data(), result.toObject()->o_getId()); + field_name.data(), result.toResource()->o_getId()); return false; } } else { diff --git a/hphp/runtime/ext/ext_network.cpp b/hphp/runtime/ext/ext_network.cpp index 64c4a3298..55c0eb8f8 100644 --- a/hphp/runtime/ext/ext_network.cpp +++ b/hphp/runtime/ext/ext_network.cpp @@ -890,15 +890,15 @@ bool f_getmxrr(CStrRef hostname, VRefParam mxhosts, * f_fsockopen() and f_pfsockopen() are implemented in ext_socket.cpp. */ -Variant f_socket_get_status(CObjRef stream) { +Variant f_socket_get_status(CResRef stream) { return f_stream_get_meta_data(stream); } -bool f_socket_set_blocking(CObjRef stream, int mode) { +bool f_socket_set_blocking(CResRef stream, int mode) { return f_stream_set_blocking(stream, mode); } -bool f_socket_set_timeout(CObjRef stream, int seconds, +bool f_socket_set_timeout(CResRef stream, int seconds, int microseconds /* = 0 */) { return f_stream_set_timeout(stream, seconds, microseconds); } diff --git a/hphp/runtime/ext/ext_network.h b/hphp/runtime/ext/ext_network.h index f4c38c713..d0a3c86ac 100644 --- a/hphp/runtime/ext/ext_network.h +++ b/hphp/runtime/ext/ext_network.h @@ -59,11 +59,11 @@ Variant f_fsockopen(CStrRef hostname, int port = -1, VRefParam errnum = uninit_n Variant f_pfsockopen(CStrRef hostname, int port = -1, VRefParam errnum = uninit_null(), VRefParam errstr = uninit_null(), double timeout = 0.0); -Variant f_socket_get_status(CObjRef stream); +Variant f_socket_get_status(CResRef stream); -bool f_socket_set_blocking(CObjRef stream, int mode); +bool f_socket_set_blocking(CResRef stream, int mode); -bool f_socket_set_timeout(CObjRef stream, int seconds, +bool f_socket_set_timeout(CResRef stream, int seconds, int microseconds = 0); /////////////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/ext/ext_openssl.cpp b/hphp/runtime/ext/ext_openssl.cpp index 2f5a4c1b0..d1ea94349 100644 --- a/hphp/runtime/ext/ext_openssl.cpp +++ b/hphp/runtime/ext/ext_openssl.cpp @@ -179,14 +179,14 @@ public: * passphrase - NULL causes a passphrase prompt to be emitted in * the Apache error log! */ - static Object Get(CVarRef var, bool public_key, - const char *passphrase = NULL) { + static Resource Get(CVarRef var, bool public_key, + const char *passphrase = nullptr) { if (var.is(KindOfArray)) { Array arr = var.toArray(); if (!arr.exists(int64_t(0)) || !arr.exists(int64_t(1))) { raise_warning("key array must be of the form " "array(0 => key, 1 => phrase)"); - return Object(); + return Resource(); } String zphrase = arr[1].toString(); @@ -195,29 +195,29 @@ public: return GetHelper(var, public_key, passphrase); } - static Object GetHelper(CVarRef var, bool public_key, - const char *passphrase) { - Object ocert; + static Resource GetHelper(CVarRef var, bool public_key, + const char *passphrase) { + Resource ocert; EVP_PKEY *key = NULL; if (var.isResource()) { - Certificate *cert = var.toObject().getTyped(true, true); - Key *key = var.toObject().getTyped(true, true); + Certificate *cert = var.toResource().getTyped(true, true); + Key *key = var.toResource().getTyped(true, true); if (cert == NULL && key == NULL) { - return Object(); + return Resource(); } if (key) { bool is_priv = key->isPrivate(); if (!public_key && !is_priv) { raise_warning("supplied key param is a public key"); - return Object(); + return Resource(); } if (public_key && is_priv) { raise_warning("Don't know how to get public key from " "this private key"); - return Object(); + return Resource(); } - return var.toObject(); + return var.toResource(); } ocert = cert; } else { @@ -228,14 +228,14 @@ public: if (ocert.isNull()) { /* not a X509 certificate, try to retrieve public key */ BIO *in = Certificate::ReadData(var); - if (in == NULL) return Object(); + if (in == nullptr) return Resource(); key = PEM_read_bio_PUBKEY(in, NULL,NULL, NULL); BIO_free(in); } } else { /* we want the private key */ BIO *in = Certificate::ReadData(var); - if (in == NULL) return Object(); + if (in == nullptr) return Resource(); key = PEM_read_bio_PrivateKey(in, NULL,NULL, (void*)passphrase); BIO_free(in); } @@ -247,9 +247,10 @@ public: } if (key) { - return Object(new Key(key)); + return Resource(new Key(key)); } - return Object(); + // Is it okay to return a "null" resource? + return Resource(); } }; @@ -268,7 +269,7 @@ public: // overriding ResourceData virtual CStrRef o_getClassNameHook() const { return s_class_name; } - static X509_REQ *Get(CVarRef var, Object &ocsr) { + static X509_REQ *Get(CVarRef var, Resource &ocsr) { ocsr = Get(var); CSRequest *csr = ocsr.getTyped(true); if (csr == NULL || csr->m_csr == NULL) { @@ -278,21 +279,21 @@ public: return csr->m_csr; } - static Object Get(CVarRef var) { + static Resource Get(CVarRef var) { if (var.isResource()) { - return var.toObject(); + return var.toResource(); } if (var.isString() || var.isObject()) { BIO *in = Certificate::ReadData(var); - if (in == NULL) return Object(); + if (in == nullptr) return Resource(); X509_REQ *csr = PEM_read_bio_X509_REQ(in, NULL,NULL,NULL); BIO_free(in); if (csr) { - return Object(new CSRequest(csr)); + return Resource(new CSRequest(csr)); } } - return Object(); + return Resource(); } }; @@ -887,7 +888,7 @@ static bool php_openssl_make_REQ(struct php_x509_request *req, X509_REQ *csr, bool f_openssl_csr_export_to_file(CVarRef csr, CStrRef outfilename, bool notext /* = true */) { - Object ocsr; + Resource ocsr; X509_REQ *pcsr = CSRequest::Get(csr, ocsr); if (pcsr == NULL) return false; @@ -906,7 +907,7 @@ bool f_openssl_csr_export_to_file(CVarRef csr, CStrRef outfilename, } bool f_openssl_csr_export(CVarRef csr, VRefParam out, bool notext /* = true */) { - Object ocsr; + Resource ocsr; X509_REQ *pcsr = CSRequest::Get(csr, ocsr); if (pcsr == NULL) return false; @@ -928,16 +929,16 @@ bool f_openssl_csr_export(CVarRef csr, VRefParam out, bool notext /* = true */) } Variant f_openssl_csr_get_public_key(CVarRef csr) { - Object ocsr; + Resource ocsr; X509_REQ *pcsr = CSRequest::Get(csr, ocsr); if (pcsr == NULL) return false; - return Object(new Key(X509_REQ_get_pubkey(pcsr))); + return Resource(new Key(X509_REQ_get_pubkey(pcsr))); } Variant f_openssl_csr_get_subject(CVarRef csr, bool use_shortnames /* = true */) { - Object ocsr; + Resource ocsr; X509_REQ *pcsr = CSRequest::Get(csr, ocsr); if (pcsr == NULL) return false; @@ -954,7 +955,7 @@ Variant f_openssl_csr_new(CArrRef dn, VRefParam privkey, struct php_x509_request req; memset(&req, 0, sizeof(req)); - Object okey; + Resource okey; X509_REQ *csr = NULL; vector strings; if (php_openssl_parse_config(&req, configargs.toArray(), strings)) { @@ -968,7 +969,7 @@ Variant f_openssl_csr_new(CArrRef dn, VRefParam privkey, if (req.priv_key == NULL) { req.generatePrivateKey(); if (req.priv_key) { - okey = Object(new Key(req.priv_key)); + okey = Resource(new Key(req.priv_key)); } } if (req.priv_key == NULL) { @@ -989,7 +990,7 @@ Variant f_openssl_csr_new(CArrRef dn, VRefParam privkey, } else { ret = true; if (X509_REQ_sign(csr, req.priv_key, req.digest)) { - ret = Object(new CSRequest(csr)); + ret = Resource(new CSRequest(csr)); csr = NULL; } else { raise_warning("Error signing request"); @@ -1010,11 +1011,11 @@ Variant f_openssl_csr_new(CArrRef dn, VRefParam privkey, Variant f_openssl_csr_sign(CVarRef csr, CVarRef cacert, CVarRef priv_key, int days, CVarRef configargs /* = null_variant */, int serial /* = 0 */) { - Object ocsr; + Resource ocsr; X509_REQ *pcsr = CSRequest::Get(csr, ocsr); if (pcsr == NULL) return false; - Object ocert; + Resource ocert; if (!cacert.isNull()) { ocert = Certificate::Get(cacert); if (ocert.isNull()) { @@ -1022,7 +1023,7 @@ Variant f_openssl_csr_sign(CVarRef csr, CVarRef cacert, CVarRef priv_key, return false; } } - Object okey = Key::Get(priv_key, false); + Resource okey = Key::Get(priv_key, false); if (okey.isNull()) { raise_warning("cannot get private key from parameter 3"); return false; @@ -1037,7 +1038,7 @@ Variant f_openssl_csr_sign(CVarRef csr, CVarRef cacert, CVarRef priv_key, return false; } - Object onewcert; + Resource onewcert; struct php_x509_request req; memset(&req, 0, sizeof(req)); Variant ret = false; @@ -1071,7 +1072,7 @@ Variant f_openssl_csr_sign(CVarRef csr, CVarRef cacert, CVarRef priv_key, raise_warning("No memory"); goto cleanup; } - onewcert = Object(new Certificate(new_cert)); + onewcert = Resource(new Certificate(new_cert)); /* Version 3 cert */ if (!X509_set_version(new_cert, 2)) { goto cleanup; @@ -1124,13 +1125,13 @@ Variant f_openssl_error_string() { return false; } -void f_openssl_free_key(CObjRef key) { +void f_openssl_free_key(CResRef key) { return f_openssl_pkey_free(key); } bool f_openssl_open(CStrRef sealed_data, VRefParam open_data, CStrRef env_key, CVarRef priv_key_id) { - Object okey = Key::Get(priv_key_id, false); + Resource okey = Key::Get(priv_key_id, false); if (okey.isNull()) { raise_warning("unable to coerce parameter 4 into a private key"); return false; @@ -1163,7 +1164,7 @@ static STACK_OF(X509) *php_array_to_X509_sk(CVarRef certs) { arrCerts.append(certs); } for (ArrayIter iter(arrCerts); iter; ++iter) { - Object ocert = Certificate::Get(iter.second()); + Resource ocert = Certificate::Get(iter.second()); if (ocert.isNull()) { break; } @@ -1178,12 +1179,12 @@ static const StaticString s_extracerts("extracerts"); static bool openssl_pkcs12_export_impl(CVarRef x509, BIO *bio_out, CVarRef priv_key, CStrRef pass, CVarRef args /* = null_variant */) { - Object ocert = Certificate::Get(x509); + Resource ocert = Certificate::Get(x509); if (ocert.isNull()) { raise_warning("cannot get cert from parameter 1"); return false; } - Object okey = Key::Get(priv_key, false); + Resource okey = Key::Get(priv_key, false); if (okey.isNull()) { raise_warning("cannot get private key from parameter 3"); return false; @@ -1317,9 +1318,9 @@ bool f_openssl_pkcs7_decrypt(CStrRef infilename, CStrRef outfilename, bool ret = false; BIO *in = NULL, *out = NULL, *datain = NULL; PKCS7 *p7 = NULL; - Object okey; + Resource okey; - Object ocert = Certificate::Get(recipcert); + Resource ocert = Certificate::Get(recipcert); if (ocert.isNull()) { raise_warning("unable to coerce parameter 3 to x509 cert"); goto clean_exit; @@ -1445,7 +1446,7 @@ bool f_openssl_pkcs7_sign(CStrRef infilename, CStrRef outfilename, STACK_OF(X509) *others = NULL; BIO *infile = NULL, *outfile = NULL; PKCS7 *p7 = NULL; - Object okey, ocert; + Resource okey, ocert; if (!extracerts.empty()) { others = load_all_certs_from_file(extracerts.data()); @@ -1586,7 +1587,7 @@ Variant f_openssl_pkcs7_verify(CStrRef filename, int flags, static bool openssl_pkey_export_impl(CVarRef key, BIO *bio_out, CStrRef passphrase /* = null_string */, CVarRef configargs /* = null_variant */) { - Object okey = Key::Get(key, false, passphrase.data()); + Resource okey = Key::Get(key, false, passphrase.data()); if (okey.isNull()) { raise_warning("cannot get key from parameter 1"); return false; @@ -1641,7 +1642,7 @@ bool f_openssl_pkey_export(CVarRef key, VRefParam out, return ret; } -void f_openssl_pkey_free(CObjRef key) { +void f_openssl_pkey_free(CResRef key) { // do nothing } @@ -1689,7 +1690,7 @@ static void add_bignum_as_string(Array &arr, smart_free(out); } -Array f_openssl_pkey_get_details(CObjRef key) { +Array f_openssl_pkey_get_details(CResRef key) { EVP_PKEY *pkey = key.getTyped()->m_key; BIO *out = BIO_new(BIO_s_mem()); PEM_write_bio_PUBKEY(out, pkey); @@ -1753,7 +1754,7 @@ Array f_openssl_pkey_get_details(CObjRef key) { Variant f_openssl_pkey_get_private(CVarRef key, CStrRef passphrase /* = null_string */) { - Object okey = Key::Get(key, false, passphrase.data()); + Resource okey = Key::Get(key, false, passphrase.data()); if (okey.isNull()) { return false; } @@ -1766,7 +1767,7 @@ Variant f_openssl_get_privatekey(CVarRef key, } Variant f_openssl_pkey_get_public(CVarRef certificate) { - Object okey = Key::Get(certificate, true); + Resource okey = Key::Get(certificate, true); if (okey.isNull()) { return false; } @@ -1777,15 +1778,15 @@ Variant f_openssl_get_publickey(CVarRef certificate) { return f_openssl_pkey_get_public(certificate); } -Object f_openssl_pkey_new(CVarRef configargs /* = null_variant */) { +Resource f_openssl_pkey_new(CVarRef configargs /* = null_variant */) { struct php_x509_request req; memset(&req, 0, sizeof(req)); - Object ret; + Resource ret; vector strings; if (php_openssl_parse_config(&req, configargs.toArray(), strings) && req.generatePrivateKey()) { - ret = Object(new Key(req.priv_key)); + ret = Resource(new Key(req.priv_key)); } php_openssl_dispose_config(&req); @@ -1794,7 +1795,7 @@ Object f_openssl_pkey_new(CVarRef configargs /* = null_variant */) { bool f_openssl_private_decrypt(CStrRef data, VRefParam decrypted, CVarRef key, int padding /* = k_OPENSSL_PKCS1_PADDING */) { - Object okey = Key::Get(key, false); + Resource okey = Key::Get(key, false); if (okey.isNull()) { raise_warning("key parameter is not a valid private key"); return false; @@ -1832,7 +1833,7 @@ bool f_openssl_private_decrypt(CStrRef data, VRefParam decrypted, CVarRef key, bool f_openssl_private_encrypt(CStrRef data, VRefParam crypted, CVarRef key, int padding /* = k_OPENSSL_PKCS1_PADDING */) { - Object okey = Key::Get(key, false); + Resource okey = Key::Get(key, false); if (okey.isNull()) { raise_warning("key param is not a valid private key"); return false; @@ -1866,7 +1867,7 @@ bool f_openssl_private_encrypt(CStrRef data, VRefParam crypted, CVarRef key, bool f_openssl_public_decrypt(CStrRef data, VRefParam decrypted, CVarRef key, int padding /* = k_OPENSSL_PKCS1_PADDING */) { - Object okey = Key::Get(key, true); + Resource okey = Key::Get(key, true); if (okey.isNull()) { raise_warning("key parameter is not a valid public key"); return false; @@ -1904,7 +1905,7 @@ bool f_openssl_public_decrypt(CStrRef data, VRefParam decrypted, CVarRef key, bool f_openssl_public_encrypt(CStrRef data, VRefParam crypted, CVarRef key, int padding /* = k_OPENSSL_PKCS1_PADDING */) { - Object okey = Key::Get(key, true); + Resource okey = Key::Get(key, true); if (okey.isNull()) { raise_warning("key parameter is not a valid public key"); return false; @@ -1949,7 +1950,7 @@ Variant f_openssl_seal(CStrRef data, VRefParam sealed_data, VRefParam env_keys, int *eksl = (int*)malloc(nkeys * sizeof(*eksl)); unsigned char **eks = (unsigned char **)malloc(nkeys * sizeof(*eks)); memset(eks, 0, sizeof(*eks) * nkeys); - vector holder; + vector holder; /* get the public keys we are using to seal this data */ bool ret = true; @@ -1957,7 +1958,7 @@ Variant f_openssl_seal(CStrRef data, VRefParam sealed_data, VRefParam env_keys, String s; unsigned char *buf = NULL; for (ArrayIter iter(pub_key_ids); iter; ++iter, ++i) { - Object okey = Key::Get(iter.second(), true); + Resource okey = Key::Get(iter.second(), true); if (okey.isNull()) { raise_warning("not a public key (%dth member of pubkeys)", i + 1); ret = false; @@ -2032,7 +2033,7 @@ static const EVP_MD *php_openssl_get_evp_md_from_algo(long algo) { bool f_openssl_sign(CStrRef data, VRefParam signature, CVarRef priv_key_id, int signature_alg /* = k_OPENSSL_ALGO_SHA1 */) { - Object okey = Key::Get(priv_key_id, false); + Resource okey = Key::Get(priv_key_id, false); if (okey.isNull()) { raise_warning("supplied key param cannot be coerced into a private key"); return false; @@ -2075,7 +2076,7 @@ Variant f_openssl_verify(CStrRef data, CStrRef signature, CVarRef pub_key_id, return false; } - Object okey = Key::Get(pub_key_id, true); + Resource okey = Key::Get(pub_key_id, true); if (okey.isNull()) { raise_warning("supplied key param cannot be coerced into a public key"); return false; @@ -2093,11 +2094,11 @@ Variant f_openssl_verify(CStrRef data, CStrRef signature, CVarRef pub_key_id, } bool f_openssl_x509_check_private_key(CVarRef cert, CVarRef key) { - Object ocert = Certificate::Get(cert); + Resource ocert = Certificate::Get(cert); if (ocert.isNull()) { return false; } - Object okey = Key::Get(key, false); + Resource okey = Key::Get(key, false); if (okey.isNull()) { return false; } @@ -2129,7 +2130,7 @@ int64_t f_openssl_x509_checkpurpose(CVarRef x509cert, int purpose, int ret = -1; STACK_OF(X509) *untrustedchain = NULL; X509_STORE *pcainfo = NULL; - Object ocert; + Resource ocert; if (!untrustedfile.empty()) { untrustedchain = load_all_certs_from_file(untrustedfile.data()); @@ -2166,7 +2167,7 @@ int64_t f_openssl_x509_checkpurpose(CVarRef x509cert, int purpose, static bool openssl_x509_export_impl(CVarRef x509, BIO *bio_out, bool notext /* = true */) { - Object ocert = Certificate::Get(x509); + Resource ocert = Certificate::Get(x509); if (ocert.isNull()) { raise_warning("cannot get cert from parameter 1"); return false; @@ -2206,7 +2207,7 @@ bool f_openssl_x509_export(CVarRef x509, VRefParam output, return ret; } -void f_openssl_x509_free(CObjRef x509cert) { +void f_openssl_x509_free(CResRef x509cert) { // do nothing } @@ -2261,7 +2262,7 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME *timestr) { } Variant f_openssl_x509_parse(CVarRef x509cert, bool shortnames /* = true */) { - Object ocert = Certificate::Get(x509cert); + Resource ocert = Certificate::Get(x509cert); if (ocert.isNull()) { return false; } @@ -2353,7 +2354,7 @@ Variant f_openssl_x509_parse(CVarRef x509cert, bool shortnames /* = true */) { } Variant f_openssl_x509_read(CVarRef x509certdata) { - Object ocert = Certificate::Get(x509certdata); + Resource ocert = Certificate::Get(x509certdata); if (ocert.isNull()) { raise_warning("supplied parameter cannot be coerced into " "an X509 certificate!"); diff --git a/hphp/runtime/ext/ext_openssl.h b/hphp/runtime/ext/ext_openssl.h index ab337d411..76d01c38d 100644 --- a/hphp/runtime/ext/ext_openssl.h +++ b/hphp/runtime/ext/ext_openssl.h @@ -42,14 +42,14 @@ bool f_openssl_pkcs7_sign(CStrRef infilename, CStrRef outfilename, CVarRef signc Variant f_openssl_pkcs7_verify(CStrRef filename, int flags, CStrRef outfilename = null_string, CArrRef cainfo = null_array, CStrRef extracerts = null_string, CStrRef content = null_string); bool f_openssl_pkey_export_to_file(CVarRef key, CStrRef outfilename, CStrRef passphrase = null_string, CVarRef configargs = null_variant); bool f_openssl_pkey_export(CVarRef key, VRefParam out, CStrRef passphrase = null_string, CVarRef configargs = null_variant); -void f_openssl_pkey_free(CObjRef key); -void f_openssl_free_key(CObjRef key); -Array f_openssl_pkey_get_details(CObjRef key); +void f_openssl_pkey_free(CResRef key); +void f_openssl_free_key(CResRef key); +Array f_openssl_pkey_get_details(CResRef key); Variant f_openssl_pkey_get_private(CVarRef key, CStrRef passphrase = null_string); Variant f_openssl_get_privatekey(CVarRef key, CStrRef passphrase = null_string); Variant f_openssl_pkey_get_public(CVarRef certificate); Variant f_openssl_get_publickey(CVarRef certificate); -Object f_openssl_pkey_new(CVarRef configargs = null_variant); +Resource f_openssl_pkey_new(CVarRef configargs = null_variant); bool f_openssl_private_decrypt(CStrRef data, VRefParam decrypted, CVarRef key, int padding = k_OPENSSL_PKCS1_PADDING); bool f_openssl_private_encrypt(CStrRef data, VRefParam crypted, CVarRef key, int padding = k_OPENSSL_PKCS1_PADDING); bool f_openssl_public_decrypt(CStrRef data, VRefParam decrypted, CVarRef key, int padding = k_OPENSSL_PKCS1_PADDING); @@ -61,7 +61,7 @@ bool f_openssl_x509_check_private_key(CVarRef cert, CVarRef key); int64_t f_openssl_x509_checkpurpose(CVarRef x509cert, int purpose, CArrRef cainfo = null_array, CStrRef untrustedfile = null_string); bool f_openssl_x509_export_to_file(CVarRef x509, CStrRef outfilename, bool notext = true); bool f_openssl_x509_export(CVarRef x509, VRefParam output, bool notext = true); -void f_openssl_x509_free(CObjRef x509cert); +void f_openssl_x509_free(CResRef x509cert); Variant f_openssl_x509_parse(CVarRef x509cert, bool shortnames = true); Variant f_openssl_x509_read(CVarRef x509certdata); Variant f_openssl_random_pseudo_bytes(int length, VRefParam crypto_strong = false); diff --git a/hphp/runtime/ext/ext_pdo.cpp b/hphp/runtime/ext/ext_pdo.cpp index f6c965869..9355bc5e6 100644 --- a/hphp/runtime/ext/ext_pdo.cpp +++ b/hphp/runtime/ext/ext_pdo.cpp @@ -645,7 +645,7 @@ static bool pdo_stmt_describe_columns(sp_PDOStatement stmt) { return false; } - String &name = stmt->columns[col].toObject().getTyped()->name; + String &name = stmt->columns[col].toResource().getTyped()->name; /* if we are applying case conversions on column names, do so now */ if (stmt->dbh->native_case != stmt->dbh->desired_case && @@ -663,7 +663,7 @@ static bool pdo_stmt_describe_columns(sp_PDOStatement stmt) { if (stmt->bound_columns.exists(name)) { PDOBoundParam *param = - stmt->bound_columns[name].toObject().getTyped(); + stmt->bound_columns[name].toResource().getTyped(); param->paramno = col; } } @@ -951,7 +951,7 @@ void c_PDO::t___construct(CStrRef dsn, CStrRef username /* = null_string */, if (same(stream, false)) { throw_pdo_exception(uninit_null(), uninit_null(), "invalid data source URI"); } - data_source = stream.toObject().getTyped()->readLine(1024); + data_source = stream.toResource().getTyped()->readLine(1024); colon = strchr(data_source.data(), ':'); if (!colon) { throw_pdo_exception(uninit_null(), uninit_null(), "invalid data source name (via URI)"); @@ -1545,13 +1545,13 @@ static bool dispatch_param_event(sp_PDOStatement stmt, return true; } for (ArrayIter iter(stmt->bound_params); iter; ++iter) { - PDOBoundParam *param = iter.second().toObject().getTyped(); + PDOBoundParam *param = iter.second().toResource().getTyped(); if (!stmt->paramHook(param, event_type)) { return false; } } for (ArrayIter iter(stmt->bound_columns); iter; ++iter) { - PDOBoundParam *param = iter.second().toObject().getTyped(); + PDOBoundParam *param = iter.second().toResource().getTyped(); if (!stmt->paramHook(param, event_type)) { return false; } @@ -1586,7 +1586,7 @@ static bool really_register_bound_param(PDOBoundParam *param, if (!is_param && !param->name.empty() && !stmt->columns.empty()) { /* try to map the name to the column */ for (int i = 0; i < stmt->column_count; i++) { - if (stmt->columns[i].toObject().getTyped()->name == + if (stmt->columns[i].toResource().getTyped()->name == param->name) { param->paramno = i; break; @@ -1655,7 +1655,7 @@ static bool really_register_bound_param(PDOBoundParam *param, static inline void fetch_value(sp_PDOStatement stmt, Variant &dest, int colno, int *type_override) { - PDOColumn *col = stmt->columns[colno].toObject().getTyped(); + PDOColumn *col = stmt->columns[colno].toResource().getTyped(); int type = PDO_PARAM_TYPE(col->param_type); int new_type = type_override ? PDO_PARAM_TYPE(*type_override) : type; @@ -1700,7 +1700,7 @@ static bool do_fetch_common(sp_PDOStatement stmt, PDOFetchOrientation ori, /* update those bound column variables now */ for (ArrayIter iter(stmt->bound_columns); iter; ++iter) { PDOBoundParam *param = - iter.second().toObject().getTyped(); + iter.second().toResource().getTyped(); if (param->paramno >= 0) { param->parameter.reset(); /* set new value */ @@ -1888,7 +1888,7 @@ static bool do_fetch(sp_PDOStatement stmt, bool do_bind, Variant &ret, } for (int idx = 0; i < stmt->column_count; i++, idx++) { - String name = stmt->columns[i].toObject().getTyped()->name; + String name = stmt->columns[i].toResource().getTyped()->name; Variant val; fetch_value(stmt, val, i, NULL); @@ -2005,7 +2005,7 @@ static bool do_fetch(sp_PDOStatement stmt, bool do_bind, Variant &ret, static int register_bound_param(CVarRef paramno, VRefParam param, int64_t type, int64_t max_value_len, CVarRef driver_params, sp_PDOStatement stmt, bool is_param) { - SmartObject p(new PDOBoundParam); + SmartResource p(new PDOBoundParam); // need to make sure this is NULL, in case a fatal errors occurs before its set // inside really_register_bound_param p->stmt = NULL; @@ -2455,11 +2455,11 @@ safe: "parameter was not defined"); goto clean_up; } - param = vparam.toObject().getTyped(); + param = vparam.toResource().getTyped(); if (stmt->dbh->support(PDOConnection::MethodQuoter)) { if (param->param_type == PDO_PARAM_LOB && param->parameter.isResource()) { - Variant buf = f_stream_get_contents(param->parameter.toObject()); + Variant buf = f_stream_get_contents(param->parameter.toResource()); if (!same(buf, false)) { if (!stmt->dbh->quoter(buf.toString(), plc->quoted, param->param_type)) { @@ -2623,7 +2623,7 @@ Variant c_PDOStatement::t_execute(CArrRef params /* = null_array */) { if (!params.empty()) { m_stmt->bound_params.reset(); for (ArrayIter iter(params); iter; ++iter) { - SmartObject param(new PDOBoundParam); + SmartResource param(new PDOBoundParam); param->param_type = PDO_PARAM_STR; param->parameter = iter.second(); param->stmt = NULL; @@ -3010,7 +3010,7 @@ Variant c_PDOStatement::t_getcolumnmeta(int64_t column) { } /* add stock items */ - PDOColumn *col = m_stmt->columns[column].toObject().getTyped(); + PDOColumn *col = m_stmt->columns[column].toResource().getTyped(); ret.set(s_name, col->name); ret.set(s_len, (int64_t)col->maxlen); /* FIXME: unsigned ? */ ret.set(s_precision, (int64_t)col->precision); @@ -3077,7 +3077,7 @@ Variant c_PDOStatement::t_debugdumpparams() { if (same(fobj, false)) { return false; } - File *f = fobj.toObject().getTyped(); + File *f = fobj.toResource().getTyped(); Array params; params.append(m_stmt->query_string.size()); @@ -3096,7 +3096,7 @@ Variant c_PDOStatement::t_debugdumpparams() { CREATE_VECTOR1(iter.first().toInt64())); } - PDOBoundParam *param = iter.second().toObject().getTyped(); + PDOBoundParam *param = iter.second().toResource().getTyped(); params.clear(); params.append(param->paramno); params.append(param->name.size()); diff --git a/hphp/runtime/ext/ext_posix.cpp b/hphp/runtime/ext/ext_posix.cpp index ca294e6d3..84dacebb4 100644 --- a/hphp/runtime/ext/ext_posix.cpp +++ b/hphp/runtime/ext/ext_posix.cpp @@ -295,7 +295,7 @@ bool f_posix_initgroups(CStrRef name, int base_group_id) { static int php_posix_get_fd(CVarRef fd) { int nfd; if (fd.isResource()) { - File *f = fd.toObject().getTyped(); + File *f = fd.toResource().getTyped(); if (!f) { return false; } diff --git a/hphp/runtime/ext/ext_process.cpp b/hphp/runtime/ext/ext_process.cpp index 8b0466824..1dbbf8576 100644 --- a/hphp/runtime/ext/ext_process.cpp +++ b/hphp/runtime/ext/ext_process.cpp @@ -527,7 +527,7 @@ public: // explicitly pclose()'ed, it seems that Zend is implicitly closing the // pipes when proc_close() is called. for (ArrayIter iter(pipes); iter; ++iter) { - iter.second().toObject().getTyped()->close(); + iter.second().toResource().getTyped()->close(); } pipes.clear(); @@ -641,17 +641,17 @@ public: /* clean up all the child ends and then open streams on the parent * ends, where appropriate */ - Object dupParent() { + Resource dupParent() { close(childend); childend = -1; if ((mode & ~DESC_PARENT_MODE_WRITE) == DESC_PIPE) { /* mark the descriptor close-on-exec, so that it won't be inherited by potential other children */ fcntl(parentend, F_SETFD, FD_CLOEXEC); - return Object(NEWOBJ(PlainFile)(parentend, true)); + return Resource(NEWOBJ(PlainFile)(parentend, true)); } - return Object(); + return Resource(); } }; @@ -678,7 +678,7 @@ static bool pre_proc_open(CArrRef descriptorspec, Variant descitem = iter.second(); if (descitem.isResource()) { - File *file = descitem.toObject().getTyped(); + File *file = descitem.toResource().getTyped(); if (!item.readFile(file)) break; } else if (!descitem.is(KindOfArray)) { raise_warning("Descriptor must be either an array or a File-Handle"); @@ -740,13 +740,13 @@ static Variant post_proc_open(CStrRef cmd, Variant &pipes, proc->child = child; proc->env = env; for (int i = 0; i < (int)items.size(); i++) { - Object f = items[i].dupParent(); + Resource f = items[i].dupParent(); if (!f.isNull()) { proc->pipes.append(f); } pipes.set(items[i].index, f); } - return Object(proc); + return Resource(proc); } Variant f_proc_open(CStrRef cmd, CArrRef descriptorspec, VRefParam pipes, @@ -858,12 +858,12 @@ Variant f_proc_open(CStrRef cmd, CArrRef descriptorspec, VRefParam pipes, _exit(127); } -bool f_proc_terminate(CObjRef process, int signal /* = 0 */) { +bool f_proc_terminate(CResRef process, int signal /* = 0 */) { ChildProcess *proc = process.getTyped(); return kill(proc->child, signal <= 0 ? SIGTERM : signal) == 0; } -int64_t f_proc_close(CObjRef process) { +int64_t f_proc_close(CResRef process) { return process.getTyped()->close(); } @@ -876,7 +876,7 @@ static const StaticString s_exitcode("exitcode"); static const StaticString s_termsig("termsig"); static const StaticString s_stopsig("stopsig"); -Array f_proc_get_status(CObjRef process) { +Array f_proc_get_status(CResRef process) { ChildProcess *proc = process.getTyped(); errno = 0; diff --git a/hphp/runtime/ext/ext_process.h b/hphp/runtime/ext/ext_process.h index 5bc5d8caf..2ff56b0c3 100644 --- a/hphp/runtime/ext/ext_process.h +++ b/hphp/runtime/ext/ext_process.h @@ -63,9 +63,9 @@ String f_system(CStrRef command, VRefParam return_var = uninit_null()); Variant f_proc_open(CStrRef cmd, CArrRef descriptorspec, VRefParam pipes, CStrRef cwd = null_string, CVarRef env = null_variant, CVarRef other_options = null_variant); -bool f_proc_terminate(CObjRef process, int signal = 0); -int64_t f_proc_close(CObjRef process); -Array f_proc_get_status(CObjRef process); +bool f_proc_terminate(CResRef process, int signal = 0); +int64_t f_proc_close(CResRef process); +Array f_proc_get_status(CResRef process); bool f_proc_nice(int increment); /////////////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/ext/ext_server.cpp b/hphp/runtime/ext/ext_server.cpp index 5a70663ee..992e6b2d7 100644 --- a/hphp/runtime/ext/ext_server.cpp +++ b/hphp/runtime/ext/ext_server.cpp @@ -113,10 +113,10 @@ bool f_pagelet_server_is_enabled() { static const StaticString s_Host("Host"); -Object f_pagelet_server_task_start(CStrRef url, - CArrRef headers /* = null_array */, - CStrRef post_data /* = null_string */, - CArrRef files /* = null_array */) { +Resource f_pagelet_server_task_start(CStrRef url, + CArrRef headers /* = null_array */, + CStrRef post_data /* = null_string */, + CArrRef files /* = null_array */) { String remote_host; Transport *transport = g_context->getTransport(); if (transport) { @@ -130,11 +130,11 @@ Object f_pagelet_server_task_start(CStrRef url, return PageletServer::TaskStart(url, headers, remote_host, post_data); } -int64_t f_pagelet_server_task_status(CObjRef task) { +int64_t f_pagelet_server_task_status(CResRef task) { return PageletServer::TaskStatus(task); } -String f_pagelet_server_task_result(CObjRef task, VRefParam headers, +String f_pagelet_server_task_result(CResRef task, VRefParam headers, VRefParam code, int64_t timeout_ms /* = 0 */) { Array rheaders; int rcode; @@ -172,15 +172,15 @@ bool f_xbox_post_message(CStrRef msg, CStrRef host /* = "localhost" */) { return XboxServer::PostMessage(msg, host); } -Object f_xbox_task_start(CStrRef message) { +Resource f_xbox_task_start(CStrRef message) { return XboxServer::TaskStart(message); } -bool f_xbox_task_status(CObjRef task) { +bool f_xbox_task_status(CResRef task) { return XboxServer::TaskStatus(task); } -int64_t f_xbox_task_result(CObjRef task, int64_t timeout_ms, VRefParam ret) { +int64_t f_xbox_task_result(CResRef task, int64_t timeout_ms, VRefParam ret) { return XboxServer::TaskResult(task, timeout_ms, ret); } diff --git a/hphp/runtime/ext/ext_server.h b/hphp/runtime/ext/ext_server.h index 2c599bc81..64afca121 100644 --- a/hphp/runtime/ext/ext_server.h +++ b/hphp/runtime/ext/ext_server.h @@ -40,15 +40,15 @@ enum PageletStatusType { bool f_dangling_server_proxy_old_request(); bool f_dangling_server_proxy_new_request(CStrRef host); bool f_pagelet_server_is_enabled(); -Object f_pagelet_server_task_start(CStrRef url, CArrRef headers = null_array, CStrRef post_data = null_string, CArrRef files = null_array); -int64_t f_pagelet_server_task_status(CObjRef task); -String f_pagelet_server_task_result(CObjRef task, VRefParam headers, VRefParam code, int64_t timeout_ms); +Resource f_pagelet_server_task_start(CStrRef url, CArrRef headers = null_array, CStrRef post_data = null_string, CArrRef files = null_array); +int64_t f_pagelet_server_task_status(CResRef task); +String f_pagelet_server_task_result(CResRef task, VRefParam headers, VRefParam code, int64_t timeout_ms); void f_pagelet_server_flush(); bool f_xbox_send_message(CStrRef msg, VRefParam ret, int64_t timeout_ms, CStrRef host = "localhost"); bool f_xbox_post_message(CStrRef msg, CStrRef host = "localhost"); -Object f_xbox_task_start(CStrRef message); -bool f_xbox_task_status(CObjRef task); -int64_t f_xbox_task_result(CObjRef task, int64_t timeout_ms, VRefParam ret); +Resource f_xbox_task_start(CStrRef message); +bool f_xbox_task_status(CResRef task); +int64_t f_xbox_task_result(CResRef task, int64_t timeout_ms, VRefParam ret); Variant f_xbox_process_call_message(CStrRef msg); int64_t f_xbox_get_thread_timeout(); void f_xbox_set_thread_timeout(int timeout); diff --git a/hphp/runtime/ext/ext_session.cpp b/hphp/runtime/ext/ext_session.cpp index 11ad53371..d8850b7fb 100644 --- a/hphp/runtime/ext/ext_session.cpp +++ b/hphp/runtime/ext/ext_session.cpp @@ -260,7 +260,7 @@ String SessionModule::create_sid() { Logger::Error("Invalid session hash function: %s", PS(hash_func).c_str()); return String(); } - if (!f_hash_update(context.toObject(), buf.detach())) { + if (!f_hash_update(context.toResource(), buf.detach())) { Logger::Error("hash_update() failed"); return String(); } @@ -275,7 +275,7 @@ String SessionModule::create_sid() { n = ::read(fd, rbuf, (to_read < (int)sizeof(rbuf) ? to_read : (int)sizeof(buf))); if (n <= 0) break; - if (!f_hash_update(context.toObject(), + if (!f_hash_update(context.toResource(), String((const char *)rbuf, n, AttachLiteral))) { Logger::Error("hash_update() failed"); ::close(fd); @@ -287,7 +287,7 @@ String SessionModule::create_sid() { } } - String hashed = f_hash_final(context.toObject()); + String hashed = f_hash_final(context.toResource()); if (PS(hash_bits_per_character) < 4 || PS(hash_bits_per_character) > 6) { PS(hash_bits_per_character) = 4; diff --git a/hphp/runtime/ext/ext_simplexml.cpp b/hphp/runtime/ext/ext_simplexml.cpp index 69a93250f..07a864dc6 100644 --- a/hphp/runtime/ext/ext_simplexml.cpp +++ b/hphp/runtime/ext/ext_simplexml.cpp @@ -129,7 +129,7 @@ static void add_property(Array &properties, xmlNodePtr node, Object value) { } } -static Object create_text(CObjRef doc, xmlNodePtr node, +static Object create_text(CResRef doc, xmlNodePtr node, CStrRef value, CStrRef ns, bool is_prefix, bool free_text) { Object obj = create_object(doc.getTyped()-> @@ -144,10 +144,10 @@ static Object create_text(CObjRef doc, xmlNodePtr node, return obj; } -static Array create_children(CObjRef doc, xmlNodePtr root, +static Array create_children(CResRef doc, xmlNodePtr root, CStrRef ns, bool is_prefix); -static Object create_element(CObjRef doc, xmlNodePtr node, +static Object create_element(CResRef doc, xmlNodePtr node, CStrRef ns, bool is_prefix) { Object obj = create_object(doc.getTyped()-> getClass(), Array(), false); @@ -161,7 +161,7 @@ static Object create_element(CObjRef doc, xmlNodePtr node, return obj; } -static Array create_children(CObjRef doc, xmlNodePtr root, +static Array create_children(CResRef doc, xmlNodePtr root, CStrRef ns, bool is_prefix) { Array properties = Array::Create(); for (xmlNodePtr node = root->children; node; node = node->next) { @@ -260,7 +260,8 @@ Variant f_simplexml_import_dom(CObjRef node, } if (nodep && nodep->type == XML_ELEMENT_NODE) { - Object obj = Object(NEWOBJ(XmlDocWrapper)(nodep->doc, class_name, node)); + Resource obj = + Resource(NEWOBJ(XmlDocWrapper)(nodep->doc, class_name, node)); return create_element(obj, nodep, String(), false); } else { raise_warning("Invalid Nodetype to import"); @@ -297,7 +298,7 @@ Variant f_simplexml_load_string(CStrRef data, return false; } - return create_element(Object(NEWOBJ(XmlDocWrapper)(doc, cls->nameRef())), + return create_element(Resource(NEWOBJ(XmlDocWrapper)(doc, cls->nameRef())), root, ns, is_prefix); } @@ -351,7 +352,7 @@ void c_SimpleXMLElement::t___construct(CStrRef data, int64_t options /* = 0 */, xmlDocPtr doc = xmlReadMemory(xml.data(), xml.size(), NULL, NULL, options); if (doc) { m_doc = - Object(NEWOBJ(XmlDocWrapper)(doc, c_SimpleXMLElement::s_class_name)); + Resource(NEWOBJ(XmlDocWrapper)(doc, c_SimpleXMLElement::s_class_name)); m_node = xmlDocGetRootElement(doc); if (m_node) { m_children = create_children(m_doc, m_node, ns, is_prefix); @@ -1274,7 +1275,7 @@ bool f_libxml_use_internal_errors(CVarRef use_errors /* = null_variant */) { return ret; } -void f_libxml_set_streams_context(CObjRef streams_context) { +void f_libxml_set_streams_context(CResRef streams_context) { throw NotImplementedException(__func__); } diff --git a/hphp/runtime/ext/ext_simplexml.h b/hphp/runtime/ext/ext_simplexml.h index ea250ce49..c22abd01d 100644 --- a/hphp/runtime/ext/ext_simplexml.h +++ b/hphp/runtime/ext/ext_simplexml.h @@ -33,7 +33,7 @@ Variant f_libxml_get_errors(); Variant f_libxml_get_last_error(); void f_libxml_clear_errors(); bool f_libxml_use_internal_errors(CVarRef use_errors = null_variant); -void f_libxml_set_streams_context(CObjRef streams_context); +void f_libxml_set_streams_context(CResRef streams_context); bool f_libxml_disable_entity_loader(bool disable = true); /////////////////////////////////////////////////////////////////////////////// @@ -78,7 +78,7 @@ class c_SimpleXMLElement : public: - Object m_doc; + Resource m_doc; xmlNodePtr m_node; Variant m_children; Variant m_attributes; diff --git a/hphp/runtime/ext/ext_soap.cpp b/hphp/runtime/ext/ext_soap.cpp index 78e67c124..25e492f17 100644 --- a/hphp/runtime/ext/ext_soap.cpp +++ b/hphp/runtime/ext/ext_soap.cpp @@ -996,7 +996,7 @@ static sdlFunctionPtr deserialize_function_call } } h = NEWOBJ(soapHeader)(); - Object hobj(h); + Resource hobj(h); h->function = find_function(sdl, hdr_func, h->function_name).get(); h->mustUnderstand = mustUnderstand; h->hdr = NULL; @@ -1199,7 +1199,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, encodePtr hdr_enc; int hdr_use = SOAP_LITERAL; Variant hdr_ret = obj->o_get("headerfault"); - soapHeader *h = headers[0].toObject().getTyped(); + soapHeader *h = headers[0].toResource().getTyped(); const char *hdr_ns = h->hdr ? h->hdr->ns.c_str() : NULL; const char *hdr_name = h->function_name.data(); @@ -1403,7 +1403,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, if (!headers.empty()) { head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL); for (ArrayIter iter(headers); iter; ++iter) { - soapHeader *h = iter.second().toObject().getTyped(); + soapHeader *h = iter.second().toResource().getTyped(); if (!h->retval.isNull()) { encodePtr hdr_enc; int hdr_use = SOAP_LITERAL; @@ -1768,7 +1768,7 @@ static void send_soap_server_fault(sdlFunctionPtr function, Variant fault, output_xml_header(SOAP_GLOBAL(soap_version)); Array headers; - if (hdr) headers.append(Object(hdr)); + if (hdr) headers.append(Resource(hdr)); xmlDocPtr doc_return = serialize_response_call (function, NULL, NULL, fault, headers, SOAP_GLOBAL(soap_version)); @@ -2162,7 +2162,7 @@ void c_SoapServer::t_handle(CStrRef request /* = null_string */) { // 4. process soap headers for (ArrayIter iter(m_soap_headers); iter; ++iter) { - soapHeader *h = iter.second().toObject().getTyped(); + soapHeader *h = iter.second().toResource().getTyped(); if (m_sdl && !h->function && !h->hdr) { if (h->mustUnderstand) { throw_soap_server_fault("MustUnderstand","Header not understood"); @@ -2287,7 +2287,7 @@ void c_SoapServer::t_fault(CVarRef code, CStrRef fault, void c_SoapServer::t_addsoapheader(CObjRef fault) { SoapServerScope ss(this); soapHeader *p = NEWOBJ(soapHeader)(); - Object obj(p); + Resource obj(p); p->function = NULL; p->mustUnderstand = false; p->retval = fault; @@ -2351,8 +2351,8 @@ void c_SoapClient::t___construct(CVarRef wsdl, if (options.exists(s_stream_context)) { StreamContext *sc = NULL; - if (options[s_stream_context].isObject()) { - sc = options[s_stream_context].toObject() + if (options[s_stream_context].isResource()) { + sc = options[s_stream_context].toResource() .getTyped(); } if (!sc) { diff --git a/hphp/runtime/ext/ext_socket.cpp b/hphp/runtime/ext/ext_socket.cpp index 0bfd99bd4..2722b0e13 100644 --- a/hphp/runtime/ext/ext_socket.cpp +++ b/hphp/runtime/ext/ext_socket.cpp @@ -203,7 +203,7 @@ static void sock_array_to_fd_set(CArrRef sockets, pollfd *fds, int &nfds, short flag) { assert(fds); for (ArrayIter iter(sockets); iter; ++iter) { - File *sock = iter.second().toObject().getTyped(); + File *sock = iter.second().toResource().getTyped(); pollfd &fd = fds[nfds++]; fd.fd = sock->fd(); fd.events = flag; @@ -218,7 +218,7 @@ static void sock_array_from_fd_set(Variant &sockets, pollfd *fds, int &nfds, Array ret; for (ArrayIter iter(sock_array); iter; ++iter) { pollfd &fd = fds[nfds++]; - assert(fd.fd == iter.second().toObject().getTyped()->fd()); + assert(fd.fd == iter.second().toResource().getTyped()->fd()); if (fd.revents & flag) { ret.append(iter.second()); count++; @@ -281,7 +281,7 @@ static int php_read(Socket *sock, void *buf, int maxlen, int flags) { } static bool create_new_socket(const char *&name, int port, Variant &errnum, - Variant &errstr, Object &ret, Socket *&sock, + Variant &errstr, Resource &ret, Socket *&sock, double timeout) { int domain = AF_INET; int type = SOCK_STREAM; @@ -296,7 +296,7 @@ static bool create_new_socket(const char *&name, int port, Variant &errnum, } sock = new Socket(socket(domain, type, 0), domain, name, port, timeout); - ret = Object(sock); + ret = Resource(sock); if (!sock->valid()) { SOCKET_ERROR(sock, "unable to create socket", errno); errnum = sock->getError(); @@ -317,7 +317,7 @@ Variant f_socket_create(int domain, int type, int protocol) { return false; } Socket *sock = new Socket(socketId, domain); - Object ret(sock); + Resource ret(sock); return ret; } @@ -335,7 +335,7 @@ Variant f_socket_create_listen(int port, int backlog /* = 128 */) { Socket *sock = new Socket(socket(PF_INET, SOCK_STREAM, 0), PF_INET, "0.0.0.0", port); - Object ret(sock); + Resource ret(sock); if (!sock->valid()) { SOCKET_ERROR(sock, "unable to create listening socket", errno); return false; @@ -365,8 +365,8 @@ bool f_socket_create_pair(int domain, int type, int protocol, VRefParam fd) { } Array ret; - ret.set(0, Object(new Socket(fds_array[0], domain))); - ret.set(1, Object(new Socket(fds_array[1], domain))); + ret.set(0, Resource(new Socket(fds_array[0], domain))); + ret.set(1, Resource(new Socket(fds_array[1], domain))); fd = ret; return true; } @@ -376,7 +376,7 @@ static const StaticString s_l_linger("l_linger"); static const StaticString s_sec("sec"); static const StaticString s_usec("usec"); -Variant f_socket_get_option(CObjRef socket, int level, int optname) { +Variant f_socket_get_option(CResRef socket, int level, int optname) { Socket *sock = socket.getTyped(); Array ret; socklen_t optlen; @@ -425,7 +425,7 @@ Variant f_socket_get_option(CObjRef socket, int level, int optname) { return ret; } -bool f_socket_getpeername(CObjRef socket, VRefParam address, +bool f_socket_getpeername(CResRef socket, VRefParam address, VRefParam port /* = null */) { Socket *sock = socket.getTyped(); @@ -439,7 +439,7 @@ bool f_socket_getpeername(CObjRef socket, VRefParam address, return get_sockaddr(sa, address, port); } -bool f_socket_getsockname(CObjRef socket, VRefParam address, +bool f_socket_getsockname(CResRef socket, VRefParam address, VRefParam port /* = null */) { Socket *sock = socket.getTyped(); @@ -453,17 +453,17 @@ bool f_socket_getsockname(CObjRef socket, VRefParam address, return get_sockaddr(sa, address, port); } -bool f_socket_set_block(CObjRef socket) { +bool f_socket_set_block(CResRef socket) { Socket *sock = socket.getTyped(); return sock->setBlocking(true); } -bool f_socket_set_nonblock(CObjRef socket) { +bool f_socket_set_nonblock(CResRef socket) { Socket *sock = socket.getTyped(); return sock->setBlocking(false); } -bool f_socket_set_option(CObjRef socket, int level, int optname, +bool f_socket_set_option(CResRef socket, int level, int optname, CVarRef optval) { Socket *sock = socket.getTyped(); @@ -532,7 +532,7 @@ bool f_socket_set_option(CObjRef socket, int level, int optname, return true; } -bool f_socket_connect(CObjRef socket, CStrRef address, int port /* = 0 */) { +bool f_socket_connect(CResRef socket, CStrRef address, int port /* = 0 */) { Socket *sock = socket.getTyped(); switch (sock->getType()) { @@ -569,7 +569,7 @@ bool f_socket_connect(CObjRef socket, CStrRef address, int port /* = 0 */) { return true; } -bool f_socket_bind(CObjRef socket, CStrRef address, int port /* = 0 */) { +bool f_socket_bind(CResRef socket, CStrRef address, int port /* = 0 */) { Socket *sock = socket.getTyped(); const char *addr = address.data(); @@ -593,7 +593,7 @@ bool f_socket_bind(CObjRef socket, CStrRef address, int port /* = 0 */) { return true; } -bool f_socket_listen(CObjRef socket, int backlog /* = 0 */) { +bool f_socket_listen(CResRef socket, int backlog /* = 0 */) { Socket *sock = socket.getTyped(); if (listen(sock->fd(), backlog) != 0) { SOCKET_ERROR(sock, "unable to listen on socket", errno); @@ -662,7 +662,7 @@ Variant f_socket_select(VRefParam read, VRefParam write, VRefParam except, Variant f_socket_server(CStrRef hostname, int port /* = -1 */, VRefParam errnum /* = null */, VRefParam errstr /* = null */) { - Object ret; + Resource ret; Socket *sock = NULL; const char *name = hostname.data(); if (!create_new_socket(name, port, errnum, errstr, ret, sock, 0.0)) { @@ -688,7 +688,7 @@ Variant f_socket_server(CStrRef hostname, int port /* = -1 */, return ret; } -Variant f_socket_accept(CObjRef socket) { +Variant f_socket_accept(CResRef socket) { Socket *sock = socket.getTyped(); struct sockaddr sa; socklen_t salen = sizeof(sa); @@ -699,10 +699,10 @@ Variant f_socket_accept(CObjRef socket) { delete new_sock; return false; } - return Object(new_sock); + return Resource(new_sock); } -Variant f_socket_read(CObjRef socket, int length, int type /* = 0 */) { +Variant f_socket_read(CResRef socket, int length, int type /* = 0 */) { if (length <= 0) { return false; } @@ -733,7 +733,7 @@ Variant f_socket_read(CObjRef socket, int length, int type /* = 0 */) { return String(tmpbuf, retval, AttachString); } -Variant f_socket_write(CObjRef socket, CStrRef buffer, int length /* = 0 */) { +Variant f_socket_write(CResRef socket, CStrRef buffer, int length /* = 0 */) { Socket *sock = socket.getTyped(); if (length == 0 || length > buffer.size()) { length = buffer.size(); @@ -746,7 +746,7 @@ Variant f_socket_write(CObjRef socket, CStrRef buffer, int length /* = 0 */) { return retval; } -Variant f_socket_send(CObjRef socket, CStrRef buf, int len, int flags) { +Variant f_socket_send(CResRef socket, CStrRef buf, int len, int flags) { Socket *sock = socket.getTyped(); if (len > buf.size()) { len = buf.size(); @@ -759,7 +759,7 @@ Variant f_socket_send(CObjRef socket, CStrRef buf, int len, int flags) { return retval; } -Variant f_socket_sendto(CObjRef socket, CStrRef buf, int len, int flags, +Variant f_socket_sendto(CResRef socket, CStrRef buf, int len, int flags, CStrRef addr, int port /* = 0 */) { Socket *sock = socket.getTyped(); if (len > buf.size()) { @@ -820,7 +820,7 @@ Variant f_socket_sendto(CObjRef socket, CStrRef buf, int len, int flags, return retval; } -Variant f_socket_recv(CObjRef socket, VRefParam buf, int len, int flags) { +Variant f_socket_recv(CResRef socket, VRefParam buf, int len, int flags) { if (len <= 0) { return false; } @@ -847,7 +847,7 @@ static const StaticString s_2colons("::"), s_0_0_0_0("0.0.0.0"); -Variant f_socket_recvfrom(CObjRef socket, VRefParam buf, int len, int flags, +Variant f_socket_recvfrom(CResRef socket, VRefParam buf, int len, int flags, VRefParam name, VRefParam port /* = 0 */) { if (len <= 0) { return false; @@ -940,7 +940,7 @@ Variant f_socket_recvfrom(CObjRef socket, VRefParam buf, int len, int flags, return retval; } -bool f_socket_shutdown(CObjRef socket, int how /* = 0 */) { +bool f_socket_shutdown(CResRef socket, int how /* = 0 */) { Socket *sock = socket.getTyped(); if (shutdown(sock->fd(), how) != 0) { SOCKET_ERROR(sock, "unable to shutdown socket", errno); @@ -949,7 +949,7 @@ bool f_socket_shutdown(CObjRef socket, int how /* = 0 */) { return true; } -void f_socket_close(CObjRef socket) { +void f_socket_close(CResRef socket) { Socket *sock = socket.getTyped(); sock->close(); } @@ -958,7 +958,7 @@ String f_socket_strerror(int errnum) { return String(Util::safe_strerror(errnum)); } -int64_t f_socket_last_error(CObjRef socket /* = null_object */) { +int64_t f_socket_last_error(CResRef socket /* = null_object */) { if (!socket.isNull()) { Socket *sock = socket.getTyped(); return sock->getError(); @@ -966,7 +966,7 @@ int64_t f_socket_last_error(CObjRef socket /* = null_object */) { return Socket::getLastError(); } -void f_socket_clear_error(CObjRef socket /* = null_object */) { +void f_socket_clear_error(CResRef socket /* = null_object */) { if (!socket.isNull()) { Socket *sock = socket.getTyped(); sock->setError(0); @@ -988,7 +988,7 @@ static Variant sockopen_impl(CStrRef hostname, int port, Variant &errnum, dynamic_cast(g_persistentObjects->get("socket", key.c_str())); if (sock) { if (sock->getError() == 0 && sock->checkLiveness()) { - return Object(sock); + return Resource(sock); } // socket had an error earlier, we need to remove it from persistent @@ -997,7 +997,7 @@ static Variant sockopen_impl(CStrRef hostname, int port, Variant &errnum, } } - Object ret; + Resource ret; const char *name = hostname.data(); Socket *sock = NULL; diff --git a/hphp/runtime/ext/ext_socket.h b/hphp/runtime/ext/ext_socket.h index b854b0694..4b40074e0 100644 --- a/hphp/runtime/ext/ext_socket.h +++ b/hphp/runtime/ext/ext_socket.h @@ -26,36 +26,36 @@ namespace HPHP { Variant f_socket_create(int domain, int type, int protocol); Variant f_socket_create_listen(int port, int backlog = 128); bool f_socket_create_pair(int domain, int type, int protocol, VRefParam fd); -Variant f_socket_get_option(CObjRef socket, int level, int optname); -bool f_socket_getpeername(CObjRef socket, VRefParam address, +Variant f_socket_get_option(CResRef socket, int level, int optname); +bool f_socket_getpeername(CResRef socket, VRefParam address, VRefParam port = uninit_null()); -bool f_socket_getsockname(CObjRef socket, VRefParam address, +bool f_socket_getsockname(CResRef socket, VRefParam address, VRefParam port = uninit_null()); -bool f_socket_set_block(CObjRef socket); -bool f_socket_set_nonblock(CObjRef socket); -bool f_socket_set_option(CObjRef socket, int level, int optname, +bool f_socket_set_block(CResRef socket); +bool f_socket_set_nonblock(CResRef socket); +bool f_socket_set_option(CResRef socket, int level, int optname, CVarRef optval); -bool f_socket_connect(CObjRef socket, CStrRef address, int port = 0); -bool f_socket_bind(CObjRef socket, CStrRef address, int port = 0); -bool f_socket_listen(CObjRef socket, int backlog = 0); +bool f_socket_connect(CResRef socket, CStrRef address, int port = 0); +bool f_socket_bind(CResRef socket, CStrRef address, int port = 0); +bool f_socket_listen(CResRef socket, int backlog = 0); Variant f_socket_select(VRefParam read, VRefParam write, VRefParam except, CVarRef vtv_sec, int tv_usec = 0); Variant f_socket_server(CStrRef hostname, int port = -1, VRefParam errnum = uninit_null(), VRefParam errstr = uninit_null()); -Variant f_socket_accept(CObjRef socket); -Variant f_socket_read(CObjRef socket, int length, int type = 0); -Variant f_socket_write(CObjRef socket, CStrRef buffer, int length = 0); -Variant f_socket_send(CObjRef socket, CStrRef buf, int len, int flags); -Variant f_socket_sendto(CObjRef socket, CStrRef buf, int len, int flags, +Variant f_socket_accept(CResRef socket); +Variant f_socket_read(CResRef socket, int length, int type = 0); +Variant f_socket_write(CResRef socket, CStrRef buffer, int length = 0); +Variant f_socket_send(CResRef socket, CStrRef buf, int len, int flags); +Variant f_socket_sendto(CResRef socket, CStrRef buf, int len, int flags, CStrRef addr, int port = 0); -Variant f_socket_recv(CObjRef socket, VRefParam buf, int len, int flags); -Variant f_socket_recvfrom(CObjRef socket, VRefParam buf, int len, int flags, +Variant f_socket_recv(CResRef socket, VRefParam buf, int len, int flags); +Variant f_socket_recvfrom(CResRef socket, VRefParam buf, int len, int flags, VRefParam name, VRefParam port = 0); -bool f_socket_shutdown(CObjRef socket, int how = 0); -void f_socket_close(CObjRef socket); +bool f_socket_shutdown(CResRef socket, int how = 0); +void f_socket_close(CResRef socket); String f_socket_strerror(int errnum); -int64_t f_socket_last_error(CObjRef socket = null_object); -void f_socket_clear_error(CObjRef socket = null_object); +int64_t f_socket_last_error(CResRef socket = null_resource); +void f_socket_clear_error(CResRef socket = null_resource); Variant f_getaddrinfo(CStrRef host, CStrRef port, int family = 0, int socktype = 0, int protocol = 0, int flags = 0); diff --git a/hphp/runtime/ext/ext_sqlite3.cpp b/hphp/runtime/ext/ext_sqlite3.cpp index 135380eac..195be0bd7 100644 --- a/hphp/runtime/ext/ext_sqlite3.cpp +++ b/hphp/runtime/ext/ext_sqlite3.cpp @@ -548,7 +548,7 @@ Variant c_SQLite3Stmt::t_execute() { { String sblob; if (p.value.isResource()) { - Variant blob = f_stream_get_contents(p.value.toObject()); + Variant blob = f_stream_get_contents(p.value.toResource()); if (same(blob, false)) { raise_warning("Unable to read stream for parameter %d", p.index); diff --git a/hphp/runtime/ext/ext_stream.cpp b/hphp/runtime/ext/ext_stream.cpp index 9d5aa9610..360771bb4 100644 --- a/hphp/runtime/ext/ext_stream.cpp +++ b/hphp/runtime/ext/ext_stream.cpp @@ -50,32 +50,32 @@ StaticString StreamContext::s_class_name("StreamContext"); /////////////////////////////////////////////////////////////////////////////// -Object f_stream_context_create(CArrRef options /* = null_array */, - CArrRef params /* = null_array */) { - return Object(NEWOBJ(StreamContext)(options, params)); +Resource f_stream_context_create(CArrRef options /* = null_array */, + CArrRef params /* = null_array */) { + return Resource(NEWOBJ(StreamContext)(options, params)); } Object f_stream_context_get_default(CArrRef options /* = null_array */) { throw NotImplementedException(__func__); } -Variant f_stream_context_get_options(CObjRef stream_or_context) { +Variant f_stream_context_get_options(CResRef stream_or_context) { throw NotImplementedException(__func__); } -bool f_stream_context_set_option(CObjRef stream_or_context, +bool f_stream_context_set_option(CResRef stream_or_context, CVarRef wrapper, CStrRef option /* = null_string */, CVarRef value /* = null_variant */) { throw NotImplementedException(__func__); } -bool f_stream_context_set_param(CObjRef stream_or_context, +bool f_stream_context_set_param(CResRef stream_or_context, CArrRef params) { throw NotImplementedException(__func__); } -Variant f_stream_copy_to_stream(CObjRef source, CObjRef dest, +Variant f_stream_copy_to_stream(CResRef source, CResRef dest, int maxlength /* = -1 */, int offset /* = 0 */) { if (maxlength == 0) return 0; @@ -113,23 +113,23 @@ Variant f_stream_copy_to_stream(CObjRef source, CObjRef dest, return cbytes; } -bool f_stream_encoding(CObjRef stream, CStrRef encoding /* = null_string */) { +bool f_stream_encoding(CResRef stream, CStrRef encoding /* = null_string */) { throw NotSupportedException(__func__, "stream filter is not supported"); } -void f_stream_bucket_append(CObjRef brigade, CObjRef bucket) { +void f_stream_bucket_append(CResRef brigade, CResRef bucket) { throw NotSupportedException(__func__, "stream bucket is not supported"); } -void f_stream_bucket_prepend(CObjRef brigade, CObjRef bucket) { +void f_stream_bucket_prepend(CResRef brigade, CResRef bucket) { throw NotSupportedException(__func__, "stream bucket is not supported"); } -Object f_stream_bucket_make_writeable(CObjRef brigade) { +Object f_stream_bucket_make_writeable(CResRef brigade) { throw NotSupportedException(__func__, "stream bucket is not supported"); } -Object f_stream_bucket_new(CObjRef stream, CStrRef buffer) { +Object f_stream_bucket_new(CResRef stream, CStrRef buffer) { throw NotSupportedException(__func__, "stream bucket is not supported"); } @@ -137,23 +137,23 @@ bool f_stream_filter_register(CStrRef filtername, CStrRef classname) { throw NotSupportedException(__func__, "stream filter is not supported"); } -bool f_stream_filter_remove(CObjRef stream_filter) { +bool f_stream_filter_remove(CResRef stream_filter) { throw NotSupportedException(__func__, "stream filter is not supported"); } -Object f_stream_filter_append(CObjRef stream, CStrRef filtername, +Object f_stream_filter_append(CResRef stream, CStrRef filtername, int read_write /* = 0 */, CVarRef params /* = null_variant */) { throw NotSupportedException(__func__, "stream filter is not supported"); } -Object f_stream_filter_prepend(CObjRef stream, CStrRef filtername, +Object f_stream_filter_prepend(CResRef stream, CStrRef filtername, int read_write /* = 0 */, CVarRef params /* = null_variant */) { throw NotSupportedException(__func__, "stream filter is not supported"); } -Variant f_stream_get_contents(CObjRef handle, int maxlen /* = 0 */, +Variant f_stream_get_contents(CResRef handle, int maxlen /* = 0 */, int offset /* = 0 */) { if (maxlen < 0) { throw_invalid_argument("maxlen: %d", maxlen); @@ -187,13 +187,13 @@ Array f_stream_get_filters() { throw NotSupportedException(__func__, "stream filter is not supported"); } -Variant f_stream_get_line(CObjRef handle, int length /* = 0 */, +Variant f_stream_get_line(CResRef handle, int length /* = 0 */, CStrRef ending /* = null_string */) { File *file = handle.getTyped(); return file->readRecord(ending, length); } -Variant f_stream_get_meta_data(CObjRef stream) { +Variant f_stream_get_meta_data(CResRef stream) { File *f = stream.getTyped(true, true); if (f) return f->getMetaData(); return false; @@ -204,7 +204,7 @@ Array f_stream_get_transports() { } String f_stream_resolve_include_path(CStrRef filename, - CObjRef context /* = null_object */) { + CResRef context /* = null_object */) { struct stat s; return Eval::resolveVmInclude(filename.get(), "", &s); } @@ -214,7 +214,7 @@ Variant f_stream_select(VRefParam read, VRefParam write, VRefParam except, return f_socket_select(ref(read), ref(write), ref(except), vtv_sec, tv_usec); } -bool f_stream_set_blocking(CObjRef stream, int mode) { +bool f_stream_set_blocking(CResRef stream, int mode) { File *file = stream.getTyped(); int flags = fcntl(file->fd(), F_GETFL, 0); if (mode) { @@ -228,7 +228,7 @@ bool f_stream_set_blocking(CObjRef stream, int mode) { static const StaticString s_sec("sec"); static const StaticString s_usec("usec"); -bool f_stream_set_timeout(CObjRef stream, int seconds, +bool f_stream_set_timeout(CResRef stream, int seconds, int microseconds /* = 0 */) { if (stream.getTyped(false, true)) { return f_socket_set_option @@ -238,7 +238,7 @@ bool f_stream_set_timeout(CObjRef stream, int seconds, return false; } -int64_t f_stream_set_write_buffer(CObjRef stream, int buffer) { +int64_t f_stream_set_write_buffer(CResRef stream, int buffer) { PlainFile *file = stream.getTyped(false, true); if (file) { switch (buffer) { @@ -255,7 +255,7 @@ int64_t f_stream_set_write_buffer(CObjRef stream, int buffer) { return -1; } -int64_t f_set_file_buffer(CObjRef stream, int buffer) { +int64_t f_set_file_buffer(CResRef stream, int buffer) { return f_stream_set_write_buffer(stream, buffer); } @@ -323,7 +323,7 @@ static void parse_socket(CStrRef socket, String &protocol, String &host, parse_host(address, host, port); } -static Socket *socket_accept_impl(CObjRef socket, struct sockaddr *addr, +static Socket *socket_accept_impl(CResRef socket, struct sockaddr *addr, socklen_t *addrlen) { Socket *sock = socket.getTyped(); Socket *new_sock = new Socket(accept(sock->fd(), addr, addrlen), @@ -389,7 +389,7 @@ static String get_sockaddr_name(struct sockaddr *sa, socklen_t sl) { return String(); } -Variant f_stream_socket_accept(CObjRef server_socket, +Variant f_stream_socket_accept(CResRef server_socket, double timeout /* = 0.0 */, VRefParam peername /* = null */) { Socket *sock = server_socket.getTyped(); @@ -406,7 +406,7 @@ Variant f_stream_socket_accept(CObjRef server_socket, socklen_t salen = sizeof(sa); Socket *new_sock = socket_accept_impl(server_socket, &sa, &salen); peername = get_sockaddr_name(&sa, salen); - if (new_sock) return Object(new_sock); + if (new_sock) return Resource(new_sock); } else if (n < 0) { sock->setError(errno); } else { @@ -419,7 +419,7 @@ Variant f_stream_socket_server(CStrRef local_socket, VRefParam errnum /* = null */, VRefParam errstr /* = null */, int flags /* = 0 */, - CObjRef context /* = null_object */) { + CResRef context /* = null_object */) { String protocol, host; int port; parse_socket(local_socket, protocol, host, port); return f_socket_server(protocol + "://" + host, port, errnum, errstr); @@ -430,19 +430,19 @@ Variant f_stream_socket_client(CStrRef remote_socket, VRefParam errstr /* = null */, double timeout /* = 0.0 */, int flags /* = 0 */, - CObjRef context /* = null_object */) { + CResRef context /* = null_object */) { String protocol, host; int port; parse_socket(remote_socket, protocol, host, port); return f_fsockopen(protocol + "://" + host, port, errnum, errstr, timeout); } -Variant f_stream_socket_enable_crypto(CObjRef stream, bool enable, +Variant f_stream_socket_enable_crypto(CResRef stream, bool enable, int crypto_type /* = 0 */, - CObjRef session_stream /* = null_object */) { + CResRef session_stream /* = null_object */) { throw NotSupportedException(__func__, "no crypto support on sockets"); } -Variant f_stream_socket_get_name(CObjRef handle, bool want_peer) { +Variant f_stream_socket_get_name(CResRef handle, bool want_peer) { Variant address, port; bool ret; if (want_peer) { @@ -464,7 +464,7 @@ Variant f_stream_socket_pair(int domain, int type, int protocol) { return fd; } -Variant f_stream_socket_recvfrom(CObjRef socket, int length, +Variant f_stream_socket_recvfrom(CResRef socket, int length, int flags /* = 0 */, CStrRef address /* = null_string */) { String host; int port; @@ -478,7 +478,7 @@ Variant f_stream_socket_recvfrom(CObjRef socket, int length, return false; } -Variant f_stream_socket_sendto(CObjRef socket, CStrRef data, +Variant f_stream_socket_sendto(CResRef socket, CStrRef data, int flags /* = 0 */, CStrRef address /* = null_string */) { String host; int port; @@ -494,7 +494,7 @@ Variant f_stream_socket_sendto(CObjRef socket, CStrRef data, return f_socket_sendto(socket, data, data.size(), flags, host, port); } -bool f_stream_socket_shutdown(CObjRef stream, int how) { +bool f_stream_socket_shutdown(CResRef stream, int how) { return f_socket_shutdown(stream, how); } diff --git a/hphp/runtime/ext/ext_stream.h b/hphp/runtime/ext/ext_stream.h index cbe9c01a4..5cc186303 100644 --- a/hphp/runtime/ext/ext_stream.h +++ b/hphp/runtime/ext/ext_stream.h @@ -40,57 +40,57 @@ public: Array m_params; }; -Object f_stream_context_create(CArrRef options = null_array, - CArrRef params = null_array); +Resource f_stream_context_create(CArrRef options = null_array, + CArrRef params = null_array); Object f_stream_context_get_default(CArrRef options = null_array); -Variant f_stream_context_get_options(CObjRef stream_or_context); +Variant f_stream_context_get_options(CResRef stream_or_context); -bool f_stream_context_set_option(CObjRef stream_or_context, +bool f_stream_context_set_option(CResRef stream_or_context, CVarRef wrapper, CStrRef option = null_string, CVarRef value = null_variant); -bool f_stream_context_set_param(CObjRef stream_or_context, +bool f_stream_context_set_param(CResRef stream_or_context, CArrRef params); /////////////////////////////////////////////////////////////////////////////// -Variant f_stream_copy_to_stream(CObjRef source, CObjRef dest, +Variant f_stream_copy_to_stream(CResRef source, CResRef dest, int maxlength = -1, int offset = 0); -bool f_stream_encoding(CObjRef stream, CStrRef encoding = null_string); +bool f_stream_encoding(CResRef stream, CStrRef encoding = null_string); -void f_stream_bucket_append(CObjRef brigade, CObjRef bucket); +void f_stream_bucket_append(CResRef brigade, CResRef bucket); -void f_stream_bucket_prepend(CObjRef brigade, CObjRef bucket); +void f_stream_bucket_prepend(CResRef brigade, CResRef bucket); -Object f_stream_bucket_make_writeable(CObjRef brigade); +Object f_stream_bucket_make_writeable(CResRef brigade); -Object f_stream_bucket_new(CObjRef stream, CStrRef buffer); +Object f_stream_bucket_new(CResRef stream, CStrRef buffer); bool f_stream_filter_register(CStrRef filtername, CStrRef classname); -bool f_stream_filter_remove(CObjRef stream_filter); +bool f_stream_filter_remove(CResRef stream_filter); -Object f_stream_filter_append(CObjRef stream, CStrRef filtername, +Object f_stream_filter_append(CResRef stream, CStrRef filtername, int read_write = 0, CVarRef params = null_variant); -Object f_stream_filter_prepend(CObjRef stream, CStrRef filtername, +Object f_stream_filter_prepend(CResRef stream, CStrRef filtername, int read_write = 0, CVarRef params = null_variant); -Variant f_stream_get_contents(CObjRef handle, int maxlen = 0, +Variant f_stream_get_contents(CResRef handle, int maxlen = 0, int offset = 0); Array f_stream_get_filters(); -Variant f_stream_get_line(CObjRef handle, int length = 0, +Variant f_stream_get_line(CResRef handle, int length = 0, CStrRef ending = null_string); -Variant f_stream_get_meta_data(CObjRef stream); +Variant f_stream_get_meta_data(CResRef stream); Array f_stream_get_transports(); @@ -101,48 +101,48 @@ bool f_stream_wrapper_restore(CStrRef protocol); bool f_stream_wrapper_unregister(CStrRef protocol); String f_stream_resolve_include_path(CStrRef filename, - CObjRef context = null_object); + CResRef context = null_resource); Variant f_stream_select(VRefParam read, VRefParam write, VRefParam except, CVarRef vtv_sec, int tv_usec = 0); -bool f_stream_set_blocking(CObjRef stream, int mode); +bool f_stream_set_blocking(CResRef stream, int mode); -bool f_stream_set_timeout(CObjRef stream, int seconds, int microseconds = 0); +bool f_stream_set_timeout(CResRef stream, int seconds, int microseconds = 0); -int64_t f_stream_set_write_buffer(CObjRef stream, int buffer); +int64_t f_stream_set_write_buffer(CResRef stream, int buffer); -int64_t f_set_file_buffer(CObjRef stream, int buffer); +int64_t f_set_file_buffer(CResRef stream, int buffer); /////////////////////////////////////////////////////////////////////////////// // stream sockets: ext_socket has better implementation of socket functions -Variant f_stream_socket_accept(CObjRef server_socket, double timeout = 0.0, - VRefParam peername = uninit_null()); +Variant f_stream_socket_accept(CResRef server_socket, double timeout = 0.0, + VRefParam peername = uninit_null()); Variant f_stream_socket_server(CStrRef local_socket, VRefParam errnum = uninit_null(), VRefParam errstr = uninit_null(), - int flags = 0, CObjRef context = null_object); + int flags = 0, CResRef context = null_resource); Variant f_stream_socket_client(CStrRef remote_socket, VRefParam errnum = uninit_null(), VRefParam errstr = uninit_null(), double timeout = 0.0, - int flags = 0, CObjRef context = null_object); + int flags = 0, CResRef context = null_resource); -Variant f_stream_socket_enable_crypto(CObjRef stream, bool enable, +Variant f_stream_socket_enable_crypto(CResRef stream, bool enable, int crypto_type = 0, - CObjRef session_stream = null_object); + CResRef session_stream = null_resource); -Variant f_stream_socket_get_name(CObjRef handle, bool want_peer); +Variant f_stream_socket_get_name(CResRef handle, bool want_peer); Variant f_stream_socket_pair(int domain, int type, int protocol); -Variant f_stream_socket_recvfrom(CObjRef socket, int length, int flags = 0, +Variant f_stream_socket_recvfrom(CResRef socket, int length, int flags = 0, CStrRef address = null_string); -Variant f_stream_socket_sendto(CObjRef socket, CStrRef data, int flags = 0, +Variant f_stream_socket_sendto(CResRef socket, CStrRef data, int flags = 0, CStrRef address = null_string); -bool f_stream_socket_shutdown(CObjRef stream, int how); +bool f_stream_socket_shutdown(CResRef stream, int how); /////////////////////////////////////////////////////////////////////////////// } diff --git a/hphp/runtime/ext/ext_url.cpp b/hphp/runtime/ext/ext_url.cpp index f102239b1..cc70d4ffd 100644 --- a/hphp/runtime/ext/ext_url.cpp +++ b/hphp/runtime/ext/ext_url.cpp @@ -46,10 +46,10 @@ String f_base64_encode(CStrRef data) { Variant f_get_headers(CStrRef url, int format /* = 0 */) { Variant c = f_curl_init(); - f_curl_setopt(c.toObject(), k_CURLOPT_URL, url); - f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_setopt(c.toObject(), k_CURLOPT_HEADER, 1); - Variant res = f_curl_exec(c.toObject()); + f_curl_setopt(c.toResource(), k_CURLOPT_URL, url); + f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_setopt(c.toResource(), k_CURLOPT_HEADER, 1); + Variant res = f_curl_exec(c.toResource()); if (same(res, false)) { return false; } diff --git a/hphp/runtime/ext/ext_variable.cpp b/hphp/runtime/ext/ext_variable.cpp index d78cdea85..222767e9b 100644 --- a/hphp/runtime/ext/ext_variable.cpp +++ b/hphp/runtime/ext/ext_variable.cpp @@ -28,7 +28,7 @@ String f_gettype(CVarRef v) { return getDataTypeString(v.getType()); } -String f_get_resource_type(CObjRef handle) { +String f_get_resource_type(CResRef handle) { if (handle.isResource()) { return handle->o_getClassName(); } diff --git a/hphp/runtime/ext/ext_variable.h b/hphp/runtime/ext/ext_variable.h index 98661f111..b1e106334 100644 --- a/hphp/runtime/ext/ext_variable.h +++ b/hphp/runtime/ext/ext_variable.h @@ -40,7 +40,7 @@ bool f_is_resource(CVarRef v); bool f_is_null(CVarRef v); String f_gettype(CVarRef v); -String f_get_resource_type(CObjRef handle); +String f_get_resource_type(CResRef handle); /////////////////////////////////////////////////////////////////////////////// // type conversion diff --git a/hphp/runtime/ext/ext_xml.cpp b/hphp/runtime/ext/ext_xml.cpp index 0238180c0..5ad4670e8 100644 --- a/hphp/runtime/ext/ext_xml.cpp +++ b/hphp/runtime/ext/ext_xml.cpp @@ -320,7 +320,7 @@ static Variant php_xml_parser_create_impl(CStrRef encoding_param, XML_SetUserData(parser->parser, parser); - return Object(parser); + return Resource(parser); } static String _xml_string_zval(const char *str) { @@ -689,7 +689,7 @@ Object f_xml_parser_create_ns(CStrRef encoding /* = null_string */, return php_xml_parser_create_impl(encoding, separator, 1).toObject(); } -bool f_xml_parser_free(CObjRef parser) { +bool f_xml_parser_free(CResRef parser) { XmlParser * p = parser.getTyped(); if (p->isparsing == 1) { raise_warning("Parser cannot be freed while it is parsing."); @@ -698,7 +698,7 @@ bool f_xml_parser_free(CObjRef parser) { return true; } -int64_t f_xml_parse(CObjRef parser, CStrRef data, bool is_final /* = true */) { +int64_t f_xml_parse(CResRef parser, CStrRef data, bool is_final /* = true */) { // XML_Parse can reenter the VM, and it will do so after we've lost // the frame pointer by calling through the system's copy of XML_Parse // in libexpat.so. @@ -713,7 +713,7 @@ int64_t f_xml_parse(CObjRef parser, CStrRef data, bool is_final /* = true */) { return ret; } -int64_t f_xml_parse_into_struct(CObjRef parser, CStrRef data, VRefParam values, +int64_t f_xml_parse_into_struct(CResRef parser, CStrRef data, VRefParam values, VRefParam index /* = null */) { int ret; XmlParser * p = parser.getTyped(); @@ -736,7 +736,7 @@ int64_t f_xml_parse_into_struct(CObjRef parser, CStrRef data, VRefParam values, return ret; } -Variant f_xml_parser_get_option(CObjRef parser, int option) { +Variant f_xml_parser_get_option(CResRef parser, int option) { XmlParser * p = parser.getTyped(); switch (option) { case PHP_XML_OPTION_CASE_FOLDING: @@ -750,7 +750,7 @@ Variant f_xml_parser_get_option(CObjRef parser, int option) { return false; } -bool f_xml_parser_set_option(CObjRef parser, int option, CVarRef value) { +bool f_xml_parser_set_option(CResRef parser, int option, CVarRef value) { XmlParser * p = parser.getTyped(); switch (option) { case PHP_XML_OPTION_CASE_FOLDING: @@ -780,21 +780,21 @@ bool f_xml_parser_set_option(CObjRef parser, int option, CVarRef value) { return true; } -bool f_xml_set_character_data_handler(CObjRef parser, CVarRef handler) { +bool f_xml_set_character_data_handler(CResRef parser, CVarRef handler) { XmlParser * p = parser.getTyped(); xml_set_handler(&p->characterDataHandler, handler); XML_SetCharacterDataHandler(p->parser, _xml_characterDataHandler); return true; } -bool f_xml_set_default_handler(CObjRef parser, CVarRef handler) { +bool f_xml_set_default_handler(CResRef parser, CVarRef handler) { XmlParser * p = parser.getTyped(); xml_set_handler(&p->defaultHandler, handler); XML_SetDefaultHandler(p->parser, _xml_defaultHandler); return true; } -bool f_xml_set_element_handler(CObjRef parser, CVarRef start_element_handler, +bool f_xml_set_element_handler(CResRef parser, CVarRef start_element_handler, CVarRef end_element_handler) { XmlParser * p = parser.getTyped(); xml_set_handler(&p->startElementHandler, start_element_handler); @@ -804,7 +804,7 @@ bool f_xml_set_element_handler(CObjRef parser, CVarRef start_element_handler, return true; } -bool f_xml_set_processing_instruction_handler(CObjRef parser, CVarRef handler){ +bool f_xml_set_processing_instruction_handler(CResRef parser, CVarRef handler){ XmlParser * p = parser.getTyped(); xml_set_handler(&p->processingInstructionHandler, handler); XML_SetProcessingInstructionHandler(p->parser, @@ -812,63 +812,63 @@ bool f_xml_set_processing_instruction_handler(CObjRef parser, CVarRef handler){ return true; } -bool f_xml_set_start_namespace_decl_handler(CObjRef parser, CVarRef handler) { +bool f_xml_set_start_namespace_decl_handler(CResRef parser, CVarRef handler) { XmlParser * p = parser.getTyped(); xml_set_handler(&p->startNamespaceDeclHandler, handler); XML_SetStartNamespaceDeclHandler(p->parser, _xml_startNamespaceDeclHandler); return true; } -bool f_xml_set_end_namespace_decl_handler(CObjRef parser, CVarRef handler) { +bool f_xml_set_end_namespace_decl_handler(CResRef parser, CVarRef handler) { XmlParser * p = parser.getTyped(); xml_set_handler(&p->endNamespaceDeclHandler, handler); XML_SetEndNamespaceDeclHandler(p->parser, _xml_endNamespaceDeclHandler); return true; } -bool f_xml_set_unparsed_entity_decl_handler(CObjRef parser, CVarRef handler) { +bool f_xml_set_unparsed_entity_decl_handler(CResRef parser, CVarRef handler) { XmlParser * p = parser.getTyped(); xml_set_handler(&p->unparsedEntityDeclHandler, handler); XML_SetUnparsedEntityDeclHandler(p->parser, _xml_unparsedEntityDeclHandler); return true; } -bool f_xml_set_external_entity_ref_handler(CObjRef parser, CVarRef handler) { +bool f_xml_set_external_entity_ref_handler(CResRef parser, CVarRef handler) { XmlParser * p = parser.getTyped(); xml_set_handler(&p->externalEntityRefHandler, handler); XML_SetExternalEntityRefHandler(p->parser, _xml_externalEntityRefHandler); return true; } -bool f_xml_set_notation_decl_handler(CObjRef parser, CVarRef handler) { +bool f_xml_set_notation_decl_handler(CResRef parser, CVarRef handler) { XmlParser * p = parser.getTyped(); xml_set_handler(&p->notationDeclHandler, handler); XML_SetNotationDeclHandler(p->parser, _xml_notationDeclHandler); return true; } -bool f_xml_set_object(CObjRef parser, VRefParam object) { +bool f_xml_set_object(CResRef parser, VRefParam object) { XmlParser * p = parser.getTyped(); p->object.assignRef(object); return true; } -int64_t f_xml_get_current_byte_index(CObjRef parser) { +int64_t f_xml_get_current_byte_index(CResRef parser) { XmlParser * p = parser.getTyped(); return XML_GetCurrentByteIndex(p->parser); } -int64_t f_xml_get_current_column_number(CObjRef parser) { +int64_t f_xml_get_current_column_number(CResRef parser) { XmlParser * p = parser.getTyped(); return XML_GetCurrentColumnNumber(p->parser); } -int64_t f_xml_get_current_line_number(CObjRef parser) { +int64_t f_xml_get_current_line_number(CResRef parser) { XmlParser * p = parser.getTyped(); return XML_GetCurrentLineNumber(p->parser); } -int64_t f_xml_get_error_code(CObjRef parser) { +int64_t f_xml_get_error_code(CResRef parser) { XmlParser * p = parser.getTyped(); return XML_GetErrorCode(p->parser); } diff --git a/hphp/runtime/ext/ext_xml.h b/hphp/runtime/ext/ext_xml.h index 7aeba5580..b119aefff 100644 --- a/hphp/runtime/ext/ext_xml.h +++ b/hphp/runtime/ext/ext_xml.h @@ -26,26 +26,26 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// Object f_xml_parser_create(CStrRef encoding = null_string); -bool f_xml_parser_free(CObjRef parser); -int64_t f_xml_parse(CObjRef parser, CStrRef data, bool is_final = true); -int64_t f_xml_parse_into_struct(CObjRef parser, CStrRef data, VRefParam values, VRefParam index = uninit_null()); +bool f_xml_parser_free(CResRef parser); +int64_t f_xml_parse(CResRef parser, CStrRef data, bool is_final = true); +int64_t f_xml_parse_into_struct(CResRef parser, CStrRef data, VRefParam values, VRefParam index = uninit_null()); Object f_xml_parser_create_ns(CStrRef encoding = null_string, CStrRef separator = null_string); -Variant f_xml_parser_get_option(CObjRef parser, int option); -bool f_xml_parser_set_option(CObjRef parser, int option, CVarRef value); -bool f_xml_set_character_data_handler(CObjRef parser, CVarRef handler); -bool f_xml_set_default_handler(CObjRef parser, CVarRef handler); -bool f_xml_set_element_handler(CObjRef parser, CVarRef start_element_handler, CVarRef end_element_handler); -bool f_xml_set_processing_instruction_handler(CObjRef parser, CVarRef handler); -bool f_xml_set_start_namespace_decl_handler(CObjRef parser, CVarRef handler); -bool f_xml_set_end_namespace_decl_handler(CObjRef parser, CVarRef handler); -bool f_xml_set_unparsed_entity_decl_handler(CObjRef parser, CVarRef handler); -bool f_xml_set_external_entity_ref_handler(CObjRef parser, CVarRef handler); -bool f_xml_set_notation_decl_handler(CObjRef parser, CVarRef handler); -bool f_xml_set_object(CObjRef parser, VRefParam object); -int64_t f_xml_get_current_byte_index(CObjRef parser); -int64_t f_xml_get_current_column_number(CObjRef parser); -int64_t f_xml_get_current_line_number(CObjRef parser); -int64_t f_xml_get_error_code(CObjRef parser); +Variant f_xml_parser_get_option(CResRef parser, int option); +bool f_xml_parser_set_option(CResRef parser, int option, CVarRef value); +bool f_xml_set_character_data_handler(CResRef parser, CVarRef handler); +bool f_xml_set_default_handler(CResRef parser, CVarRef handler); +bool f_xml_set_element_handler(CResRef parser, CVarRef start_element_handler, CVarRef end_element_handler); +bool f_xml_set_processing_instruction_handler(CResRef parser, CVarRef handler); +bool f_xml_set_start_namespace_decl_handler(CResRef parser, CVarRef handler); +bool f_xml_set_end_namespace_decl_handler(CResRef parser, CVarRef handler); +bool f_xml_set_unparsed_entity_decl_handler(CResRef parser, CVarRef handler); +bool f_xml_set_external_entity_ref_handler(CResRef parser, CVarRef handler); +bool f_xml_set_notation_decl_handler(CResRef parser, CVarRef handler); +bool f_xml_set_object(CResRef parser, VRefParam object); +int64_t f_xml_get_current_byte_index(CResRef parser); +int64_t f_xml_get_current_column_number(CResRef parser); +int64_t f_xml_get_current_line_number(CResRef parser); +int64_t f_xml_get_error_code(CResRef parser); String f_xml_error_string(int code); String f_utf8_decode(CStrRef data); String f_utf8_encode(CStrRef data); diff --git a/hphp/runtime/ext/ext_xmlreader.h b/hphp/runtime/ext/ext_xmlreader.h index 7e518b20b..3b47d3400 100644 --- a/hphp/runtime/ext/ext_xmlreader.h +++ b/hphp/runtime/ext/ext_xmlreader.h @@ -102,7 +102,7 @@ class c_XMLReader : public ExtObjectDataFlags, public Sweepa private: bool set_relaxng_schema(String source, int type); public: - SmartObject m_uri; + SmartResource m_uri; private: xmlTextReaderPtr m_ptr; xmlParserInputBufferPtr m_input; diff --git a/hphp/runtime/ext/ext_xmlwriter.cpp b/hphp/runtime/ext/ext_xmlwriter.cpp index a916eb628..9fadf6b25 100644 --- a/hphp/runtime/ext/ext_xmlwriter.cpp +++ b/hphp/runtime/ext/ext_xmlwriter.cpp @@ -315,7 +315,7 @@ bool c_XMLWriter::t_openuri(CStrRef uri) { if (same(file, false)) { return false; } - m_uri = file.toObject().getTyped(); + m_uri = file.toResource().getTyped(); m_uri_output = xmlOutputBufferCreateIO(write_file, close_file, this, NULL); if (m_uri_output == NULL) { diff --git a/hphp/runtime/ext/ext_xmlwriter.h b/hphp/runtime/ext/ext_xmlwriter.h index 094caac99..fdd59d9ea 100644 --- a/hphp/runtime/ext/ext_xmlwriter.h +++ b/hphp/runtime/ext/ext_xmlwriter.h @@ -129,7 +129,7 @@ class c_XMLWriter : public ExtObjectData, public Sweepable { public: - SmartObject m_uri; + SmartResource m_uri; private: xmlTextWriterPtr m_ptr; xmlBufferPtr m_output; diff --git a/hphp/runtime/ext/ext_zlib.cpp b/hphp/runtime/ext/ext_zlib.cpp index 9f99596b5..dd0ca8a5a 100644 --- a/hphp/runtime/ext/ext_zlib.cpp +++ b/hphp/runtime/ext/ext_zlib.cpp @@ -252,7 +252,7 @@ static Variant gzinflate(const char *data, int len, int limit /* = 0 */) { /////////////////////////////////////////////////////////////////////////////// Variant f_readgzfile(CStrRef filename, bool use_include_path /* = false */) { - Object stream = f_gzopen(filename, "rb", use_include_path); + Resource stream = f_gzopen(filename, "rb", use_include_path); if (stream.isNull()) { return false; } @@ -260,7 +260,7 @@ Variant f_readgzfile(CStrRef filename, bool use_include_path /* = false */) { } Variant f_gzfile(CStrRef filename, bool use_include_path /* = false */) { - Object stream = f_gzopen(filename, "rb", use_include_path); + Resource stream = f_gzopen(filename, "rb", use_include_path); if (stream.isNull()) { return false; } @@ -315,10 +315,10 @@ String f_zlib_get_coding_type() { /////////////////////////////////////////////////////////////////////////////// // stream functions -Object f_gzopen(CStrRef filename, CStrRef mode, - bool use_include_path /* = false */) { +Resource f_gzopen(CStrRef filename, CStrRef mode, + bool use_include_path /* = false */) { File *file = NEWOBJ(ZipFile)(); - Object handle(file); + Resource handle(file); bool ret = file->open(File::TranslatePath(filename), mode); if (!ret) { raise_warning("%s",Util::safe_strerror(errno).c_str()); @@ -327,41 +327,41 @@ Object f_gzopen(CStrRef filename, CStrRef mode, return handle; } -bool f_gzclose(CObjRef zp) { +bool f_gzclose(CResRef zp) { return f_fclose(zp); } -Variant f_gzread(CObjRef zp, int64_t length /* = 0 */) { +Variant f_gzread(CResRef zp, int64_t length /* = 0 */) { return f_fread(zp, length); } -Variant f_gzseek(CObjRef zp, int64_t offset, int64_t whence /* = k_SEEK_SET */) { +Variant f_gzseek(CResRef zp, int64_t offset, int64_t whence /* = k_SEEK_SET */) { return f_fseek(zp, offset, whence); } -Variant f_gztell(CObjRef zp) { +Variant f_gztell(CResRef zp) { return f_ftell(zp); } -bool f_gzeof(CObjRef zp) { +bool f_gzeof(CResRef zp) { return f_feof(zp); } -bool f_gzrewind(CObjRef zp) { +bool f_gzrewind(CResRef zp) { return f_rewind(zp); } -Variant f_gzgetc(CObjRef zp) { +Variant f_gzgetc(CResRef zp) { return f_fgetc(zp); } -Variant f_gzgets(CObjRef zp, int64_t length /* = 1024 */) { +Variant f_gzgets(CResRef zp, int64_t length /* = 1024 */) { return f_fgets(zp, length); } -Variant f_gzgetss(CObjRef zp, int64_t length /* = 0 */, +Variant f_gzgetss(CResRef zp, int64_t length /* = 0 */, CStrRef allowable_tags /* = null_string */) { return f_fgetss(zp, length, allowable_tags); } -Variant f_gzpassthru(CObjRef zp) { +Variant f_gzpassthru(CResRef zp) { return f_fpassthru(zp); } -Variant f_gzputs(CObjRef zp, CStrRef str, int64_t length /* = 0 */) { +Variant f_gzputs(CResRef zp, CStrRef str, int64_t length /* = 0 */) { return f_fwrite(zp, str, length); } -Variant f_gzwrite(CObjRef zp, CStrRef str, int64_t length /* = 0 */) { +Variant f_gzwrite(CResRef zp, CStrRef str, int64_t length /* = 0 */) { return f_fwrite(zp, str, length); } diff --git a/hphp/runtime/ext/ext_zlib.h b/hphp/runtime/ext/ext_zlib.h index 291651b6e..6a4309714 100644 --- a/hphp/runtime/ext/ext_zlib.h +++ b/hphp/runtime/ext/ext_zlib.h @@ -48,21 +48,22 @@ Variant f_lz4uncompress(CStrRef compressed); /////////////////////////////////////////////////////////////////////////////// // stream functions -Object f_gzopen(CStrRef filename, CStrRef mode, bool use_include_path = false); +Resource f_gzopen(CStrRef filename, CStrRef mode, + bool use_include_path = false); -bool f_gzclose(CObjRef zp); -Variant f_gzread(CObjRef zp, int64_t length = 0); -Variant f_gzseek(CObjRef zp, int64_t offset, int64_t whence = k_SEEK_SET); -Variant f_gztell(CObjRef zp); -bool f_gzeof(CObjRef zp); -bool f_gzrewind(CObjRef zp); -Variant f_gzgetc(CObjRef zp); -Variant f_gzgets(CObjRef zp, int64_t length = 1024); -Variant f_gzgetss(CObjRef zp, int64_t length = 0, +bool f_gzclose(CResRef zp); +Variant f_gzread(CResRef zp, int64_t length = 0); +Variant f_gzseek(CResRef zp, int64_t offset, int64_t whence = k_SEEK_SET); +Variant f_gztell(CResRef zp); +bool f_gzeof(CResRef zp); +bool f_gzrewind(CResRef zp); +Variant f_gzgetc(CResRef zp); +Variant f_gzgets(CResRef zp, int64_t length = 1024); +Variant f_gzgetss(CResRef zp, int64_t length = 0, CStrRef allowable_tags = null_string); -Variant f_gzpassthru(CObjRef zp); -Variant f_gzputs(CObjRef zp, CStrRef str, int64_t length = 0); -Variant f_gzwrite(CObjRef zp, CStrRef str, int64_t length = 0); +Variant f_gzpassthru(CResRef zp); +Variant f_gzputs(CResRef zp, CStrRef str, int64_t length = 0); +Variant f_gzwrite(CResRef zp, CStrRef str, int64_t length = 0); /////////////////////////////////////////////////////////////////////////////// } diff --git a/hphp/runtime/ext/mailparse/mime.cpp b/hphp/runtime/ext/mailparse/mime.cpp index 7fb119142..99870b45c 100644 --- a/hphp/runtime/ext/mailparse/mime.cpp +++ b/hphp/runtime/ext/mailparse/mime.cpp @@ -330,7 +330,7 @@ bool MimePart::enumeratePartsImpl(Enumerator *top, Enumerator **child, for (ArrayIter iter(m_children); iter; ++iter) { if (next.id) { - MimePart *childpart = iter.second().toObject().getTyped(); + MimePart *childpart = iter.second().toResource().getTyped(); if (!childpart->enumeratePartsImpl(top, &next.next, callback, ptr)) { return false; } @@ -411,7 +411,7 @@ bool MimePart::findPart(Enumerator *id, void *ptr) { return true; } -Object MimePart::findByName(const char *name) { +Resource MimePart::findByName(const char *name) { struct find_part_struct find; find.searchfor = name; find.foundpart = NULL; @@ -623,7 +623,7 @@ MimePart *MimePart::createChild(int startpos, bool inherit) { m_parsedata.lastpart = child; child->m_parent = this; - m_children.append(Object(child)); + m_children.append(Resource(child)); child->m_startpos = child->m_endpos = child->m_bodystart = child->m_bodyend = startpos; @@ -905,21 +905,21 @@ void MimePart::UpdatePositions(MimePart *part, int newendpos, Variant MimePart::extract(CVarRef filename, CVarRef callbackfunc, int decode, bool isfile) { /* filename can be a filename or a stream */ - Object file; + Resource file; File *f = NULL; if (filename.isResource()) { - f = filename.toObject().getTyped(); + f = filename.toResource().getTyped(); } else if (isfile) { Variant stream = File::Open(filename.toString(), "rb"); if (!same(stream, false)) { - file = stream.toObject(); + file = stream.toResource(); f = file.getTyped(); } } else { /* filename is the actual data */ String data = filename.toString(); f = NEWOBJ(MemFile)(data.data(), data.size()); - file = Object(f); + file = Resource(f); } if (f == NULL) { @@ -944,7 +944,7 @@ Variant MimePart::extract(CVarRef filename, CVarRef callbackfunc, int decode, return m_extract_context; } if (callbackfunc.isResource()) { - return f_stream_get_contents(callbackfunc.toObject()); + return f_stream_get_contents(callbackfunc.toResource()); } return true; } @@ -990,7 +990,7 @@ void MimePart::outputToStdout(CStrRef s) { } void MimePart::outputToFile(CStrRef s) { - m_extract_context.toObject().getTyped()->write(s); + m_extract_context.toResource().getTyped()->write(s); } void MimePart::outputToString(CStrRef s) { diff --git a/hphp/runtime/ext/mailparse/mime.h b/hphp/runtime/ext/mailparse/mime.h index dbbcd2b43..334d2c6cd 100644 --- a/hphp/runtime/ext/mailparse/mime.h +++ b/hphp/runtime/ext/mailparse/mime.h @@ -55,7 +55,7 @@ public: bool isfile); Variant getPartData(); Array getStructure(); - Object findByName(const char *name); + Resource findByName(const char *name); bool isVersion1(); int filter(int c); @@ -65,7 +65,7 @@ private: public: MimeHeader(); explicit MimeHeader(const char *value); - MimeHeader(php_rfc822_tokenized_t *toks); + explicit MimeHeader(php_rfc822_tokenized_t *toks); bool empty() const { return m_empty;} void clear(); @@ -86,7 +86,7 @@ private: static void UpdatePositions(MimePart *part, int newendpos, int newbodyend, int deltanlines); - Object m_parent; + Resource m_parent; Array m_children; /* child parts */ int m_startpos, m_endpos; /* offsets of this part in the message */ @@ -119,7 +119,7 @@ private: String workbuf; String headerbuf; - Object lastpart; + Resource lastpart; } m_parsedata; int extractImpl(int decode, File *src); diff --git a/hphp/runtime/ext/pdo_driver.h b/hphp/runtime/ext/pdo_driver.h index 5460e3803..24be55c2e 100644 --- a/hphp/runtime/ext/pdo_driver.h +++ b/hphp/runtime/ext/pdo_driver.h @@ -232,7 +232,7 @@ private: /////////////////////////////////////////////////////////////////////////////// class PDOStatement; -typedef SmartObject sp_PDOStatement; +typedef SmartResource sp_PDOStatement; /* represents a connection to a database */ class PDOConnection : public ResourceData { @@ -383,7 +383,7 @@ public: /* defaults for fetches */ PDOFetchType default_fetch_type; }; -typedef SmartObject sp_PDOConnection; +typedef SmartResource sp_PDOConnection; /////////////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/ext/pdo_mysql.cpp b/hphp/runtime/ext/pdo_mysql.cpp index 61f1cc7bb..43205b018 100644 --- a/hphp/runtime/ext/pdo_mysql.cpp +++ b/hphp/runtime/ext/pdo_mysql.cpp @@ -987,17 +987,17 @@ bool PDOMySqlStatement::describer(int colno) { if (columns.empty()) { for (int i = 0; i < column_count; i++) { - columns.set(i, Object(new PDOColumn())); + columns.set(i, Resource(new PDOColumn())); } } // fetch all on demand, this seems easiest if we've been here before bail out - PDOColumn *col = columns[0].toObject().getTyped(); + PDOColumn *col = columns[0].toResource().getTyped(); if (!col->name.empty()) { return true; } for (int i = 0; i < column_count; i++) { - col = columns[i].toObject().getTyped(); + col = columns[i].toResource().getTyped(); if (m_conn->fetch_table_names()) { col->name = String(m_fields[i].table) + "." + @@ -1096,7 +1096,7 @@ bool PDOMySqlStatement::paramHook(PDOBoundParam *param, return false; case PDO_PARAM_LOB: if (param->parameter.isResource()) { - Variant buf = f_stream_get_contents(param->parameter.toObject()); + Variant buf = f_stream_get_contents(param->parameter.toResource()); if (!same(buf, false)) { param->parameter = buf; } else { diff --git a/hphp/runtime/ext/pdo_sqlite.cpp b/hphp/runtime/ext/pdo_sqlite.cpp index 14792f9a4..f47c4a2c4 100644 --- a/hphp/runtime/ext/pdo_sqlite.cpp +++ b/hphp/runtime/ext/pdo_sqlite.cpp @@ -401,11 +401,11 @@ bool PDOSqliteStatement::describer(int colno) { if (columns.empty()) { for (int i = 0; i < column_count; i++) { - columns.set(i, Object(new PDOColumn())); + columns.set(i, Resource(new PDOColumn())); } } - PDOColumn *col = columns[colno].toObject().getTyped(); + PDOColumn *col = columns[colno].toResource().getTyped(); col->name = String(sqlite3_column_name(m_stmt, colno), CopyString); col->maxlen = 0xffffffff; col->precision = 0; @@ -499,7 +499,7 @@ bool PDOSqliteStatement::paramHook(PDOBoundParam *param, case PDO_PARAM_LOB: if (param->parameter.isResource()) { - Variant buf = f_stream_get_contents(param->parameter.toObject()); + Variant buf = f_stream_get_contents(param->parameter.toResource()); if (!same(buf, false)) { param->parameter = buf; } else { diff --git a/hphp/runtime/ext/soap/xml.cpp b/hphp/runtime/ext/soap/xml.cpp index cb00f826a..3444f9a97 100644 --- a/hphp/runtime/ext/soap/xml.cpp +++ b/hphp/runtime/ext/soap/xml.cpp @@ -81,7 +81,7 @@ xmlDocPtr soap_xmlParseFile(const char *filename) { Variant stream = File::Open(filename, "rb", 0, f_stream_context_create( CREATE_MAP1(s_http, CREATE_MAP1(s_timeout, 1000)))); if (!same(stream, false)) { - content = f_stream_get_contents(stream.toObject()); + content = f_stream_get_contents(stream.toResource()); if (!same(content, false)) { f_apc_store(cache_key, content); } diff --git a/hphp/runtime/vm/class.h b/hphp/runtime/vm/class.h index c5220cff8..760e71b8a 100644 --- a/hphp/runtime/vm/class.h +++ b/hphp/runtime/vm/class.h @@ -364,6 +364,7 @@ class Class : public AtomicCountable { public: friend class ExecutionContext; friend class ObjectData; + friend class ResourceData; friend class Unit; enum class Avail { diff --git a/hphp/system/idl/curl.idl.json b/hphp/system/idl/curl.idl.json index 350172570..33d726eee 100644 --- a/hphp/system/idl/curl.idl.json +++ b/hphp/system/idl/curl.idl.json @@ -626,7 +626,7 @@ "args": [ { "name": "handle", - "type": "Object", + "type": "Resource", "desc": "The object created by calling evhttp_async_get() or evhttp_async_post()." } ] @@ -634,4 +634,4 @@ ], "classes": [ ] -} \ No newline at end of file +} diff --git a/hphp/system/idl/imap.idl.json b/hphp/system/idl/imap.idl.json index d5e204542..bdafd4ce1 100644 --- a/hphp/system/idl/imap.idl.json +++ b/hphp/system/idl/imap.idl.json @@ -47,7 +47,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -117,7 +117,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -146,7 +146,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -174,7 +174,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." } ] @@ -192,7 +192,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -226,7 +226,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -250,7 +250,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -273,7 +273,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -302,7 +302,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -338,7 +338,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." } ] @@ -356,7 +356,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -385,7 +385,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -419,7 +419,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -447,7 +447,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -476,7 +476,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -499,7 +499,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -522,7 +522,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -545,7 +545,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -568,7 +568,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -596,7 +596,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -623,7 +623,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -662,7 +662,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -702,7 +702,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." } ] @@ -733,7 +733,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -761,7 +761,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -789,7 +789,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -822,7 +822,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -850,7 +850,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -901,7 +901,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -935,7 +935,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1020,7 +1020,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." } ] @@ -1056,7 +1056,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1079,7 +1079,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." } ] @@ -1097,7 +1097,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." } ] @@ -1155,7 +1155,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." } ] @@ -1191,7 +1191,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1219,7 +1219,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1329,7 +1329,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1369,7 +1369,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1402,7 +1402,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1436,7 +1436,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1464,7 +1464,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1497,7 +1497,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1531,7 +1531,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1575,7 +1575,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1604,7 +1604,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1627,7 +1627,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1674,7 +1674,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1697,7 +1697,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1725,7 +1725,7 @@ "args": [ { "name": "imap_stream", - "type": "Object", + "type": "Resource", "desc": "An IMAP stream returned by imap_open()." }, { @@ -1792,4 +1792,4 @@ ], "classes": [ ] -} \ No newline at end of file +} diff --git a/hphp/system/idl/magick.idl.json b/hphp/system/idl/magick.idl.json index e4982033e..257ce99af 100644 --- a/hphp/system/idl/magick.idl.json +++ b/hphp/system/idl/magick.idl.json @@ -8377,4 +8377,4 @@ ], "classes": [ ] -} \ No newline at end of file +} diff --git a/hphp/system/idl/openssl.idl.json b/hphp/system/idl/openssl.idl.json index ca058f7cf..794816a8a 100644 --- a/hphp/system/idl/openssl.idl.json +++ b/hphp/system/idl/openssl.idl.json @@ -580,7 +580,7 @@ "args": [ { "name": "key", - "type": "Object", + "type": "Resource", "desc": "Resource holding the key." } ] @@ -598,7 +598,7 @@ "args": [ { "name": "key", - "type": "Object" + "type": "Resource" } ] }, @@ -615,7 +615,7 @@ "args": [ { "name": "key", - "type": "Object", + "type": "Resource", "desc": "Resource holding the key." } ] @@ -1073,7 +1073,7 @@ "args": [ { "name": "x509cert", - "type": "Object" + "type": "Resource" } ] }, @@ -1310,4 +1310,4 @@ ], "classes": [ ] -} \ No newline at end of file +} diff --git a/hphp/system/idl/socket.idl.json b/hphp/system/idl/socket.idl.json index 7d047a924..1e3d4efe1 100644 --- a/hphp/system/idl/socket.idl.json +++ b/hphp/system/idl/socket.idl.json @@ -705,7 +705,7 @@ { "name": "socket", "type": "Resource", - "value": "null_object", + "value": "null_resource", "desc": "A valid socket resource created with socket_create()." } ] @@ -724,7 +724,7 @@ { "name": "socket", "type": "Resource", - "value": "null_object", + "value": "null_resource", "desc": "A valid socket resource created with socket_create()." } ] @@ -771,4 +771,4 @@ ], "classes": [ ] -} \ No newline at end of file +} diff --git a/hphp/system/idl/stream.idl.json b/hphp/system/idl/stream.idl.json index d75a2ef12..e42892e8f 100644 --- a/hphp/system/idl/stream.idl.json +++ b/hphp/system/idl/stream.idl.json @@ -562,7 +562,7 @@ { "name": "context", "type": "Resource", - "value": "null_object", + "value": "null_resource", "desc": "A valid context resource created with stream_context_create()." } ] @@ -773,7 +773,7 @@ { "name": "context", "type": "Resource", - "value": "null_object" + "value": "null_resource" } ] }, @@ -822,7 +822,7 @@ { "name": "context", "type": "Resource", - "value": "null_object", + "value": "null_resource", "desc": "A valid context resource created with stream_context_create()." } ] @@ -856,7 +856,7 @@ { "name": "session_stream", "type": "Resource", - "value": "null_object", + "value": "null_resource", "desc": "Seed the stream with settings from session_stream." } ] @@ -1008,4 +1008,4 @@ ], "classes": [ ] -} \ No newline at end of file +} diff --git a/hphp/system/idl/xmlwriter.idl.json b/hphp/system/idl/xmlwriter.idl.json index e58be1975..a6b533521 100644 --- a/hphp/system/idl/xmlwriter.idl.json +++ b/hphp/system/idl/xmlwriter.idl.json @@ -23,7 +23,7 @@ "HasDocComment" ], "return": { - "type": "Resource", + "type": "Object", "desc": "Object oriented style: Returns TRUE on success or FALSE on failure.\n\nProcedural style: Returns a new xmlwriter resource for later use with the xmlwriter functions on success, FALSE on error." }, "args": [ @@ -47,7 +47,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -70,7 +70,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -93,7 +93,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -129,7 +129,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -152,7 +152,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -185,7 +185,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -224,7 +224,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -253,7 +253,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -271,7 +271,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -289,7 +289,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -322,7 +322,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -345,7 +345,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -383,7 +383,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -411,7 +411,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -429,7 +429,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -447,7 +447,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -470,7 +470,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -488,7 +488,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -506,7 +506,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -529,7 +529,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -547,7 +547,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -565,7 +565,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -588,7 +588,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -616,7 +616,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -634,7 +634,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -657,7 +657,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -680,7 +680,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -715,7 +715,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -756,7 +756,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -779,7 +779,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -807,7 +807,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -825,7 +825,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -848,7 +848,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -876,7 +876,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -894,7 +894,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -921,7 +921,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -969,7 +969,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -987,7 +987,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." } ] @@ -1005,7 +1005,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -1029,7 +1029,7 @@ "args": [ { "name": "xmlwriter", - "type": "Resource", + "type": "Object", "desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()." }, { @@ -1771,4 +1771,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/hphp/test/ext/test_cpp_base.cpp b/hphp/test/ext/test_cpp_base.cpp index 92e08f047..689451c5c 100644 --- a/hphp/test/ext/test_cpp_base.cpp +++ b/hphp/test/ext/test_cpp_base.cpp @@ -616,7 +616,7 @@ bool TestCppBase::TestObject() { auto os = f_serialize(o); VS(os, "O:1:\"B\":1:{s:3:\"obj\";O:1:\"A\":1:{s:1:\"a\";i:10;}}"); } - VERIFY(!equal(Object(new TestResource()), Object(new TestResource()) )); + VERIFY(!equal(Resource(new TestResource()), Resource(new TestResource()) )); return Count(true); } diff --git a/hphp/test/ext/test_debugger.cpp b/hphp/test/ext/test_debugger.cpp index 4a3dde6a5..306443b36 100644 --- a/hphp/test/ext/test_debugger.cpp +++ b/hphp/test/ext/test_debugger.cpp @@ -94,10 +94,10 @@ bool TestDebugger::getResponse(const string& path, string& result, server += "/" + path; printf("\n Getting URL '%s'...\n", server.get()->data()); Variant c = f_curl_init(); - f_curl_setopt(c.toObject(), k_CURLOPT_URL, server); - f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_setopt(c.toObject(), CURLOPT_TIMEOUT, 120); - Variant res = f_curl_exec(c.toObject()); + f_curl_setopt(c.toResource(), k_CURLOPT_URL, server); + f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_setopt(c.toResource(), CURLOPT_TIMEOUT, 120); + Variant res = f_curl_exec(c.toResource()); if (same(res, false)) { printf(" Request failed\n"); return false; diff --git a/hphp/test/ext/test_ext_curl.cpp b/hphp/test/ext/test_ext_curl.cpp index 7a06509a3..abe847d67 100644 --- a/hphp/test/ext/test_ext_curl.cpp +++ b/hphp/test/ext/test_ext_curl.cpp @@ -116,18 +116,18 @@ bool TestExtCurl::RunTests(const std::string &which) { bool TestExtCurl::test_curl_init() { Variant c = f_curl_init(); - VS(f_curl_errno(c.toObject()), 0); - VS(f_curl_error(c.toObject()), ""); + VS(f_curl_errno(c.toResource()), 0); + VS(f_curl_error(c.toResource()), ""); return Count(true); } bool TestExtCurl::test_curl_copy_handle() { Variant c = f_curl_init(); - f_curl_setopt(c.toObject(), k_CURLOPT_URL, String(get_request_uri())); - f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true); - Variant cpy = f_curl_copy_handle(c.toObject()); - f_curl_close(c.toObject()); // to test cpy is still working fine - Variant res = f_curl_exec(cpy.toObject()); + f_curl_setopt(c.toResource(), k_CURLOPT_URL, String(get_request_uri())); + f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true); + Variant cpy = f_curl_copy_handle(c.toResource()); + f_curl_close(c.toResource()); // to test cpy is still working fine + Variant res = f_curl_exec(cpy.toResource()); if (res.toString() != "OK") { // XXX: t1782098 return CountSkip(); @@ -151,9 +151,9 @@ bool TestExtCurl::test_curl_version() { bool TestExtCurl::test_curl_setopt() { Variant c = f_curl_init(); - f_curl_setopt(c.toObject(), k_CURLOPT_URL, String(get_request_uri())); - f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true); - Variant res = f_curl_exec(c.toObject()); + f_curl_setopt(c.toResource(), k_CURLOPT_URL, String(get_request_uri())); + f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true); + Variant res = f_curl_exec(c.toResource()); VS(res, "OK"); return Count(true); } @@ -161,10 +161,10 @@ bool TestExtCurl::test_curl_setopt() { bool TestExtCurl::test_curl_setopt_array() { Variant c = f_curl_init(); f_curl_setopt_array - (c.toObject(), + (c.toResource(), CREATE_MAP2(k_CURLOPT_URL, String(get_request_uri()), k_CURLOPT_RETURNTRANSFER, true)); - Variant res = f_curl_exec(c.toObject()); + Variant res = f_curl_exec(c.toResource()); VS(res, "OK"); return Count(true); } @@ -172,15 +172,15 @@ bool TestExtCurl::test_curl_setopt_array() { bool TestExtCurl::test_curl_exec() { { Variant c = f_curl_init(String(get_request_uri())); - f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true); - Variant res = f_curl_exec(c.toObject()); + f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true); + Variant res = f_curl_exec(c.toResource()); VS(res, "OK"); } { Variant c = f_curl_init(String(get_request_uri())); - f_curl_setopt(c.toObject(), k_CURLOPT_WRITEFUNCTION, "curl_write_func"); + f_curl_setopt(c.toResource(), k_CURLOPT_WRITEFUNCTION, "curl_write_func"); f_ob_start(); - f_curl_exec(c.toObject()); + f_curl_exec(c.toResource()); String res = f_ob_get_contents(); VS(res, "curl_write_func called with OK"); f_ob_end_clean(); @@ -190,29 +190,29 @@ bool TestExtCurl::test_curl_exec() { bool TestExtCurl::test_curl_getinfo() { Variant c = f_curl_init(String(get_request_uri())); - f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_exec(c.toObject()); - Variant ret = f_curl_getinfo(c.toObject()); + f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_exec(c.toResource()); + Variant ret = f_curl_getinfo(c.toResource()); VS(ret[s_url], String(get_request_uri())); - ret = f_curl_getinfo(c.toObject(), k_CURLINFO_EFFECTIVE_URL); + ret = f_curl_getinfo(c.toResource(), k_CURLINFO_EFFECTIVE_URL); VS(ret, String(get_request_uri())); return Count(true); } bool TestExtCurl::test_curl_errno() { Variant c = f_curl_init("http://www.thereisnosuchanurl"); - f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_exec(c.toObject()); - Variant err = f_curl_errno(c.toObject()); + f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_exec(c.toResource()); + Variant err = f_curl_errno(c.toResource()); VS(err, k_CURLE_COULDNT_RESOLVE_HOST); return Count(true); } bool TestExtCurl::test_curl_error() { Variant c = f_curl_init("http://www.thereisnosuchanurl"); - f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_exec(c.toObject()); - Variant err = f_curl_error(c.toObject()); + f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_exec(c.toResource()); + Variant err = f_curl_error(c.toResource()); VERIFY(equal(err, String("Couldn't resolve host 'www.thereisnosuchanurl'")) || equal(err, String("Could not resolve host: www.thereisnosuchanurl" " (Domain name not found)"))); @@ -221,9 +221,9 @@ bool TestExtCurl::test_curl_error() { bool TestExtCurl::test_curl_close() { Variant c = f_curl_init(String(get_request_uri())); - f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_exec(c.toObject()); - f_curl_close(c.toObject()); + f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_exec(c.toResource()); + f_curl_close(c.toResource()); return Count(true); } @@ -233,32 +233,32 @@ bool TestExtCurl::test_curl_multi_init() { } bool TestExtCurl::test_curl_multi_add_handle() { - Object mh = f_curl_multi_init(); + Resource mh = f_curl_multi_init(); Variant c1 = f_curl_init(String(get_request_uri())); Variant c2 = f_curl_init(String(get_request_uri())); - f_curl_multi_add_handle(mh, c1.toObject()); - f_curl_multi_add_handle(mh, c2.toObject()); + f_curl_multi_add_handle(mh, c1.toResource()); + f_curl_multi_add_handle(mh, c2.toResource()); return Count(true); } bool TestExtCurl::test_curl_multi_remove_handle() { - Object mh = f_curl_multi_init(); + Resource mh = f_curl_multi_init(); Variant c1 = f_curl_init(String(get_request_uri())); Variant c2 = f_curl_init(String(get_request_uri())); - f_curl_multi_add_handle(mh, c1.toObject()); - f_curl_multi_add_handle(mh, c2.toObject()); - f_curl_multi_remove_handle(mh, c1.toObject()); + f_curl_multi_add_handle(mh, c1.toResource()); + f_curl_multi_add_handle(mh, c2.toResource()); + f_curl_multi_remove_handle(mh, c1.toResource()); return Count(true); } bool TestExtCurl::test_curl_multi_exec() { - Object mh = f_curl_multi_init(); + Resource mh = f_curl_multi_init(); Variant c1 = f_curl_init(String(get_request_uri())); Variant c2 = f_curl_init(String(get_request_uri())); - f_curl_setopt(c1.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_setopt(c2.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_multi_add_handle(mh, c1.toObject()); - f_curl_multi_add_handle(mh, c2.toObject()); + f_curl_setopt(c1.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_setopt(c2.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_multi_add_handle(mh, c1.toResource()); + f_curl_multi_add_handle(mh, c2.toResource()); Variant still_running; do { @@ -269,44 +269,44 @@ bool TestExtCurl::test_curl_multi_exec() { } bool TestExtCurl::test_curl_multi_select() { - Object mh = f_curl_multi_init(); + Resource mh = f_curl_multi_init(); Variant c1 = f_curl_init(String(get_request_uri())); Variant c2 = f_curl_init(String(get_request_uri())); - f_curl_multi_add_handle(mh, c1.toObject()); - f_curl_multi_add_handle(mh, c2.toObject()); + f_curl_multi_add_handle(mh, c1.toResource()); + f_curl_multi_add_handle(mh, c2.toResource()); VS(f_curl_multi_select(mh), 0); return Count(true); } bool TestExtCurl::test_curl_multi_getcontent() { - Object mh = f_curl_multi_init(); + Resource mh = f_curl_multi_init(); Variant c1 = f_curl_init(String(get_request_uri())); Variant c2 = f_curl_init(String(get_request_uri())); - f_curl_setopt(c1.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_setopt(c2.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_multi_add_handle(mh, c1.toObject()); - f_curl_multi_add_handle(mh, c2.toObject()); + f_curl_setopt(c1.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_setopt(c2.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_multi_add_handle(mh, c1.toResource()); + f_curl_multi_add_handle(mh, c2.toResource()); Variant still_running; do { f_curl_multi_exec(mh, ref(still_running)); } while (more(still_running, 0)); - VS(f_curl_multi_getcontent(c1.toObject()), "OK"); - VS(f_curl_multi_getcontent(c1.toObject()), "OK"); - VS(f_curl_multi_getcontent(c2.toObject()), "OK"); - VS(f_curl_multi_getcontent(c2.toObject()), "OK"); + VS(f_curl_multi_getcontent(c1.toResource()), "OK"); + VS(f_curl_multi_getcontent(c1.toResource()), "OK"); + VS(f_curl_multi_getcontent(c2.toResource()), "OK"); + VS(f_curl_multi_getcontent(c2.toResource()), "OK"); return Count(true); } bool TestExtCurl::test_curl_multi_info_read() { - Object mh = f_curl_multi_init(); + Resource mh = f_curl_multi_init(); Variant c1 = f_curl_init(String(get_request_uri())); Variant c2 = f_curl_init(String(get_request_uri())); - f_curl_setopt(c1.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_setopt(c2.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_multi_add_handle(mh, c1.toObject()); - f_curl_multi_add_handle(mh, c2.toObject()); + f_curl_setopt(c1.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_setopt(c2.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_multi_add_handle(mh, c1.toResource()); + f_curl_multi_add_handle(mh, c2.toResource()); Variant still_running; do { @@ -319,13 +319,13 @@ bool TestExtCurl::test_curl_multi_info_read() { } bool TestExtCurl::test_curl_multi_close() { - Object mh = f_curl_multi_init(); + Resource mh = f_curl_multi_init(); Variant c1 = f_curl_init(String(get_request_uri())); Variant c2 = f_curl_init(String(get_request_uri())); - f_curl_setopt(c1.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_setopt(c2.toObject(), k_CURLOPT_RETURNTRANSFER, true); - f_curl_multi_add_handle(mh, c1.toObject()); - f_curl_multi_add_handle(mh, c2.toObject()); + f_curl_setopt(c1.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_setopt(c2.toResource(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_multi_add_handle(mh, c1.toResource()); + f_curl_multi_add_handle(mh, c2.toResource()); Variant still_running; do { @@ -391,7 +391,7 @@ bool TestExtCurl::test_evhttp_post_gzip() { bool TestExtCurl::test_evhttp_async_get() { Variant ret = f_evhttp_async_get(String(get_request_uri()), CREATE_VECTOR1("ECHO: foo")); - ret = f_evhttp_recv(ret.toObject()); + ret = f_evhttp_recv(ret.toResource()); VS(ret[s_code], 200); VS(ret[s_response], "OK"); VS(ret[s_headers][0], "ECHOED: foo"); @@ -402,7 +402,7 @@ bool TestExtCurl::test_evhttp_async_get() { bool TestExtCurl::test_evhttp_async_post() { Variant ret = f_evhttp_async_post(String(get_request_uri()), "echo", CREATE_VECTOR1("ECHO: foo")); - ret = f_evhttp_recv(ret.toObject()); + ret = f_evhttp_recv(ret.toResource()); VS(ret[s_code], 200); VS(ret[s_response], "POST: echo"); VS(ret[s_headers][0], "ECHOED: foo"); diff --git a/hphp/test/ext/test_ext_server.cpp b/hphp/test/ext/test_ext_server.cpp index 099c08aef..d4886cf8d 100644 --- a/hphp/test/ext/test_ext_server.cpp +++ b/hphp/test/ext/test_ext_server.cpp @@ -82,13 +82,13 @@ bool TestExtServer::test_pagelet_server_task_result() { String baseheader("MyHeader: "); String basepost("postparam="); - std::vector tasks; + std::vector tasks; for (int i = 0; i < TEST_SIZE; ++i) { String url = baseurl + String(i); String header = baseheader + String(i); String post = basepost + String(i); - Object task = f_pagelet_server_task_start(url, CREATE_VECTOR1(header), - post); + Resource task = f_pagelet_server_task_start(url, CREATE_VECTOR1(header), + post); tasks.push_back(task); } @@ -155,7 +155,7 @@ bool TestExtServer::test_xbox_task_status() { } bool TestExtServer::test_xbox_task_result() { - Object task = f_xbox_task_start("hello"); + Resource task = f_xbox_task_start("hello"); f_xbox_task_status(task); Variant ret; VS(f_xbox_task_result(task, 0, ref(ret)), 200); diff --git a/hphp/test/ext/test_server.cpp b/hphp/test/ext/test_server.cpp index 0b6635c92..88bed64d6 100644 --- a/hphp/test/ext/test_server.cpp +++ b/hphp/test/ext/test_server.cpp @@ -86,20 +86,21 @@ bool TestServer::VerifyServerResponse(const char *input, const char **outputs, string err; for (int i = 0; i < 10; i++) { Variant c = f_curl_init(); - f_curl_setopt(c.toObject(), k_CURLOPT_URL, server); - f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true); + f_curl_setopt(c.toResource(), k_CURLOPT_URL, server); + f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true); if (postdata) { - f_curl_setopt(c.toObject(), k_CURLOPT_POSTFIELDS, postdata); - f_curl_setopt(c.toObject(), k_CURLOPT_POST, true); + f_curl_setopt(c.toResource(), k_CURLOPT_POSTFIELDS, postdata); + f_curl_setopt(c.toResource(), k_CURLOPT_POST, true); } if (header) { - f_curl_setopt(c.toObject(), k_CURLOPT_HTTPHEADER, CREATE_VECTOR1(header)); + f_curl_setopt(c.toResource(), k_CURLOPT_HTTPHEADER, + CREATE_VECTOR1(header)); } if (responseHeader) { - f_curl_setopt(c.toObject(), k_CURLOPT_HEADER, 1); + f_curl_setopt(c.toResource(), k_CURLOPT_HEADER, 1); } - Variant res = f_curl_exec(c.toObject()); + Variant res = f_curl_exec(c.toResource()); if (!same(res, false)) { actual = (std::string) res.toString(); break; @@ -166,9 +167,9 @@ void TestServer::StopServer() { String url = "http://"; url += f_php_uname("n"); url += ":" + lexical_cast(s_admin_port) + "/stop"; - f_curl_setopt(c.toObject(), k_CURLOPT_URL, url); - f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true); - Variant res = f_curl_exec(c.toObject()); + f_curl_setopt(c.toResource(), k_CURLOPT_URL, url); + f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true); + Variant res = f_curl_exec(c.toResource()); if (!same(res, false)) { break; } diff --git a/hphp/tools/bootstrap/idl.cpp b/hphp/tools/bootstrap/idl.cpp index b8ebe4b9c..beaacf4ce 100644 --- a/hphp/tools/bootstrap/idl.cpp +++ b/hphp/tools/bootstrap/idl.cpp @@ -217,6 +217,7 @@ static const std::unordered_map g_serializedDefaults = { {"null_string", "N;"}, {"null_array", "N;"}, {"null_object", "N;"}, + {"null_resource", "N;"}, {"null_variant", "N;"}, {"INT_MAX", "i:2147483647;"}, // (1 << 31) - 1 }; @@ -229,6 +230,7 @@ static const std::unordered_map g_phpDefaults = { {"null_string", "null"}, {"null_array", "null"}, {"null_object", "null"}, + {"null_resource", "null"}, {"null_variant", "null"}, {"INT_MAX", "null"}, }; @@ -566,7 +568,8 @@ bool PhpParam::defValueNeedsVariable() const { if ((cppKindOf == KindOfArray) && (defVal == "null_array")) { return false; } - if ((cppKindOf == KindOfObject) && (defVal == "null_object")) { + if ((cppKindOf == KindOfObject) && + (defVal == "null_object" || defVal == "null_resource")) { return false; } if ((cppKindOf == KindOfAny) && (defVal == "null_variant")) {