#include "linden_common.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <curl/curl.h>
#include <pthread.h>
#include "llerror.h"
#include "lltimer.h"
#include "lldir.h"
#include "llfile.h"
#include "llstring.h"
#include <Carbon/Carbon.h>
#include "MoreFilesX.h"
#include "FSCopyObject.h"
Include dependency graph for mac_updater.cpp:
Go to the source code of this file.
Enumerations | |
enum | { kEventClassCustom = 'Cust', kEventCustomProgress = 'Prog', kEventParamCustomCurValue = 'Cur ', kEventParamCustomMaxValue = 'Max ', kEventParamCustomText = 'Text', kEventCustomDone = 'Done' } |
Functions | |
void * | updatethreadproc (void *) |
OSStatus | setProgress (int cur, int max) |
OSStatus | setProgressText (CFStringRef text) |
OSStatus | sendProgress (long cur, long max, CFStringRef text=NULL) |
OSStatus | sendDone (void) |
OSStatus | dialogHandler (EventHandlerCallRef handler, EventRef event, void *userdata) |
int | curl_progress_callback_func (void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) |
int | parse_args (int argc, char **argv) |
int | main (int argc, char **argv) |
bool | isDirWritable (FSRef &dir) |
static void | utf8str_to_HFSUniStr255 (HFSUniStr255 *dest, const char *src) |
static std::string | HFSUniStr255_to_utf8str (const HFSUniStr255 *src) |
int | restoreObject (const char *aside, const char *target, const char *path, const char *object) |
void | filterFile (const char *filename) |
static bool | isFSRefViewerBundle (FSRef *targetRef) |
static OSErr | findAppBundleOnDiskImage (FSRef *parent, FSRef *app) |
Variables | |
WindowRef | gWindow = NULL |
EventHandlerRef | gEventHandler = NULL |
OSStatus | gFailure = noErr |
Boolean | gCancelled = false |
char * | gUpdateURL |
char * | gProductName |
pthread_t | updatethread |
Copyright (c) 2006-2007, Linden Research, Inc.
Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlife.com/developers/opensource/gplv2
There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlife.com/developers/opensource/flossexception
By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.
ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$
Definition in file mac_updater.cpp.
anonymous enum |
kEventClassCustom | |
kEventCustomProgress | |
kEventParamCustomCurValue | |
kEventParamCustomMaxValue | |
kEventParamCustomText | |
kEventCustomDone |
Definition at line 53 of file mac_updater.cpp.
int curl_progress_callback_func | ( | void * | clientp, | |
double | dltotal, | |||
double | dlnow, | |||
double | ultotal, | |||
double | ulnow | |||
) |
Definition at line 308 of file mac_updater.cpp.
References gCancelled, and sendProgress().
Referenced by updatethreadproc().
OSStatus dialogHandler | ( | EventHandlerCallRef | handler, | |
EventRef | event, | |||
void * | userdata | |||
) |
Definition at line 239 of file mac_updater.cpp.
References gCancelled, gWindow, kEventClassCustom, kEventCustomDone, kEventCustomProgress, kEventParamCustomCurValue, kEventParamCustomMaxValue, kEventParamCustomText, NULL, setProgress(), setProgressText(), and void.
void filterFile | ( | const char * | filename | ) |
static OSErr findAppBundleOnDiskImage | ( | FSRef * | parent, | |
FSRef * | app | |||
) | [static] |
Definition at line 660 of file mac_updater.cpp.
References HFSUniStr255_to_utf8str(), isFSRefViewerBundle(), llendl, llinfos, NULL, and ref.
Referenced by updatethreadproc().
static std::string HFSUniStr255_to_utf8str | ( | const HFSUniStr255 * | src | ) | [static] |
Definition at line 551 of file mac_updater.cpp.
References utf16str_to_utf8str().
Referenced by findAppBundleOnDiskImage().
bool isDirWritable | ( | FSRef & | dir | ) |
Definition at line 491 of file mac_updater.cpp.
References FSGetUserPrivilegesPermissions(), llendl, llinfos, and NULL.
Referenced by updatethreadproc().
static bool isFSRefViewerBundle | ( | FSRef * | targetRef | ) | [static] |
Definition at line 606 of file mac_updater.cpp.
References llendl, llinfos, and NULL.
Referenced by findAppBundleOnDiskImage(), and updatethreadproc().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 343 of file mac_updater.cpp.
References dialogHandler(), gCancelled, gDirUtilp, gEventHandler, gFailure, gProductName, gUpdateURL, gWindow, LLDir::initAppDirs(), kEventClassCustom, kEventCustomDone, kEventCustomProgress, llendl, llinfos, NULL, params, parse_args(), updatethread, and updatethreadproc().
int parse_args | ( | int | argc, | |
char ** | argv | |||
) |
int restoreObject | ( | const char * | aside, | |
const char * | target, | |||
const char * | path, | |||
const char * | object | |||
) |
Definition at line 558 of file mac_updater.cpp.
References FSCopyObject(), kDupeActionReplace, llendl, llinfos, and NULL.
OSStatus sendDone | ( | void | ) |
Definition at line 201 of file mac_updater.cpp.
References gWindow, kEventClassCustom, kEventCustomDone, NULL, and target.
Referenced by updatethreadproc().
OSStatus sendProgress | ( | long | cur, | |
long | max, | |||
CFStringRef | text = NULL | |||
) |
Definition at line 130 of file mac_updater.cpp.
References gWindow, kEventClassCustom, kEventCustomProgress, kEventParamCustomCurValue, kEventParamCustomMaxValue, kEventParamCustomText, NULL, and target.
Referenced by curl_progress_callback_func(), and updatethreadproc().
OSStatus setProgress | ( | int | cur, | |
int | max | |||
) |
OSStatus setProgressText | ( | CFStringRef | text | ) |
Definition at line 723 of file mac_updater.cpp.
References curl_progress_callback_func(), LLDir::deleteFilesInDir(), findAppBundleOnDiskImage(), FSCopyObject(), FSDeleteObjects(), FSGetParentRef(), gCancelled, gDirUtilp, LLDir::getDirDelimiter(), LLDir::getExpandedFilename(), gFailure, gProductName, gUpdateURL, isDirWritable(), isFSRefViewerBundle(), kDupeActionStandard, LL_MAX_PATH, LL_PATH_CACHE, llendl, llinfos, mask, LLFile::mkdir(), NULL, s, sendDone(), sendProgress(), target, utf8str_to_HFSUniStr255(), and void.
Referenced by main().
static void utf8str_to_HFSUniStr255 | ( | HFSUniStr255 * | dest, | |
const char * | src | |||
) | [static] |
Definition at line 537 of file mac_updater.cpp.
References utf8str_to_utf16str().
Referenced by updatethreadproc().
Boolean gCancelled = false |
Definition at line 66 of file mac_updater.cpp.
Referenced by curl_progress_callback_func(), dialogHandler(), main(), and updatethreadproc().
EventHandlerRef gEventHandler = NULL |
Definition at line 64 of file mac_updater.cpp.
OSStatus gFailure = noErr |
char* gProductName |
Definition at line 69 of file mac_updater.cpp.
Referenced by filterFile(), main(), parse_args(), ProcessCaption(), ProcessDlgItemText(), updatethreadproc(), and WinMain().
char* gUpdateURL |
Definition at line 68 of file mac_updater.cpp.
Referenced by main(), parse_args(), updatethreadproc(), and WinMain().
WindowRef gWindow = NULL |
Definition at line 63 of file mac_updater.cpp.
pthread_t updatethread |