Ejemplo n.º 1
0
void
ldbm_sync( LDBM ldbm )
{
	LDBM_WLOCK;
	gdbm_sync( ldbm );
	LDBM_WUNLOCK;
}
Ejemplo n.º 2
0
static PyObject *
dbm_sync(register dbmobject *dp, PyObject *unused)
{
    check_dbmobject_open(dp);
    gdbm_sync(dp->di_dbm);
    Py_INCREF(Py_None);
    return Py_None;
}
Ejemplo n.º 3
0
static PyObject *
_gdbm_gdbm_sync_impl(dbmobject *self)
/*[clinic end generated code: output=488b15f47028f125 input=2a47d2c9e153ab8a]*/
{
    check_dbmobject_open(self);
    gdbm_sync(self->di_dbm);
    Py_INCREF(Py_None);
    return Py_None;
}
Ejemplo n.º 4
0
int
ldbm_delete( LDBM ldbm, Datum key )
{
	int	rc;

	LDBM_WLOCK;
	rc = gdbm_delete( ldbm, key );
	gdbm_sync( ldbm );
	LDBM_WUNLOCK;

	return( rc );
}
Ejemplo n.º 5
0
int
ldbm_store( LDBM ldbm, Datum key, Datum data, int flags )
{
	int	rc;

	LDBM_WLOCK;
	rc = gdbm_store( ldbm, key, data, flags & ~LDBM_SYNC );
	if ( flags & LDBM_SYNC )
		gdbm_sync( ldbm );
	LDBM_WUNLOCK;

	return( rc );
}
Ejemplo n.º 6
0
/*
*	execute the 'index' procedure
*/
int		sblib_proc_exec(int index, int param_count, slib_par_t *params, var_t *retval)
{
	int		success = 0;
	int		handle;

	switch ( index )	{
	case	0:	// GDBM_CLOSE handle
		success = mod_parint(0, params, param_count, &handle);
		if	( success )	{
			if	( is_valid_handle(handle) )	{
				gdbm_close(table[handle].dbf);
				table[handle].dbf = NULL;
				success = 1;
				}
			else	{
				success = 0;
				v_setstr(retval, "GDBM_CLOSE: INVALID HANDLE");
				}
			}
		else
			v_setstr(retval, "GDBM_CLOSE: argument error");
		break;

	case	1:	// GDBM_SYNC handle
		success = mod_parint(0, params, param_count, &handle);
		if	( success )	{
			if	( is_valid_handle(handle) )	{
				gdbm_sync(table[handle].dbf);
				success = 1;
				}
			else	{
				success = 0;
				v_setstr(retval, "GDBM_SYNC: INVALID HANDLE");
				}
			}
		else
			v_setstr(retval, "GDBM_SYNC: argument error");
		break;

	default:
		v_setstr(retval, "GDBM: procedure does not exist!");
		}

	return success;
}
static ClRcT  
cdbGDBMSync(ClDBHandleT  dbHandle,
            ClUint32T    flags)
{
  GDBMHandle_t* pGDBMHandle = (GDBMHandle_t*)dbHandle;

  CL_FUNC_ENTER();
  /**
   * Calling gdbm_sync() only if GDBM DB is not opened in 
   * automatic SYNC mode.
   */
  if(CL_FALSE == pGDBMHandle->syncMode)
  {
      /**
       * Explicit DB sync - database will be completely updated 
       * with all changes to the current time 
       */
      gdbm_sync(pGDBMHandle->gdbmInstance);
  }

  CL_FUNC_EXIT();
  return(CL_OK);
}
Ejemplo n.º 8
0
int pa_database_sync(pa_database *db) {
    pa_assert(db);

    gdbm_sync(MAKE_GDBM_FILE(db));
    return 0;
}