summaryrefslogtreecommitdiff
path: root/macosx/PluginList.m
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-01-10 20:46:32 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-01-10 20:46:32 +0000
commit7c6a7978c020b739e755c2bed56f91c5b7adf509 (patch)
tree618bfce436fcc3bb78722da2e7e2023616b0479f /macosx/PluginList.m
parente66ba25d49a90a20e2465cadeef8e2e83ce291bc (diff)
downloadpcsxr-7c6a7978c020b739e755c2bed56f91c5b7adf509.tar.gz
Use strlcpy on OS X code.
> Better handling of the net system on OS X. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@82182 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PluginList.m')
-rwxr-xr-xmacosx/PluginList.m33
1 files changed, 30 insertions, 3 deletions
diff --git a/macosx/PluginList.m b/macosx/PluginList.m
index 12c1054b..6fa341d9 100755
--- a/macosx/PluginList.m
+++ b/macosx/PluginList.m
@@ -101,7 +101,7 @@ const static int typeList[5] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD,
activeGpuPlugin = activeSpuPlugin = activeCdrPlugin = activePadPlugin = activeNetPlugin = nil;
missingPlugins = NO;
- for (i = 0; i < sizeof(*typeList); i++) {
+ for (i = 0; i < sizeof(typeList) / sizeof(typeList[0]); i++) {
NSString *path = [defaults stringForKey:[PcsxrPlugin defaultKeyForType:typeList[i]]];
if (nil == path) {
missingPlugins = YES;
@@ -121,7 +121,7 @@ const static int typeList[5] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD,
}
}
}
-
+
if (missingPlugins) {
[self refreshPlugins];
}
@@ -314,7 +314,7 @@ const static int typeList[5] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD,
const char *str;
if (plugin != nil) {
str = [[plugin path] fileSystemRepresentation];
- if (str == nil) {
+ if (str == NULL) {
str = "Invalid Plugin";
}
} else {
@@ -339,4 +339,31 @@ const static int typeList[5] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD,
return plugin != nil;
}
+- (void)disableNetPlug
+{
+ char **dst = [PcsxrPlugin configEntriesForType:PSE_LT_NET];
+ while (*dst) {
+ strcpy(*dst, "Disabled");
+ dst++;
+ }
+}
+
+- (void)enableNetPlug
+{
+ PcsxrPlugin *netPlug = [self activePluginForType:PSE_LT_NET];
+
+ const char *str = NULL;
+ if (netPlug) {
+ str = [[netPlug path] fileSystemRepresentation];
+ }
+ if (str) {
+ char **dst = [PcsxrPlugin configEntriesForType:PSE_LT_NET];
+ while (*dst) {
+ strlcpy(*dst, str, MAXPATHLEN);
+ dst++;
+ }
+ }
+
+}
+
@end