Commit dfe8df52 authored by Pierre Wieser's avatar Pierre Wieser

Validate api/

parent 1fa85bda
......@@ -92,7 +92,7 @@ typedef struct {
}
FMAIContextInterface;
GType fma_icontext_get_type( void );
GType fma_icontext_get_type ( void );
gboolean fma_icontext_are_equal ( const FMAIContext *a, const FMAIContext *b );
gboolean fma_icontext_is_candidate ( const FMAIContext *context, guint target, GList *selection );
......
......@@ -203,12 +203,12 @@ typedef struct {
* Deprecated: 3.2
*/
typedef struct {
guint version;
guint version;
FMAObjectItem *exported;
gchar *folder;
GQuark format;
gchar *basename;
GSList *messages;
gchar *folder;
GQuark format;
gchar *basename;
GSList *messages;
}
FMAIExporterFileParms;
......
......@@ -374,7 +374,7 @@ typedef struct {
* The I/O provider should implement this method, or return
* FALSE in is_willing_to_write() method above.
*
* Return value: FMA_IIO_PROVIDER_CODE_OK if the write operation
* Return value: IIO_PROVIDER_CODE_OK if the write operation
* was successful, or another code depending of the detected error.
*
* Since: 2.30
......@@ -393,7 +393,7 @@ typedef struct {
* The I/O provider should implement this method, or return
* FALSE in is_willing_to_write() method above.
*
* Return value: FMA_IIO_PROVIDER_CODE_OK if the delete operation was
* Return value: IIO_PROVIDER_CODE_OK if the delete operation was
* successful, or another code depending of the detected error.
*
* Since: 2.30
......@@ -418,7 +418,7 @@ typedef struct {
* the provider-specific data which may have been attached to
* the FMAObjectItem-derived object.
*
* Return value: FMA_IIO_PROVIDER_CODE_OK if the duplicate operation
* Return value: IIO_PROVIDER_CODE_OK if the duplicate operation
* was successful, or another code depending of the detected error.
*
* Since: 2.30
......@@ -432,17 +432,17 @@ typedef struct {
*/
/**
* FMAIIOProviderWritabilityStatus:
* @FMA_IIO_PROVIDER_STATUS_WRITABLE: item and i/o provider are writable.
* @FMA_IIO_PROVIDER_STATUS_UNAVAILABLE: unavailable i/o provider.
* @FMA_IIO_PROVIDER_STATUS_INCOMPLETE_API: i/o provider has an incomplete write api.
* @FMA_IIO_PROVIDER_STATUS_NOT_WILLING_TO: i/o provider is not willing to write.
* @FMA_IIO_PROVIDER_STATUS_NOT_ABLE_TO: i/o provider is not able to write.
* @FMA_IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN: i/o provider has been locked by the administrator.
* @FMA_IIO_PROVIDER_STATUS_LOCKED_BY_USER: i/o provider has been locked by the user.
* @FMA_IIO_PROVIDER_STATUS_ITEM_READONLY: item is read-only.
* @FMA_IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND: no writable i/o provider found.
* @FMA_IIO_PROVIDER_STATUS_LEVEL_ZERO: level zero is not writable.
* @FMA_IIO_PROVIDER_STATUS_UNDETERMINED: unknwon reason (and probably a bug).
* @IIO_PROVIDER_STATUS_WRITABLE: item and i/o provider are writable.
* @IIO_PROVIDER_STATUS_UNAVAILABLE: unavailable i/o provider.
* @IIO_PROVIDER_STATUS_INCOMPLETE_API: i/o provider has an incomplete write api.
* @IIO_PROVIDER_STATUS_NOT_WILLING_TO: i/o provider is not willing to write.
* @IIO_PROVIDER_STATUS_NOT_ABLE_TO: i/o provider is not able to write.
* @IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN: i/o provider has been locked by the administrator.
* @IIO_PROVIDER_STATUS_LOCKED_BY_USER: i/o provider has been locked by the user.
* @IIO_PROVIDER_STATUS_ITEM_READONLY: item is read-only.
* @IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND: no writable i/o provider found.
* @IIO_PROVIDER_STATUS_LEVEL_ZERO: level zero is not writable.
* @IIO_PROVIDER_STATUS_UNDETERMINED: unknwon reason (and probably a bug).
*
* The reasons for which an item may not be writable.
*
......@@ -450,19 +450,19 @@ typedef struct {
* Some are to be used only internally from &prodname; programs.
*/
typedef enum {
FMA_IIO_PROVIDER_STATUS_WRITABLE = 0,
FMA_IIO_PROVIDER_STATUS_UNAVAILABLE,
FMA_IIO_PROVIDER_STATUS_INCOMPLETE_API,
FMA_IIO_PROVIDER_STATUS_NOT_WILLING_TO,
FMA_IIO_PROVIDER_STATUS_NOT_ABLE_TO,
FMA_IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN,
FMA_IIO_PROVIDER_STATUS_LOCKED_BY_USER,
FMA_IIO_PROVIDER_STATUS_ITEM_READONLY,
FMA_IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND,
FMA_IIO_PROVIDER_STATUS_LEVEL_ZERO,
FMA_IIO_PROVIDER_STATUS_UNDETERMINED,
IIO_PROVIDER_STATUS_WRITABLE = 0,
IIO_PROVIDER_STATUS_UNAVAILABLE,
IIO_PROVIDER_STATUS_INCOMPLETE_API,
IIO_PROVIDER_STATUS_NOT_WILLING_TO,
IIO_PROVIDER_STATUS_NOT_ABLE_TO,
IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN,
IIO_PROVIDER_STATUS_LOCKED_BY_USER,
IIO_PROVIDER_STATUS_ITEM_READONLY,
IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND,
IIO_PROVIDER_STATUS_LEVEL_ZERO,
IIO_PROVIDER_STATUS_UNDETERMINED,
/*< private >*/
FMA_IIO_PROVIDER_STATUS_LAST,
IIO_PROVIDER_STATUS_LAST,
}
FMAIIOProviderWritabilityStatus;
......@@ -471,25 +471,25 @@ typedef enum {
*/
/**
* FMAIIOProviderOperationStatus:
* @FMA_IIO_PROVIDER_CODE_OK: the requested operation has been successful.
* @FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR: a program error has been detected;
* @IIO_PROVIDER_CODE_OK: the requested operation has been successful.
* @IIO_PROVIDER_CODE_PROGRAM_ERROR: a program error has been detected;
* you should open a bug in
* <ulink url="https://bugzilla.gnome.org/enter_bug.cgi?product=filemanager-actions">Bugzilla</ulink>.
* @FMA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN: the provider is not willing
* @IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN: the provider is not willing
* to do the requested action.
* @FMA_IIO_PROVIDER_CODE_WRITE_ERROR: a write error has been detected.
* @FMA_IIO_PROVIDER_CODE_DELETE_SCHEMAS_ERROR: the schemas could not be deleted.
* @FMA_IIO_PROVIDER_CODE_DELETE_CONFIG_ERROR: the configuration could not be deleted.
* @IIO_PROVIDER_CODE_WRITE_ERROR: a write error has been detected.
* @IIO_PROVIDER_CODE_DELETE_SCHEMAS_ERROR: the schemas could not be deleted.
* @IIO_PROVIDER_CODE_DELETE_CONFIG_ERROR: the configuration could not be deleted.
*
* The return code of operations.
*/
typedef enum {
FMA_IIO_PROVIDER_CODE_OK = 0,
FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR = 1 + FMA_IIO_PROVIDER_STATUS_LAST,
FMA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN,
FMA_IIO_PROVIDER_CODE_WRITE_ERROR,
FMA_IIO_PROVIDER_CODE_DELETE_SCHEMAS_ERROR,
FMA_IIO_PROVIDER_CODE_DELETE_CONFIG_ERROR,
IIO_PROVIDER_CODE_OK = 0,
IIO_PROVIDER_CODE_PROGRAM_ERROR = 1 + IIO_PROVIDER_STATUS_LAST,
IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN,
IIO_PROVIDER_CODE_WRITE_ERROR,
IIO_PROVIDER_CODE_DELETE_SCHEMAS_ERROR,
IIO_PROVIDER_CODE_DELETE_CONFIG_ERROR,
}
FMAIIOProviderOperationStatus;
......
......@@ -670,10 +670,10 @@ fma_factory_object_write_item( FMAIFactoryObject *object, const FMAIFactoryProvi
FMADataGroup *groups;
gchar *msg;
g_return_val_if_fail( FMA_IS_IFACTORY_OBJECT( object ), FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_IFACTORY_PROVIDER( writer ), FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_IFACTORY_OBJECT( object ), IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_IFACTORY_PROVIDER( writer ), IIO_PROVIDER_CODE_PROGRAM_ERROR );
code = FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR;
code = IIO_PROVIDER_CODE_PROGRAM_ERROR;
groups = v_get_groups( object );
......@@ -687,7 +687,7 @@ fma_factory_object_write_item( FMAIFactoryObject *object, const FMAIFactoryProvi
*messages = g_slist_append( *messages, msg );
}
if( code == FMA_IIO_PROVIDER_CODE_OK ){
if( code == IIO_PROVIDER_CODE_OK ){
NafoWriteIter *iter = g_new0( NafoWriteIter, 1 );
iter->writer = ( FMAIFactoryProvider * ) writer;
......@@ -701,7 +701,7 @@ fma_factory_object_write_item( FMAIFactoryObject *object, const FMAIFactoryProvi
g_free( iter );
}
if( code == FMA_IIO_PROVIDER_CODE_OK ){
if( code == IIO_PROVIDER_CODE_OK ){
code = v_write_done( object, writer, writer_data, messages );
}
......@@ -718,7 +718,7 @@ write_data_iter( const FMAIFactoryObject *object, FMADataBoxed *boxed, NafoWrite
}
/* iter while code is ok */
return( iter->code != FMA_IIO_PROVIDER_CODE_OK );
return( iter->code != IIO_PROVIDER_CODE_OK );
}
/*
......@@ -918,7 +918,7 @@ v_read_done( FMAIFactoryObject *serializable, const FMAIFactoryProvider *reader,
static guint
v_write_start( FMAIFactoryObject *serializable, const FMAIFactoryProvider *writer, void *writer_data, GSList **messages )
{
guint code = FMA_IIO_PROVIDER_CODE_OK;
guint code = IIO_PROVIDER_CODE_OK;
if( FMA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->write_start ){
code = FMA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->write_start( serializable, writer, writer_data, messages );
......@@ -930,7 +930,7 @@ v_write_start( FMAIFactoryObject *serializable, const FMAIFactoryProvider *write
static guint
v_write_done( FMAIFactoryObject *serializable, const FMAIFactoryProvider *writer, void *writer_data, GSList **messages )
{
guint code = FMA_IIO_PROVIDER_CODE_OK;
guint code = IIO_PROVIDER_CODE_OK;
if( FMA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->write_done ){
code = FMA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->write_done( serializable, writer, writer_data, messages );
......
......@@ -85,10 +85,10 @@ fma_factory_provider_write_data( const FMAIFactoryProvider *writer, void *writer
{
guint code;
g_return_val_if_fail( FMA_IS_IFACTORY_PROVIDER( writer ), FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_IFACTORY_OBJECT( object ), FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_IFACTORY_PROVIDER( writer ), IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_IFACTORY_OBJECT( object ), IIO_PROVIDER_CODE_PROGRAM_ERROR );
code = FMA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN;
code = IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN;
if( FMA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_data ){
code = FMA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_data( writer, writer_data, object, boxed, messages );
......
......@@ -216,19 +216,19 @@ fma_ifactory_provider_write_item( const FMAIFactoryProvider *writer, void *write
static const gchar *thisfn = "fma_ifactory_provider_write_item";
guint code;
g_return_val_if_fail( FMA_IS_IFACTORY_PROVIDER( writer ), FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_IFACTORY_OBJECT( object ), FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_IFACTORY_PROVIDER( writer ), IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_IFACTORY_OBJECT( object ), IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_debug( "%s: writer=%p, writer_data=%p, object=%p (%s)",
thisfn, ( void * ) writer, ( void * ) writer_data, ( void * ) object, G_OBJECT_TYPE_NAME( object ));
code = v_factory_provider_write_start( writer, writer_data, object, messages );
if( code == FMA_IIO_PROVIDER_CODE_OK ){
if( code == IIO_PROVIDER_CODE_OK ){
code = fma_factory_object_write_item( object, writer, writer_data, messages );
}
if( code == FMA_IIO_PROVIDER_CODE_OK ){
if( code == IIO_PROVIDER_CODE_OK ){
code = v_factory_provider_write_done( writer, writer_data, object, messages );
}
......@@ -254,7 +254,7 @@ v_factory_provider_read_done( const FMAIFactoryProvider *reader, void *reader_da
static guint
v_factory_provider_write_start( const FMAIFactoryProvider *writer, void *writer_data, FMAIFactoryObject *serializable, GSList **messages )
{
guint code = FMA_IIO_PROVIDER_CODE_OK;
guint code = IIO_PROVIDER_CODE_OK;
if( FMA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_start ){
code = FMA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_start( writer, writer_data, serializable, messages );
......@@ -266,7 +266,7 @@ v_factory_provider_write_start( const FMAIFactoryProvider *writer, void *writer_
static guint
v_factory_provider_write_done( const FMAIFactoryProvider *writer, void *writer_data, FMAIFactoryObject *serializable, GSList **messages )
{
guint code = FMA_IIO_PROVIDER_CODE_OK;
guint code = IIO_PROVIDER_CODE_OK;
if( FMA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_done ){
code = FMA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_done( writer, writer_data, serializable, messages );
......
......@@ -187,7 +187,7 @@ instance_init( GTypeInstance *instance, gpointer klass )
self->private->provider = NULL;
self->private->item_changed_handler = 0;
self->private->writable = FALSE;
self->private->reason = FMA_IIO_PROVIDER_STATUS_UNAVAILABLE;
self->private->reason = IIO_PROVIDER_STATUS_UNAVAILABLE;
}
static void
......@@ -813,7 +813,7 @@ fma_io_provider_is_finally_writable( const FMAIOProvider *provider, guint *reaso
gboolean is_writable;
if( reason ){
*reason = FMA_IIO_PROVIDER_STATUS_UNDETERMINED;
*reason = IIO_PROVIDER_STATUS_UNDETERMINED;
}
g_return_val_if_fail( FMA_IS_IO_PROVIDER( provider ), FALSE );
......@@ -968,12 +968,12 @@ is_finally_writable( const FMAIOProvider *provider, const FMAPivot *pivot, guint
g_return_val_if_fail( reason, FALSE );
writable = FALSE;
*reason = FMA_IIO_PROVIDER_STATUS_UNAVAILABLE;
*reason = IIO_PROVIDER_STATUS_UNAVAILABLE;
if( provider->private->provider && FMA_IS_IIO_PROVIDER( provider->private->provider )){
writable = TRUE;
*reason = FMA_IIO_PROVIDER_STATUS_WRITABLE;
*reason = IIO_PROVIDER_STATUS_WRITABLE;
if( !FMA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->is_willing_to_write ||
!FMA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->is_able_to_write ||
......@@ -981,22 +981,22 @@ is_finally_writable( const FMAIOProvider *provider, const FMAPivot *pivot, guint
!FMA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->delete_item ){
writable = FALSE;
*reason = FMA_IIO_PROVIDER_STATUS_INCOMPLETE_API;
g_debug( "%s: provider_module=%p (%s), writable=False, reason=FMA_IIO_PROVIDER_STATUS_INCOMPLETE_API",
*reason = IIO_PROVIDER_STATUS_INCOMPLETE_API;
g_debug( "%s: provider_module=%p (%s), writable=False, reason=IIO_PROVIDER_STATUS_INCOMPLETE_API",
thisfn, ( void * ) provider->private->provider, provider->private->id );
} else if( !FMA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->is_willing_to_write( provider->private->provider )){
writable = FALSE;
*reason = FMA_IIO_PROVIDER_STATUS_NOT_WILLING_TO;
g_debug( "%s: provider_module=%p (%s), writable=False, reason=FMA_IIO_PROVIDER_STATUS_NOT_WILLING_TO",
*reason = IIO_PROVIDER_STATUS_NOT_WILLING_TO;
g_debug( "%s: provider_module=%p (%s), writable=False, reason=IIO_PROVIDER_STATUS_NOT_WILLING_TO",
thisfn, ( void * ) provider->private->provider, provider->private->id );
} else if( !FMA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->is_able_to_write( provider->private->provider )){
writable = FALSE;
*reason = FMA_IIO_PROVIDER_STATUS_NOT_ABLE_TO;
g_debug( "%s: provider_module=%p (%s), writable=False, reason=FMA_IIO_PROVIDER_STATUS_NOT_ABLE_TO",
*reason = IIO_PROVIDER_STATUS_NOT_ABLE_TO;
g_debug( "%s: provider_module=%p (%s), writable=False, reason=IIO_PROVIDER_STATUS_NOT_ABLE_TO",
thisfn, ( void * ) provider->private->provider, provider->private->id );
} else {
......@@ -1004,11 +1004,11 @@ is_finally_writable( const FMAIOProvider *provider, const FMAPivot *pivot, guint
if( !is_writable ){
writable = FALSE;
if( mandatory ){
*reason = FMA_IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN;
*reason = IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN;
} else {
*reason = FMA_IIO_PROVIDER_STATUS_LOCKED_BY_USER;
*reason = IIO_PROVIDER_STATUS_LOCKED_BY_USER;
}
g_debug( "%s: provider_module=%p (%s), writable=False, reason=FMA_IIO_PROVIDER_STATUS_LOCKED_BY_someone, mandatory=%s",
g_debug( "%s: provider_module=%p (%s), writable=False, reason=IIO_PROVIDER_STATUS_LOCKED_BY_someone, mandatory=%s",
thisfn, ( void * ) provider->private->provider, provider->private->id,
mandatory ? "True":"False" );
}
......@@ -1254,7 +1254,7 @@ fma_io_provider_write_item( const FMAIOProvider *provider, const FMAObjectItem *
( void * ) item, G_OBJECT_TYPE_NAME( item ),
( void * ) messages );
ret = FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR;
ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
g_return_val_if_fail( FMA_IS_IO_PROVIDER( provider ), ret );
g_return_val_if_fail( FMA_IS_OBJECT_ITEM( item ), ret );
......@@ -1263,7 +1263,7 @@ fma_io_provider_write_item( const FMAIOProvider *provider, const FMAObjectItem *
ret = FMA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->write_item( provider->private->provider, item, messages );
if( ret == FMA_IIO_PROVIDER_CODE_OK ){
if( ret == IIO_PROVIDER_CODE_OK ){
fma_object_set_provider( item, provider );
}
......@@ -1291,7 +1291,7 @@ fma_io_provider_delete_item( const FMAIOProvider *provider, const FMAObjectItem
( void * ) item, G_OBJECT_TYPE_NAME( item ),
( void * ) messages );
ret = FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR;
ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
g_return_val_if_fail( FMA_IS_IO_PROVIDER( provider ), ret );
g_return_val_if_fail( FMA_IS_OBJECT_ITEM( item ), ret );
......@@ -1327,7 +1327,7 @@ fma_io_provider_duplicate_data( const FMAIOProvider *provider, FMAObjectItem *de
( void * ) source, G_OBJECT_TYPE_NAME( source ),
( void * ) messages );
ret = FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR;
ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
g_return_val_if_fail( FMA_IS_IO_PROVIDER( provider ), ret );
g_return_val_if_fail( FMA_IS_OBJECT_ITEM( dest ), ret );
......@@ -1361,39 +1361,39 @@ fma_io_provider_get_readonly_tooltip( guint reason )
switch( reason ){
/* item is writable, so tooltip is empty */
case FMA_IIO_PROVIDER_STATUS_WRITABLE:
case IIO_PROVIDER_STATUS_WRITABLE:
tooltip = g_strdup( "" );
break;
case FMA_IIO_PROVIDER_STATUS_UNAVAILABLE:
case IIO_PROVIDER_STATUS_UNAVAILABLE:
tooltip = g_strdup( _( "Unavailable I/O provider." ));
break;
case FMA_IIO_PROVIDER_STATUS_INCOMPLETE_API:
case IIO_PROVIDER_STATUS_INCOMPLETE_API:
tooltip = g_strdup( _( "I/O provider implementation lacks of required API." ));
break;
case FMA_IIO_PROVIDER_STATUS_NOT_WILLING_TO:
case IIO_PROVIDER_STATUS_NOT_WILLING_TO:
tooltip = g_strdup( _( "I/O provider is not willing to write." ));
break;
case FMA_IIO_PROVIDER_STATUS_NOT_ABLE_TO:
case IIO_PROVIDER_STATUS_NOT_ABLE_TO:
tooltip = g_strdup( _( "I/O provider announces itself as unable to write." ));
break;
case FMA_IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN:
case IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN:
tooltip = g_strdup( _( "I/O provider has been locked down by an administrator." ));
break;
case FMA_IIO_PROVIDER_STATUS_LOCKED_BY_USER:
case IIO_PROVIDER_STATUS_LOCKED_BY_USER:
tooltip = g_strdup( _( "I/O provider has been locked down by the user." ));
break;
case FMA_IIO_PROVIDER_STATUS_ITEM_READONLY:
case IIO_PROVIDER_STATUS_ITEM_READONLY:
tooltip = g_strdup( _( "Item is read-only." ));
break;
case FMA_IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND:
case IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND:
tooltip = g_strdup( _( "No writable I/O provider found." ));
break;
......@@ -1421,27 +1421,27 @@ fma_io_provider_get_return_code_label( guint code )
label = NULL;
switch( code ){
case FMA_IIO_PROVIDER_CODE_OK:
case IIO_PROVIDER_CODE_OK:
label = g_strdup( _( "OK." ));
break;
case FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR:
case IIO_PROVIDER_CODE_PROGRAM_ERROR:
label = g_strdup_printf( _( "Program flow error.\n%s" ), st_enter_bug );
break;
case FMA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN:
case IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN:
label = g_strdup( _( "The I/O provider is not willing to do that." ));
break;
case FMA_IIO_PROVIDER_CODE_WRITE_ERROR:
case IIO_PROVIDER_CODE_WRITE_ERROR:
label = g_strdup( _( "Write error in I/O provider." ));
break;
case FMA_IIO_PROVIDER_CODE_DELETE_SCHEMAS_ERROR:
case IIO_PROVIDER_CODE_DELETE_SCHEMAS_ERROR:
label = g_strdup( _( "Unable to delete GConf schemas." ));
break;
case FMA_IIO_PROVIDER_CODE_DELETE_CONFIG_ERROR:
case IIO_PROVIDER_CODE_DELETE_CONFIG_ERROR:
label = g_strdup( _( "Unable to delete configuration." ));
break;
......
......@@ -418,7 +418,7 @@ ifactory_object_write_start( FMAIFactoryObject *instance, const FMAIFactoryProvi
{
fma_object_item_rebuild_children_slist( FMA_OBJECT_ITEM( instance ));
return( FMA_IIO_PROVIDER_CODE_OK );
return( IIO_PROVIDER_CODE_OK );
}
static guint
......@@ -426,7 +426,7 @@ ifactory_object_write_done( FMAIFactoryObject *instance, const FMAIFactoryProvid
{
guint code;
g_return_val_if_fail( FMA_IS_OBJECT_ACTION( instance ), FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_OBJECT_ACTION( instance ), IIO_PROVIDER_CODE_PROGRAM_ERROR );
code = write_done_write_profiles( instance, writer, writer_data, messages );
......@@ -538,10 +538,10 @@ write_done_write_profiles( FMAIFactoryObject *instance, const FMAIFactoryProvide
GSList *children_slist, *ic;
FMAObjectProfile *profile;
code = FMA_IIO_PROVIDER_CODE_OK;
code = IIO_PROVIDER_CODE_OK;
children_slist = fma_object_get_items_slist( instance );
for( ic = children_slist ; ic && code == FMA_IIO_PROVIDER_CODE_OK ; ic = ic->next ){
for( ic = children_slist ; ic && code == IIO_PROVIDER_CODE_OK ; ic = ic->next ){
profile = FMA_OBJECT_PROFILE( fma_object_get_item( instance, ic->data ));
if( profile ){
......
......@@ -885,7 +885,7 @@ fma_object_item_is_finally_writable( const FMAObjectItem *item, guint *reason )
gboolean writable;
if( reason ){
*reason = FMA_IIO_PROVIDER_STATUS_UNDETERMINED;
*reason = IIO_PROVIDER_STATUS_UNDETERMINED;
}
g_return_val_if_fail( FMA_IS_OBJECT_ITEM( item ), FALSE );
......
......@@ -312,13 +312,13 @@ ifactory_object_write_start( FMAIFactoryObject *instance, const FMAIFactoryProvi
{
fma_object_item_rebuild_children_slist( FMA_OBJECT_ITEM( instance ));
return( FMA_IIO_PROVIDER_CODE_OK );
return( IIO_PROVIDER_CODE_OK );
}
static guint
ifactory_object_write_done( FMAIFactoryObject *instance, const FMAIFactoryProvider *writer, void *writer_data, GSList **messages )
{
return( FMA_IIO_PROVIDER_CODE_OK );
return( IIO_PROVIDER_CODE_OK );
}
static void
......
......@@ -368,7 +368,7 @@ ifactory_object_read_done( FMAIFactoryObject *instance, const FMAIFactoryProvide
static guint
ifactory_object_write_done( FMAIFactoryObject *instance, const FMAIFactoryProvider *writer, void *writer_data, GSList **messages )
{
return( FMA_IIO_PROVIDER_CODE_OK );
return( IIO_PROVIDER_CODE_OK );
}
static void
......
......@@ -259,12 +259,12 @@ fma_updater_check_item_writability_status( const FMAUpdater *updater, const FMAO
g_return_if_fail( FMA_IS_OBJECT_ITEM( item ));
writable = FALSE;
reason = FMA_IIO_PROVIDER_STATUS_UNDETERMINED;
reason = IIO_PROVIDER_STATUS_UNDETERMINED;
if( !updater->private->dispose_has_run ){
writable = TRUE;
reason = FMA_IIO_PROVIDER_STATUS_WRITABLE;
reason = IIO_PROVIDER_STATUS_WRITABLE;
/* Writability status of the item has been determined at load time
* (cf. e.g. io-desktop/nadp-reader.c:read_done_item_is_writable()).
......@@ -276,7 +276,7 @@ fma_updater_check_item_writability_status( const FMAUpdater *updater, const FMAO
if( writable ){
if( fma_object_is_readonly( item )){
writable = FALSE;
reason = FMA_IIO_PROVIDER_STATUS_ITEM_READONLY;
reason = IIO_PROVIDER_STATUS_ITEM_READONLY;
}
}
......@@ -291,7 +291,7 @@ fma_updater_check_item_writability_status( const FMAUpdater *updater, const FMAO
provider = fma_io_provider_find_writable_io_provider( FMA_PIVOT( updater ));
if( !provider ){
writable = FALSE;
reason = FMA_IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND;
reason = IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND;
}
}
}
......@@ -302,7 +302,7 @@ fma_updater_check_item_writability_status( const FMAUpdater *updater, const FMAO
parent = ( FMAObjectItem * ) fma_object_get_parent( item );
if( !parent ){
if( updater->private->is_level_zero_writable ){
reason = FMA_IIO_PROVIDER_STATUS_LEVEL_ZERO;
reason = IIO_PROVIDER_STATUS_LEVEL_ZERO;
}
}
}
......@@ -558,7 +558,7 @@ fma_updater_write_item( const FMAUpdater *updater, FMAObjectItem *item, GSList *
{
guint ret;
ret = FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR;
ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
g_return_val_if_fail( FMA_IS_UPDATER( updater ), ret );
g_return_val_if_fail( FMA_IS_OBJECT_ITEM( item ), ret );
......@@ -570,7 +570,7 @@ fma_updater_write_item( const FMAUpdater *updater, FMAObjectItem *item, GSList *
if( !provider ){
provider = fma_io_provider_find_writable_io_provider( FMA_PIVOT( updater ));
g_return_val_if_fail( provider, FMA_IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND );
g_return_val_if_fail( provider, IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND );
}
if( provider ){
......@@ -601,11 +601,11 @@ fma_updater_delete_item( const FMAUpdater *updater, const FMAObjectItem *item, G
guint ret;
FMAIOProvider *provider;
g_return_val_if_fail( FMA_IS_UPDATER( updater ), FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_OBJECT_ITEM( item ), FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( messages, FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_UPDATER( updater ), IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_OBJECT_ITEM( item ), IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( messages, IIO_PROVIDER_CODE_PROGRAM_ERROR );
ret = FMA_IIO_PROVIDER_CODE_OK;
ret = IIO_PROVIDER_CODE_OK;
if( !updater->private->dispose_has_run ){
......@@ -615,7 +615,7 @@ fma_updater_delete_item( const FMAUpdater *updater, const FMAObjectItem *item, G
* without having been ever saved
*/
if( provider ){
g_return_val_if_fail( FMA_IS_IO_PROVIDER( provider ), FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( FMA_IS_IO_PROVIDER( provider ), IIO_PROVIDER_CODE_PROGRAM_ERROR );
ret = fma_io_provider_delete_item( provider, item, messages );
}
}
......
......@@ -137,7 +137,7 @@ nadp_iio_provider_write_item( const FMAIIOProvider *provider, const FMAObjectIte
gchar *fulldir;
gboolean dir_ok;
ret = FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR;
ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret );
g_return_val_if_fail( FMA_IS_OBJECT_ITEM( item ), ret );
......@@ -218,7 +218,7 @@ write_item( const FMAIIOProvider *provider, const FMAObjectItem *item, NadpDeskt
( void * ) ndf,
( void * ) messages );
ret = FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR;
ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
g_return_val_if_fail( FMA_IS_IIO_PROVIDER( provider ), ret );
g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret );
......@@ -232,15 +232,15 @@ write_item( const FMAIIOProvider *provider, const FMAObjectItem *item, NadpDeskt
self = NADP_DESKTOP_PROVIDER( provider );
if( self->private->dispose_has_run ){
return( FMA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN );
return( IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN );
}
ret = FMA_IIO_PROVIDER_CODE_OK;
ret = IIO_PROVIDER_CODE_OK;
fma_ifactory_provider_write_item( FMA_IFACTORY_PROVIDER( provider ), ndf, FMA_IFACTORY_OBJECT( item ), messages );
if( !nadp_desktop_file_write( ndf )){
ret = FMA_IIO_PROVIDER_CODE_WRITE_ERROR;
ret = IIO_PROVIDER_CODE_WRITE_ERROR;
}
return( ret );
......@@ -261,7 +261,7 @@ nadp_iio_provider_delete_item( const FMAIIOProvider *provider, const FMAObjectIt
( void * ) item, G_OBJECT_TYPE_NAME( item ),
( void * ) messages );
ret = FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR;
ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
g_return_val_if_fail( FMA_IS_IIO_PROVIDER( provider ), ret );
g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret );
......@@ -270,7 +270,7 @@ nadp_iio_provider_delete_item( const FMAIIOProvider *provider, const FMAObjectIt
self = NADP_DESKTOP_PROVIDER( provider );
if( self->private->dispose_has_run ){
return( FMA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN );
return( IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN );
}
ndf = ( NadpDesktopFile * ) fma_object_get_provider_data( item );
......@@ -279,13 +279,13 @@ nadp_iio_provider_delete_item( const FMAIIOProvider *provider, const FMAObjectIt
g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), ret );
uri = nadp_desktop_file_get_key_file_uri( ndf );
if( nadp_utils_uri_delete( uri )){
ret = FMA_IIO_PROVIDER_CODE_OK;
ret = IIO_PROVIDER_CODE_OK;
}
g_free( uri );
} else {
g_warning( "%s: NadpDesktopFile is null", thisfn );
ret = FMA_IIO_PROVIDER_CODE_OK;
ret = IIO_PROVIDER_CODE_OK;
}
return( ret );
......@@ -323,7 +323,7 @@ nadp_iio_provider_duplicate_data( const FMAIIOProvider *provider, FMAObjectItem
( void * ) source, G_OBJECT_TYPE_NAME( source ),
( void * ) messages );
ret = FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR;
ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
g_return_val_if_fail( FMA_IS_IIO_PROVIDER( provider ), ret );
g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret );
......@@ -333,7 +333,7 @@ nadp_iio_provider_duplicate_data( const FMAIIOProvider *provider, FMAObjectItem
self = NADP_DESKTOP_PROVIDER( provider );
if( self->private->dispose_has_run ){
return( FMA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN );
return( IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN );
}
ndf = ( NadpDesktopFile * ) fma_object_get_provider_data( source );
......@@ -341,7 +341,7 @@ nadp_iio_provider_duplicate_data( const FMAIIOProvider *provider, FMAObjectItem
fma_object_set_provider_data( dest, g_object_ref( ndf ));
g_object_weak_ref( G_OBJECT( dest ), ( GWeakNotify ) desktop_weak_notify, ndf );
return( FMA_IIO_PROVIDER_CODE_OK );
return( IIO_PROVIDER_CODE_OK );
}
/**
......@@ -388,7 +388,7 @@ nadp_writer_iexporter_export_to_buffer( const FMAIExporter *instance, FMAIExport
ndf = nadp_desktop_file_new();
write_code = fma_ifactory_provider_write_item( FMA_IFACTORY_PROVIDER( instance ), ndf, FMA_IFACTORY_OBJECT( parms->exported ), &parms->messages );
if( write_code != FMA_IIO_PROVIDER_CODE_OK ){
if( write_code != IIO_PROVIDER_CODE_OK ){
code = FMA_IEXPORTER_CODE_ERROR;
} else {
......@@ -456,7 +456,7 @@ nadp_writer_iexporter_export_to_file( const FMAIExporter *instance, FMAIExporter
ndf = nadp_desktop_file_new_for_write( dest_path );
write_code = fma_ifactory_provider_write_item( FMA_IFACTORY_PROVIDER( instance ), ndf, FMA_IFACTORY_OBJECT( parms->exported ), &parms->messages );
if( write_code != FMA_IIO_PROVIDER_CODE_OK ){
if( write_code != IIO_PROVIDER_CODE_OK ){
code = FMA_IEXPORTER_CODE_ERROR;
} else if( !nadp_desktop_file_write( ndf )){
......@@ -480,7 +480,7 @@ nadp_writer_ifactory_provider_write_start( const FMAIFactoryProvider *provider,
write_start_write_type( NADP_DESKTOP_FILE( writer_data ), FMA_OBJECT_ITEM( object ));
}
return( FMA_IIO_PROVIDER_CODE_OK );
return( IIO_PROVIDER_CODE_OK );
}
static void
......@@ -514,10 +514,10 @@ nadp_writer_ifactory_provider_write_data(
guint uint_value;
gchar *parms, *tmp;
g_return_val_if_fail( NADP_IS_DESKTOP_FILE( writer_data ), FMA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
g_return_val_if_fail( NADP_IS_DESKTOP_FILE( writer_data ), IIO_PROVIDER_CODE_PROGRAM_ERROR );
/*g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ));*/
code = FMA_IIO_PROVIDER_CODE_OK;
code = IIO_PROVIDER_CODE_OK;
ndf = NADP_DESKTOP_FILE( writer_data );
def = fma_data_boxed_get_data_def( boxed );
......@@ -575,7 +575,7 @@ nadp_writer_ifactory_provider_write_data(