Detailed information is supplied for the following aspects of preferences functions:
Teamcenter makes use of this mechanism itself, and it also provides ITK level functions for programmers to make use of the same preference mechanism.
Programmers can define their own preference codes if they wish, or they can read and write to existing Teamcenter preferences.
If you intend to add new preference codes, we suggest that you prefix them with your company name, thus ensuring that they will not conflict with any preference codes that Teamcenter may implement in the future.
To use these functions, include preferences.h.
typedef enum PREF_import_actions_e PREF_import_actions_t |
typedef struct PREF_preference_context_values_t * PREF_preference_context_values_p_t |
typedef struct PREF_preference_definition_t * PREF_preference_definition_p_t |
typedef struct PREF_preference_object_t * PREF_preference_object_p_t |
typedef enum PREF_preference_type_e PREF_preference_type_t |
typedef enum TC_preference_search_scope_e TC_preference_search_scope_t |
Different actions that can be specified during an import operation, in case of conflict.
Definition at line 76 of file preferences.h.
Defines the supported preference types
Definition at line 86 of file preferences.h.
Defines different values that can be used as protection scopes or value locations.
Definition at line 61 of file preferences.h.
TC_API int PREF_ask_char_value | ( | const char * | preference_name, | |
int | index, | |||
char ** | value | |||
) |
Asks the value of a preference whose data type is char. Index is used to determine which value to retrieve if the preference has multiple values. Index starts at 0.
preference_name | (I) The name of the preference |
index | (I) The index of the value to retrieve |
value | (OF) The returned value |
TC_API int PREF_ask_char_value_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int | index, | |||
char ** | value | |||
) |
Asks the value of a preference whose data type is char at a specific level.
Index is used to determine which value to retrieve if the preference has multiple values. Index starts at 0.
Valid values for the location are TC_preference_user , TC_preference_role , TC_preference_group , TC_preference_site and TC_preference_overlay_location.
The value TC_preference_site applies also to System preferences.
The function returns:
preference_name | (I) The name of the preference |
location | (I) The location where to retrieve the value |
index | (I) The index at which to retrieve the value |
value | (OF) The returned value |
TC_API int PREF_ask_char_values | ( | const char * | preference_name, | |
int * | count, | |||
char *** | value | |||
) |
Asks all the values of the preference whose data type is char.
Note: This ITK returns values array in packed format.
Do not use SM_free on the returned elements and then SM_free on the container.
Do not use TC_free_strings on the container.
The proper way to release the allocated memory is by using SM_free on the container alone
preference_name | (I) Preference name |
count | (O) Number of values in the value array |
value | (OF) count Array of returned values |
TC_API int PREF_ask_char_values_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int * | count, | |||
char *** | values | |||
) |
Asks all the values of the preference whose data type is char.
Valid values for the location are TC_preference_user , TC_preference_role , TC_preference_group , and TC_preference_site.
The value TC_preference_site applies also to System preferences.
The function returns:
Note: This ITK returns values array in packed format.
Do not use SM_free on the returned elements and then SM_free on the container.
Do not use TC_free_strings on the container.
The proper way to release the allocated memory is by using SM_free on the container alone
preference_name | (I) The name of the preference |
location | (I) The location where to retrieve the values |
count | (O) The number of values in the value array |
values | (OF) count The array of values |
TC_API int PREF_ask_double_value | ( | const char * | preference_name, | |
int | index, | |||
double * | value | |||
) |
Asks the value of a preference whose data type is double.
Index is used to determine which value to retrieve if the preference has multiple values. Index starts at 0.
preference_name | (I) The name of the preference |
index | (I) The index of the value to retrieve |
value | (O) |
TC_API int PREF_ask_double_value_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int | index, | |||
double * | value | |||
) |
Asks the value of a preference whose data type is double at a given location.
Index is used to determine which value to retrieve if the preference has multiple values. Index starts at 0.
Valid values for the location are TC_preference_user, TC_preference_role, TC_preference_group, TC_preference_site and TC_preference_overlay_location.
The value TC_preference_site applies also to System preferences.
The function returns:
preference_name | (I) The name of the preference |
location | (I) The location where to retrieve the value |
index | (I) The index of the value to retrieve |
value | (O) The returned value |
TC_API int PREF_ask_double_values | ( | const char * | preference_name, | |
int * | value_count, | |||
double ** | values | |||
) |
Asks all the values of the preference whose data type is double.
preference_name | (I) Preference name |
value_count | (O) Number of values in the value array |
values | (OF) value_count Array of returned values |
TC_API int PREF_ask_double_values_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int * | value_count, | |||
double ** | values | |||
) |
Asks all the values of the preference whose data type is double at the specified location.
Valid values for the location are TC_preference_user, TC_preference_role, TC_preference_group, and TC_preference_site.
The value TC_preference_site applies also to System preferences.
The function returns:
preference_name | (I) The name of the preference |
location | (I) The location where to retrieve the values |
value_count | (O) The number of values in the value array |
values | (OF) value_count The array of values |
TC_API int PREF_ask_environment_set_flag | ( | const char * | preference_name, | |
logical * | flag | |||
) |
Asks the flag that authorizes a preference value to come from an environment variable.
The function returns:
preference_name | (I) The name of the preference |
flag | (O) The status for the environment set |
TC_API int PREF_ask_environment_set_flags | ( | int | preference_count, | |
const char ** | preference_names, | |||
logical ** | flags | |||
) |
Asks the flags that authorize preference values to come from an environment variable.
The function returns:
preference_count | (I) The number of preferences |
preference_names | (I) The array of preference names |
flags | (OF) preference_count The array of statuses for the environment set |
TC_API int PREF_ask_int_value | ( | const char * | preference_name, | |
int | index, | |||
int * | value | |||
) |
Asks the value of a preference whose data type is integer.
Index is used to determine which value to retrieve if the preference has multiple values. Index starts at 0.
preference_name | (I) The name of the preference |
index | (I) The index of the value to retrieve |
value | (O) The value |
TC_API int PREF_ask_int_value_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int | index, | |||
int * | value | |||
) |
Asks the value of a preference whose data type is integer at a given location.
Index is used to determine which value to retrieve if the preference has multiple values. Index starts at 0.
Valid values for the location are TC_preference_user, TC_preference_role, TC_preference_group, TC_preference_site and TC_preference_overlay_location.
The value TC_preference_site applies also to System preferences.
The function returns:
preference_name | (I) The name of the preference |
location | (I) The location where to retrieve the value |
index | (I) The index of the value requested |
value | (O) The returned value |
TC_API int PREF_ask_int_values | ( | const char * | preference_name, | |
int * | value_count, | |||
int ** | values | |||
) |
Asks all the values of the preference whose data type is integer.
preference_name | (I) Preference name |
value_count | (O) Number of values in the value array |
values | (OF) value_count Array of returned values |
TC_API int PREF_ask_int_values_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int * | value_count, | |||
int ** | values | |||
) |
Asks all the values of the preference whose data type is integer at the specified location.
Valid values for the location are TC_preference_user, TC_preference_role, TC_preference_group, and TC_preference_site.
The value TC_preference_site applies also to System preferences.
The function returns:
preference_name | (I) The name of the preference |
location | (I) The location where to retrieve the values |
value_count | (O) The number of values in the value array |
values | (OF) value_count The array of values |
TC_API int PREF_ask_logical_value | ( | const char * | preference_name, | |
int | index, | |||
logical * | value | |||
) |
Asks the value of a preference whose data type is logical.
Index is used to determine which value to retrieve if the preference has multiple values. Index starts at 0.
The function returns:
Important: The value is returned as specified at the first possible location starting at the location equal to the protectionScope of the preference.
preference_name | (I) The name of the preference |
index | (I) The index of the value to retrieve |
value | (O) The value |
TC_API int PREF_ask_logical_value_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int | index, | |||
logical * | value | |||
) |
Asks the value of a preference whose data type is logical at the specified location.
Index is used to determine which value to retrieve if the preference has multiple values. Index starts at 0.
Valid values for the location are TC_preference_user, TC_preference_role, TC_preference_group, TC_preference_site and TC_preference_overlay_location.
The value TC_preference_site applies also to System preferences.
The function returns:
preference_name | (I) The name of the preference |
location | (I) The location where to retrieve the value |
index | (I) The index of the value to retrieve |
value | (O) The returned value |
TC_API int PREF_ask_logical_values | ( | const char * | preference_name, | |
int * | value_count, | |||
logical ** | values | |||
) |
Asks all the values of the preference whose data type is logical.
The function returns:
Important:The value is returned as specified at the first possible location starting at the location equal to the protectionScope of the preference.
preference_name | (I) Preference name |
value_count | (O) Number of values in the value array |
values | (OF) value_count Array of returned values |
TC_API int PREF_ask_logical_values_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int * | value_count, | |||
logical ** | values | |||
) |
Asks the value of a preference whose data type is logical at the specified location.
Index is used to determine which value to retrieve if the preference has multiple values. Index starts at 0.
Valid values for the location are TC_preference_user, TC_preference_role, TC_preference_group, TC_preference_site and TC_preference_overlay_location.
The value TC_preference_site applies also to System preferences.
The function returns:
preference_name | (I) The name of the preference |
location | (I) The location where to retrieve the values |
value_count | (O) The number of values in the array |
values | (OF) value_count The array of values |
TC_API int PREF_ask_protection_scope | ( | const char * | preference_name, | |
TC_preference_search_scope_t * | protection_scope | |||
) |
Asks the protection scope for a given preference.
Possible returned values are TC_preference_user, TC_preference_role, TC_preference_group, TC_preference_site and TC_preference_system.
The function returns:
preference_name | (I) The name of the preference |
protection_scope | (O) The protection scope of the preference |
TC_API int PREF_ask_protection_scopes | ( | int | preference_count, | |
const char ** | preference_names, | |||
TC_preference_search_scope_t ** | protection_scopes | |||
) |
Asks the protection scope for several given preferences.
Possible returned values are TC_preference_user, TC_preference_role, TC_preference_group, TC_preference_site and TC_preference_system.
The function returns:
preference_count | (I) The number of preferences |
preference_names | (I) The array of preference names |
protection_scopes | (OF) preference_count The array of protection scopes for the preferences |
TC_API int PREF_ask_search_scope | ( | TC_preference_search_scope_t * | scope | ) |
Asks which preferences the system is considering when you ask for values.
scope | (O) |
TC_API int PREF_ask_value_count | ( | const char * | preference_name, | |
int * | value_count | |||
) |
Returns the number of values that exist for a particular preference name.
If the preference is not defined at all, returns a 0.
preference_name | (I) The name of the preference |
value_count | (O) The number of values |
TC_API int PREF_ask_value_count_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int * | value_count | |||
) |
Returns the number of values that exist for a particular preference name at a specific level.
If the preference does not have an instance at the given location, the returned value count is 0.
Valid values for the location are TC_preference_user , TC_preference_role , TC_preference_group, and TC_preference_site.
The value TC_preference_site applies also to System preferences.
The function returns:
preference_name | (I) The number of preferences |
location | (I) The location where to look for the preference |
value_count | (O) The number of values at the location |
TC_API int PREF_delete_definition | ( | int | nb_of_preferences, | |
const char ** | preference_names, | |||
logical | delete_all_custom_definitions | |||
) |
Deletes the customization made to the definition of the specified preferences.
If the intent is to delete the value, use PREF_delete_preference or PREF_delete_preference_at_location ITKs instead.
If the call is made with the deleteAllCustomDefinition flag set to true, then it is assumed that all custom definitions will be removed.
A custom definition is:
The preference definition will be removed, but the preference instances will not. Use the preferences_manager utility in "cleanup" mode in order to do that.
The function returns:
nb_of_preferences | (I) The number of preference definition to delete. |
preference_names | (I) The name of the preferences. |
delete_all_custom_definitions | (I) If set to true, indicates to delete all the custom definitions. The nbOfPreferences will need to be set to 0, and the pointer preference_names will need to be a null pointer. |
TC_API int PREF_delete_non_session_preference | ( | char * | preference_name, | |
tag_t | object | |||
) |
Deletes the specified preference instance from the specified location.
The location can be any location for which the logged-in user has privileges.
If an error is encountered during the deletion of any preference, the rest of the list will be skipped.
preference_name | (I) Name of the preference which instance is to be deleted |
object | (I) User, Role or Group tag |
TC_API int PREF_delete_preference | ( | const char * | preference_name | ) |
Deletes the specified preference instance from the location that matches the preference protection scope.
Restrictions:
If the preference being deleted is a site-protected preference, the logged-in user must have system administrative privileges.
If the preference being deleted is a group/role-protected preference, the logged-in user must have at least group administrative privileges.
preference_name | (I) Name of the preference which instance is to be deleted. |
TC_API int PREF_delete_preference_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location | |||
) |
Deletes the specified preference instance from the specified location.
The location are the ones as seen from the logged-in user.
Valid values for the location are TC_preference_user, TC_preference_role, TC_preference_group, and TC_preference_site.
If the preference being deleted is a site-protected preference, the logged-in user must have system administrative privileges.
If the preference being deleted is a group/role-protected preference, the logged-in user must have at least group administrative privileges.
The function returns:
preference_name | (I) Name of the preference which instance is to be deleted |
location | (I) The location where to delete the preference instance |
TC_API int PREF_export_preference_list | ( | int | preference_count, | |
char ** | preference_names, | |||
TC_preference_search_scope_t | location, | |||
const char * | output_file_name | |||
) |
Exports the specified preferences from the specified location to the specified output file.
Nothing will be exported if the named preferences are not found under the specified location.
The possible values for the location parameter are:
TC_preference_user | Exports the specified preferences from the user location. |
TC_preference_role | Exports the specified preferences from the user location. |
TC_preference_group | Exports the specified preferences from the group location. |
TC_preference_site | Exports the specified preferences from the site location. |
The user/role/group are the ones for the current logged-in user.
preference_count | (I) Number of preferences to export |
preference_names | (I) Name of the preferences to export |
location | (I) Location of the preferences to export |
output_file_name | (I) Output export file name |
TC_API int PREF_export_preferences | ( | TC_preference_search_scope_t | location, | |
const char * | output_file_name | |||
) |
Exports all the preferences at the specified location to the specified output file.
Nothing will be exported if there are no preferences under the specified scope.
(For e.x. if the scope is specified as TC_preference_user, all the user preferences for the current logged in user would be exported.)
The possible values for the location parameter are:
TC_preference_user | Exports all the preferences at the user location. |
TC_preference_role | Exports all the preferences at the user location. |
TC_preference_group | Exports all the preferences at the group location. |
TC_preference_site | Exports all the preferences at the site location. |
The user/role/group are the ones for the current logged-in user.
location | (I) Location to be considered for export |
output_file_name | (I) Output export file name |
TC_API int PREF_export_preferences_with_category | ( | TC_preference_search_scope_t | location, | |
int | number_of_categories, | |||
char ** | categories, | |||
const char * | output_file_name | |||
) |
Exports all the preferences belonging to the specified categories from the specified location scope to the specified output file.
Nothing will be exported if there are no preferences matching the criteria at the specified location.
E.g. if the specified location is TC_preference_user, all the user preferences for the current logged-in user will be exported.
The possible values for the location parameter are:
TC_preference_user | Exports all the preferences at the user location. |
TC_preference_role | Exports all the preferences at the role location. |
TC_preference_group | Exports all the preferences at the group location. |
TC_preference_site | Exports all the preferences at the site location. |
location | (I) Location to be considered for export |
number_of_categories | (I) Number of categories |
categories | (I) Categories to be considered for export |
output_file_name | (I) Output export file name |
TC_API int PREF_import_preferences | ( | TC_preference_search_scope_t | location, | |
const char * | input_xml, | |||
PREF_import_actions_t | action | |||
) |
Imports all the preferences in the specified xml file at the specified location.
The possible values for the location parameter are:
TC_preference_user | Imports the preferences in the xml file at the user location. |
TC_preference_role | Imports the preferences in the xml file at the role location. |
TC_preference_group | Imports the preferences in the xml file at the group location. |
TC_preference_site | Imports the preferences in the xml file at the site location. |
The action parameter specifies the action to be taken in the event of a preference existing in the database. The possible values for the action parameter are:
PREF_import_action_skip | Skips the preference and does not do any further processing for this preference. |
PREF_import_action_override | Overrides the values of the preference in the database with the values in the specified xml file. |
PREF_import_action_merge | Merges the values for the preference in the database with the values in the specified xml file. This merge is a simple union of the values in the database and the xml file. |
Restrictions:
If the specified location TC_preference_site, the logged-in user must have system administrative privileges.
If the specified location is TC_preference_group or TC_preference_role, the logged-in user must have at least group administrative privileges.
location | (I) Location where to import the preferences |
input_xml | (I) Path to the input XML file name |
action | (I) Action to be considered in the event of conflict with the information already present in the database |
TC_API int PREF_import_preferences_with_category | ( | TC_preference_search_scope_t | location, | |
const char * | input_xml, | |||
int | number_of_categories, | |||
char ** | category_names, | |||
PREF_import_actions_t | action | |||
) |
Imports the preferences in the specified xml file, only from the specified categories, and into the specified location.
The possible values for the location parameter are:
TC_preference_user | Imports the preferences in the xml file at the user location. |
TC_preference_role | Imports the preferences in the xml file at the role location. |
TC_preference_group | Imports the preferences in the xml file at the group location. |
TC_preference_site | Imports the preferences in the xml file at the site location. |
The action parameter specifies the action to be taken in the event of a preference existing in the database. The possible values for the action parameter are:
PREF_import_action_skip | Skips the preference and does not do any further processing for this preference. |
PREF_import_action_override | Overrides the values of the preference in the database with the values in the specified xml file. |
PREF_import_action_merge | Merges the values for the preference in the database with the values in the specified xml file. This merge is a simple union of the values in the database and the xml file. |
Restrictions:
If the specified location is TC_preference_site, the logged-in user must have system administrative privileges.
If the specified location is TC_preference_group or TC_preference_role, the logged-in user must have at least group administrative privileges.
location | (I) Location where to import the preferences |
input_xml | (I) Path to the input XML file name |
number_of_categories | (I) Number of categories given as input |
category_names | (I) Categories to be considered for import |
action | (I) Action to be considered in the event of conflict with the information already present in the database |
TC_API int PREF_initialize | ( | void | ) |
Loads all of the values from the preference files.
TC_API int PREF_lock_site_preferences | ( | ) |
Locks site preferences. Use this to have exclusive modification privileges to site preferences. Once the modifications are done, use PREF_unlock_site_preferences() to unlock.
Restrictions: The logged-in user must have site administrative privileges.
TC_API int PREF_refresh | ( | const char * | preference_name | ) |
Refreshes those parts of the current Teamcenter session (if there is one) whose state depends on the value of the named preference. (Use of PREF_set_xxx functions alone affects only future sessions; subsequent use of this function affects the current session also.)
Restrictions: This function is currently only supported for the following preferences:
WS_Menu_Entry_Suppression
PSE_Menu_Entry_Suppression
preference_name | (I) Name of preference to refresh |
TC_API int PREF_reinitialize | ( | ) |
Re-reads any appropriate preference files to reflect updates from outside the session
TC_API int PREF_set_char_values | ( | const char * | preference_name, | |
int | value_count, | |||
char * | values[] | |||
) |
Sets the value(s) of a preference whose data type is char.
preference_name | (I) The name of the preference |
value_count | (I) The number of values |
values | (I) value_count The array of values |
TC_API int PREF_set_char_values_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int | value_count, | |||
char * | values[] | |||
) |
Sets the value(s) of a preference whose data type is char at a specific level.
Valid values for the locations are TC_preference_user , TC_preference_role , TC_preference_group , and TC_preference_site.
The value TC_preference_site applies also to System preferences.
The function returns:
Important: If the preference does not exist, no error. Instead the preference will be created.
The value of the "location" argument will also become the protection scope.
However, the system will match what is possible:
preference_name | (I) The name of the preference |
location | (I) The location where to set the values |
value_count | (I) The number of values in the value array |
values | (I) The array of values |
TC_API int PREF_set_definition | ( | const char * | preference_name, | |
PREF_preference_object_t | preference_object, | |||
logical | env_variable_enabled | |||
) |
Creates or changes a preference according to a PREF_preference_object structure.
The function returns:
If the preference does not already exist in the database, all the declaration data will be needed, otherwise an error (as explained below) will be returned.
In the input structure:
preference_name | (I) The name of the preference |
preference_object | (I) The preference object describing the preference to add |
env_variable_enabled | (I) Defines if the value for the given preference can come from the environment variable. |
TC_API int PREF_set_double_values | ( | const char * | preference_name, | |
int | value_count, | |||
double | values[] | |||
) |
Sets the value(s) of a preference whose data type is double. PREF_not_a_double_value, if one of the values is not a double.
preference_name | (I) The name of the preference |
value_count | (I) The number of values |
values | (I) value_count The array of values |
TC_API int PREF_set_double_values_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int | value_count, | |||
double | values[] | |||
) |
Sets the value(s) of a preference whose data type is double at a specific location.
Valid values for the location are TC_preference_user, TC_preference_role, TC_preference_group, and TC_preference_site.
The TC_preference_site applies also to System preferences.
The function returns:
Important: If the preference does not exist, no error,. Instead the preference will be created.
The value of the "location" argument will also become the protection scope.
However, the system will match what is possible:
preference_name | (I) The name of the preference |
location | (I) The location where to set the value |
value_count | (I) The number of values in the value array |
values | (I) The array of values |
TC_API int PREF_set_environment_set_flag | ( | const char * | preference_name, | |
logical | flag | |||
) |
Sets the flag that authorizes a preference value to come from an environment variable.
Valid values are true (allow) or false.
The function returns:
preference_name | (I) The name of the preference |
flag | (I) The status for the environment set |
TC_API int PREF_set_environment_set_flags | ( | int | preference_count, | |
const char ** | preference_names, | |||
const logical | flag[] | |||
) |
Sets the flag that authorizes preference values to come from an environment variable.
Valid values are true (allow) or false.
The function returns:
preference_count | (I) The number of preferences |
preference_names | (I) The array of preference names |
flag | (I) The array of statuses for the environment set |
TC_API int PREF_set_int_values | ( | const char * | preference_name, | |
int | value_count, | |||
int | values[] | |||
) |
Sets the value(s) of a preference whose data type is integer. PREF_not_a_int_value, if one of the values is not an integer.
preference_name | (I) The name of the preference |
value_count | (I) The number of values |
values | (I) value_count The array of values |
TC_API int PREF_set_int_values_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int | value_count, | |||
int | values[] | |||
) |
Sets the value(s) of a preference whose data type is integer at a specific location.
Valid values for the location are TC_preference_user, TC_preference_role, TC_preference_group, and TC_preference_site.
The value TC_preference_site applies also to System preferences.
The function returns:
Important: If the preference does not exist, no error,. Instead the preference will be created.
The value of the "location" argument will also become the protection scope.
However, the system will match what is possible:
preference_name | (I) The name of the preference |
location | (I) The location where to set the value |
value_count | (I) The number of values in the value array |
values | (I) The array of values |
TC_API int PREF_set_logical_value | ( | const char * | preference_name, | |
logical | value | |||
) |
Sets the value of a preference whose data type is logical
The function returns:
Important: The value is set at the location which is the protection scope if the preference definition exist or else a runtime definition is created
preference_name | (I) The name of the preference |
value | (I) The value |
TC_API int PREF_set_logical_values | ( | const char * | preference_name, | |
int | value_count, | |||
logical | values[] | |||
) |
Sets the values of a preference whose data type is logical
The function returns:
Important: The value is set at the location which is the protection scope if the preference definition exist or else a runtime definition is created
preference_name | (I) The name of the preference |
value_count | (I) The number of values in the array |
values | (I) The array of values |
TC_API int PREF_set_logical_values_at_location | ( | const char * | preference_name, | |
TC_preference_search_scope_t | location, | |||
int | value_count, | |||
logical | values[] | |||
) |
Sets the values of a preference whose data type is logical at the specified location.
Valid values for the location are TC_preference_user, TC_preference_role, TC_preference_group, and TC_preference_site.
The value TC_preference_site applies also to System preferences.
The function returns:
Important: If the preference does not exist, no error,. Instead the preference will be created. br>The value of the "location" argument will also become the protection scope.
However, the system will match what is possible:
preference_name | (I) The name of the preference |
location | (I) The location where to set the value |
value_count | (I) The number of values in the array |
values | (I) The array of values |
TC_API int PREF_set_protection_scope | ( | const char * | preference_name, | |
TC_preference_search_scope_t | protection_scope | |||
) |
Sets the protection scope for a given preference.
Valid values for the protection scope are TC_preference_user, TC_preference_role, TC_preference_group, TC_preference_site and TC_preference_system.
The TC_preference_system value is only to be used to convert a hierarchical preference to a System preference: this is only possible for non out-of-the-box preferences.
The function returns:
preference_name | (I) The name of the preference |
protection_scope | (I) The new protection scope |
TC_API int PREF_set_protection_scopes | ( | int | preference_count, | |
const char ** | preference_names, | |||
TC_preference_search_scope_t | protection_scopes[] | |||
) |
Sets the protection scope for several given preferences.
Valid values for the protection scopes are TC_preference_user, TC_preference_role, TC_preference_group, TC_preference_site and TC_preference_system.
The function returns:
preference_count | (I) The number of preferences |
preference_names | (I) The array of preference names |
protection_scopes | (I) The array of new protection scopes |
TC_API int PREF_set_search_scope | ( | TC_preference_search_scope_t | scope | ) |
Specifies which preferences you want to consider when asking for values. The possible values for this are:
TC_preference_all | All preferences. |
TC_preference_role | Role preferences. |
TC_preference_user | User preferences. |
TC_preference_group | Group preferences. |
TC_preference_site | Site preferences. |
scope | (I) |
TC_API int PREF_unlock_site_preferences | ( | ) |
Unlocks site preferences.
Restrictions: The logged-in user must have site administrative privileges.