Main Page   File List   Globals  

launcherconfig.c File Reference

#include "launcherconfig.h"
#include <assert.h>

Go to the source code of this file.

Functions

LPLAUNCHERCONFIG createLauncherConfig ()
LPLAUNCHERCONFIG createLauncherConfigCopy (LPLAUNCHERCONFIG launcherConfig)
LPLAUNCHERCONFIG copyLauncherConfigToMemoryBlock (LPLAUNCHERCONFIG destinationConfiguration, LPLAUNCHERCONFIG launcherConfig)
void allocateMemberMemory (LPLAUNCHERCONFIG newLauncherConfig)
void releaseLauncherConfig (LPLAUNCHERCONFIG launcherConfig)
TCHAR * getMeSomeMemory (int size)
void giveTheMemoryBack (TCHAR *memoryBlock)
void setValue (TCHAR **member, TCHAR *value, int size)
void setName (LPLAUNCHERCONFIG launcherConfig, TCHAR *name, int size)
void setExecutablePath (LPLAUNCHERCONFIG launcherConfig, TCHAR *executablePath, int size)
void setWorkspacePath (LPLAUNCHERCONFIG launcherConfig, TCHAR *workspacePath, int size)
void setOptionalParameter (LPLAUNCHERCONFIG launcherConfig, TCHAR *optionalParameter, int size)
void setVMParameter (LPLAUNCHERCONFIG launcherConfig, TCHAR *vmParameter, int size)
void setJavaVM (LPLAUNCHERCONFIG launcherConfig, TCHAR *javaVM, int size)
TCHAR * getName (LPLAUNCHERCONFIG launcherConfig)
TCHAR * getExecutablePath (LPLAUNCHERCONFIG launcherConfig)
TCHAR * getWorkspacePath (LPLAUNCHERCONFIG launcherConfig)
TCHAR * getOptionalParameter (LPLAUNCHERCONFIG launcherConfig)
TCHAR * getVMParameter (LPLAUNCHERCONFIG launcherConfig)
TCHAR * getJavaVM (LPLAUNCHERCONFIG launcherConfig)


Function Documentation

void allocateMemberMemory LPLAUNCHERCONFIG    newLauncherConfig
 

Definition at line 77 of file launcherconfig.c.

Referenced by copyLauncherConfigToMemoryBlock(), and createLauncherConfig().

00078 {
00079     assert(newLauncherConfig != NULL);
00080     
00081     newLauncherConfig->name                 = (TCHAR*)malloc(MAX_STRING_LENGTH);
00082     newLauncherConfig->executablePath       = (TCHAR*)malloc(MAX_STRING_LENGTH);
00083     newLauncherConfig->optionalParams       = (TCHAR*)malloc(MAX_STRING_LENGTH);
00084     newLauncherConfig->workspacePath        = (TCHAR*)malloc(MAX_STRING_LENGTH);
00085     newLauncherConfig->vmParamter           = (TCHAR*)malloc(MAX_STRING_LENGTH);
00086     newLauncherConfig->javaVM               = (TCHAR*)malloc(MAX_STRING_LENGTH);
00087     newLauncherConfig->isCurrentlyRunning   = FALSE;
00088 
00089     ZeroMemory(newLauncherConfig->name, MAX_STRING_LENGTH);
00090     ZeroMemory(newLauncherConfig->executablePath, MAX_STRING_LENGTH);
00091     ZeroMemory(newLauncherConfig->optionalParams, MAX_STRING_LENGTH);
00092     ZeroMemory(newLauncherConfig->workspacePath, MAX_STRING_LENGTH);
00093     ZeroMemory(newLauncherConfig->vmParamter, MAX_STRING_LENGTH);
00094     ZeroMemory(newLauncherConfig->javaVM, MAX_STRING_LENGTH);
00095 }

LPLAUNCHERCONFIG copyLauncherConfigToMemoryBlock LPLAUNCHERCONFIG    destinationConfiguration,
LPLAUNCHERCONFIG    launcherConfig
 

Definition at line 53 of file launcherconfig.c.

References allocateMemberMemory().

Referenced by createLauncherConfigCopy(), and OnCopyToClipboard().

00054 {
00055     assert(destinationConfiguration != NULL);
00056     assert(launcherConfig != NULL);
00057 
00058     allocateMemberMemory(destinationConfiguration);
00059     
00060     lstrcpyn(destinationConfiguration->name,            launcherConfig->name, MAX_STRING_LENGTH);
00061     lstrcpyn(destinationConfiguration->executablePath,  launcherConfig->executablePath, MAX_STRING_LENGTH);
00062     lstrcpyn(destinationConfiguration->optionalParams,  launcherConfig->optionalParams, MAX_STRING_LENGTH);
00063     lstrcpyn(destinationConfiguration->workspacePath,   launcherConfig->workspacePath, MAX_STRING_LENGTH);
00064     lstrcpyn(destinationConfiguration->vmParamter,      launcherConfig->vmParamter, MAX_STRING_LENGTH);
00065     lstrcpyn(destinationConfiguration->javaVM,          launcherConfig->javaVM, MAX_STRING_LENGTH);
00066     destinationConfiguration->isCurrentlyRunning = launcherConfig->isCurrentlyRunning;
00067 
00068     return destinationConfiguration;
00069 }

LPLAUNCHERCONFIG createLauncherConfig  
 

Definition at line 20 of file launcherconfig.c.

References allocateMemberMemory().

Referenced by addNewConfigurationToListbox(), createLauncherConfigCopy(), loadConfiguration(), and setPath().

00021 {
00022     LPLAUNCHERCONFIG newLauncherConfig = (LPLAUNCHERCONFIG)malloc(sizeof(struct LAUNCHERCONFIG));
00023 
00024     memset(newLauncherConfig, 0, sizeof(LCONFIG));
00025     allocateMemberMemory(newLauncherConfig);
00026 
00027     return newLauncherConfig;
00028 }

LPLAUNCHERCONFIG createLauncherConfigCopy LPLAUNCHERCONFIG    launcherConfig
 

Definition at line 36 of file launcherconfig.c.

References copyLauncherConfigToMemoryBlock(), and createLauncherConfig().

Referenced by OnDuplicateLaunchConfiguration(), and OnPasteFromClipboard().

00037 {
00038     LPLAUNCHERCONFIG newLauncherConfig;
00039 
00040     assert(launcherConfig != NULL);
00041 
00042     newLauncherConfig = createLauncherConfig();
00043 
00044     return copyLauncherConfigToMemoryBlock(newLauncherConfig, launcherConfig);
00045 }

TCHAR* getExecutablePath LPLAUNCHERCONFIG    launcherConfig
 

Definition at line 195 of file launcherconfig.c.

Referenced by addNewConfigurationToListbox(), executeLaunchConfiguration(), HandleEditConfigurationDialogProc(), MainDialogWindowProc(), and saveConfiguration().

00196 {
00197     assert(launcherConfig != NULL);
00198 
00199     return (launcherConfig->executablePath);
00200 }

TCHAR* getJavaVM LPLAUNCHERCONFIG    launcherConfig
 

Definition at line 223 of file launcherconfig.c.

Referenced by addNewConfigurationToListbox(), executeLaunchConfiguration(), HandleEditConfigurationDialogProc(), MainDialogWindowProc(), saveConfiguration(), and setColumnValues().

00224 {
00225     assert(launcherConfig != NULL);
00226 
00227     return (launcherConfig->javaVM);
00228 }

TCHAR* getMeSomeMemory int    size
 

Definition at line 115 of file launcherconfig.c.

Referenced by setValue().

00116 {
00117     TCHAR* buffer;
00118 
00119     assert(size != 0);
00120 
00121     buffer = (TCHAR*)malloc(size);
00122 
00123     return(buffer);
00124 }

TCHAR* getName LPLAUNCHERCONFIG    launcherConfig
 

Definition at line 188 of file launcherconfig.c.

Referenced by addLauchnerConfigToList(), addNewConfigurationToListbox(), HandleEditConfigurationDialogProc(), MainDialogWindowProc(), OnDeleteConfiguration(), OnDuplicateLaunchConfiguration(), OnRightButtonDown(), saveConfiguration(), and updateLauchnerConfig().

00189 {
00190     assert(launcherConfig != NULL);
00191 
00192     return (launcherConfig->name);
00193 }

TCHAR* getOptionalParameter LPLAUNCHERCONFIG    launcherConfig
 

Definition at line 209 of file launcherconfig.c.

Referenced by addNewConfigurationToListbox(), executeLaunchConfiguration(), HandleEditConfigurationDialogProc(), MainDialogWindowProc(), and saveConfiguration().

00210 {
00211     assert(launcherConfig != NULL);
00212 
00213     return (launcherConfig->optionalParams);
00214 }

TCHAR* getVMParameter LPLAUNCHERCONFIG    launcherConfig
 

Definition at line 216 of file launcherconfig.c.

Referenced by addNewConfigurationToListbox(), executeLaunchConfiguration(), HandleEditConfigurationDialogProc(), MainDialogWindowProc(), saveConfiguration(), and setColumnValues().

00217 {
00218     assert(launcherConfig != NULL);
00219 
00220     return (launcherConfig->vmParamter);
00221 }

TCHAR* getWorkspacePath LPLAUNCHERCONFIG    launcherConfig
 

Definition at line 202 of file launcherconfig.c.

Referenced by addNewConfigurationToListbox(), executeLaunchConfiguration(), HandleEditConfigurationDialogProc(), MainDialogWindowProc(), saveConfiguration(), and setColumnValues().

00203 {
00204     assert(launcherConfig != NULL);
00205 
00206     return (launcherConfig->workspacePath);
00207 }

void giveTheMemoryBack TCHAR *    memoryBlock
 

Definition at line 126 of file launcherconfig.c.

Referenced by setValue().

00127 {
00128     assert(memoryBlock != NULL);
00129 
00130     free(memoryBlock);
00131 }

void releaseLauncherConfig LPLAUNCHERCONFIG    launcherConfig
 

Definition at line 103 of file launcherconfig.c.

Referenced by disposeAllConfigurations(), and OnDeleteConfiguration().

00104 {
00105     free(launcherConfig->name);
00106     free(launcherConfig->executablePath);
00107     free(launcherConfig->optionalParams);
00108     free(launcherConfig->workspacePath);
00109     free(launcherConfig->vmParamter);
00110     free(launcherConfig->javaVM);
00111 
00112     free(launcherConfig);
00113 }

void setExecutablePath LPLAUNCHERCONFIG    launcherConfig,
TCHAR *    executablePath,
int    size
 

Definition at line 158 of file launcherconfig.c.

References setValue().

Referenced by loadConfiguration().

00159 {
00160     assert(launcherConfig != NULL);
00161     setValue(&(launcherConfig->executablePath), executablePath, size);
00162 }

void setJavaVM LPLAUNCHERCONFIG    launcherConfig,
TCHAR *    javaVM,
int    size
 

Definition at line 182 of file launcherconfig.c.

References setValue().

Referenced by loadConfiguration().

00183 {
00184     assert(launcherConfig != NULL);
00185     setValue(&(launcherConfig->javaVM), javaVM, size);
00186 }

void setName LPLAUNCHERCONFIG    launcherConfig,
TCHAR *    name,
int    size
 

Definition at line 152 of file launcherconfig.c.

References setValue().

Referenced by loadConfiguration(), MainDialogWindowProc(), and OnDuplicateLaunchConfiguration().

00153 {
00154     assert(launcherConfig != NULL);
00155     setValue(&(launcherConfig->name), name, size);
00156 }

void setOptionalParameter LPLAUNCHERCONFIG    launcherConfig,
TCHAR *    optionalParameter,
int    size
 

Definition at line 170 of file launcherconfig.c.

References setValue().

Referenced by loadConfiguration().

00171 {
00172     assert(launcherConfig != NULL);
00173     setValue(&(launcherConfig->optionalParams), optionalParameter, size);
00174 }

void setValue TCHAR **    member,
TCHAR *    value,
int    size
 

Definition at line 133 of file launcherconfig.c.

References getMeSomeMemory(), and giveTheMemoryBack().

Referenced by setExecutablePath(), setJavaVM(), setName(), setOptionalParameter(), setVMParameter(), and setWorkspacePath().

00134 {
00135     assert(value != NULL);
00136     assert(size != 0);
00137 
00138     if(*member == NULL)
00139     {
00140         *member = getMeSomeMemory(size);
00141     }
00142 
00143     if(lstrlen(*member) < size)
00144     {
00145         giveTheMemoryBack(*member);
00146         *member = getMeSomeMemory(size);
00147     }
00148 
00149     lstrcpyn(*member, value, size);
00150 }

void setVMParameter LPLAUNCHERCONFIG    launcherConfig,
TCHAR *    vmParameter,
int    size
 

Definition at line 176 of file launcherconfig.c.

References setValue().

Referenced by loadConfiguration().

00177 {
00178     assert(launcherConfig != NULL);
00179     setValue(&(launcherConfig->vmParamter), vmParameter, size);
00180 }

void setWorkspacePath LPLAUNCHERCONFIG    launcherConfig,
TCHAR *    workspacePath,
int    size
 

Definition at line 164 of file launcherconfig.c.

References setValue().

Referenced by loadConfiguration().

00165 {
00166     assert(launcherConfig != NULL);
00167     setValue(&(launcherConfig->workspacePath), workspacePath, size);
00168 }


Generated on Sun Apr 6 13:49:03 2003 for EclipseLauncher by doxygen1.2.17