changeset 193:b80dff4bef76 src

Remove all references to S_OK and S_ERR. DVDNAV_STATUS_OK will always be 1. DVDNAV_STATUS_ERR will always be 0.
author jcdutton
date Sun, 11 May 2003 00:25:24 +0000
parents a3d7b149cc0f
children 0ee10bd2292a
files dvdnav.c dvdnav.h dvdnav_internal.h.in highlight.c navigation.c searching.c settings.c
diffstat 7 files changed, 170 insertions(+), 177 deletions(-) [+]
line wrap: on
line diff
--- a/dvdnav.c	Tue May 06 20:54:59 2003 +0000
+++ b/dvdnav.c	Sun May 11 00:25:24 2003 +0000
@@ -63,7 +63,7 @@
 
   dvdnav_read_cache_clear(this->cache);
   
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_open(dvdnav_t** dest, const char *path) {
@@ -76,7 +76,7 @@
   (*dest) = NULL;
   this = (dvdnav_t*)malloc(sizeof(dvdnav_t));
   if(!this)
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   memset(this, 0, (sizeof(dvdnav_t) ) ); /* Make sure this structure is clean */
  
   pthread_mutex_init(&this->vm_lock, NULL);
@@ -89,14 +89,14 @@
     printerr("Error initialising the DVD VM.");
     pthread_mutex_destroy(&this->vm_lock);
     free(this);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if(!vm_reset(this->vm, path)) {
     printerr("Error starting the VM / opening the DVD device.");
     pthread_mutex_destroy(&this->vm_lock);
     vm_free_vm(this->vm);
     free(this);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   /* Set the path. FIXME: Is a deep copy 'right' */
@@ -116,7 +116,7 @@
   dvdnav_clear(this);
  
   (*dest) = this;
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_close(dvdnav_t *this) {
@@ -127,7 +127,7 @@
 
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   if (this->file) {
@@ -152,7 +152,7 @@
   else
     free(this);
   
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_reset(dvdnav_t *this) {
@@ -164,7 +164,7 @@
 
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   pthread_mutex_lock(&this->vm_lock); 
@@ -175,7 +175,7 @@
   if(!vm_reset(this->vm, NULL)) {
     printerr("Error restarting the VM.");
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 #ifdef LOG_DEBUG
   fprintf(MSG_OUT, "libdvdnav: clearing dvdnav\n");
@@ -190,12 +190,12 @@
 
   if(!this || !path) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   (*path) = this->path;
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 const char* dvdnav_err_to_string(dvdnav_t *this) {
@@ -385,7 +385,7 @@
   
   block = buf;
   status = dvdnav_get_next_cache_block(this, &block, event, len);
-  if (status == S_OK && block != buf) {
+  if (status == DVDNAV_STATUS_OK && block != buf) {
     /* we received a block from the cache, copy it, so we can give it back */
     memcpy(buf, block, DVD_VIDEO_LB_LEN);
     dvdnav_free_cache_block(this, block);
@@ -400,7 +400,7 @@
 
   if(!this || !event || !len || !buf || !*buf) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   pthread_mutex_lock(&this->vm_lock);
@@ -421,7 +421,7 @@
     (*event) = DVDNAV_STOP;
     this->started = 0;
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_OK;
+    return DVDNAV_STATUS_OK;
   }
 
   vm_position_get(this->vm, &this->position_next);
@@ -453,13 +453,13 @@
 	if(result <= 0) {
 	  printerr("Error reading NAV packet.");
 	  pthread_mutex_unlock(&this->vm_lock); 
-	  return S_ERR;
+	  return DVDNAV_STATUS_ERR;
 	}
 	/* Decode nav into pci and dsi. Then get next VOBU info. */
 	if(!dvdnav_decode_packet(this, *buf, &this->dsi, &this->pci)) {
 	  printerr("Expected NAV packet but none found.");
 	  pthread_mutex_unlock(&this->vm_lock); 
-	  return S_ERR;
+	  return DVDNAV_STATUS_ERR;
 	}
 	dvdnav_get_vobu(this, &this->dsi, &this->pci, &this->vobu);
 	/* skip to next, if there is a next */
@@ -480,7 +480,7 @@
     this->vobu.blockN      = 0;
     this->sync_wait        = 0;
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_OK;
+    return DVDNAV_STATUS_OK;
   }
 
   /* Check the HIGHLIGHT flag */
@@ -496,7 +496,7 @@
     hevent->buttonN = this->position_next.button;
     this->position_current.button = this->position_next.button;
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_OK;
+    return DVDNAV_STATUS_OK;
   }
   
   /* Check the WAIT flag */
@@ -507,7 +507,7 @@
 #endif
     (*len) = 0;
     pthread_mutex_unlock(&this->vm_lock);
-    return S_OK;
+    return DVDNAV_STATUS_OK;
   }
 
   /* Check to see if we need to change the currently opened VOB */
@@ -543,7 +543,7 @@
     default:
       printerr("Unknown domain when changing VTS.");
       pthread_mutex_unlock(&this->vm_lock); 
-      return S_ERR;
+      return DVDNAV_STATUS_ERR;
     }
     
     this->position_current.vts = this->position_next.vts; 
@@ -557,7 +557,7 @@
     if(this->file == NULL) {
       printerrf("Error opening vtsN=%i, domain=%i.", vtsN, domain);
       pthread_mutex_unlock(&this->vm_lock); 
-      return S_ERR;
+      return DVDNAV_STATUS_ERR;
     }
 
     /* File opened successfully so return a VTS change event */
@@ -573,7 +573,7 @@
     this->position_current.audio_channel = -1; /* Force an update */;
      
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_OK;
+    return DVDNAV_STATUS_OK;
   }
 
   /* Check if the cell changed */  
@@ -636,7 +636,7 @@
     this->position_current.audio_channel = -1; /* Force an update */
 
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_OK;
+    return DVDNAV_STATUS_OK;
   }
  
   /* has the CLUT changed? */
@@ -649,7 +649,7 @@
     memcpy(*buf, &(state->pgc->palette), 16 * sizeof(uint32_t));
     this->spu_clut_changed = 0;
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_OK;
+    return DVDNAV_STATUS_OK;
   }
 
   /* has the SPU channel changed? */  
@@ -674,10 +674,10 @@
         stream_change->physical_letterbox != -1 &&
         stream_change->physical_pan_scan != -1) {
 #ifdef LOG_DEBUG
-      fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE returning S_OK\n");
+      fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE returning DVDNAV_STATUS_OK\n");
 #endif
       pthread_mutex_unlock(&this->vm_lock); 
-      return S_OK;
+      return DVDNAV_STATUS_OK;
     }
   }
 
@@ -693,10 +693,10 @@
     stream_change->physical = vm_get_audio_active_stream( this->vm );
     this->position_current.audio_channel = this->position_next.audio_channel;
 #ifdef LOG_DEBUG
-    fprintf(MSG_OUT, "libdvdnav: AUDIO_STREAM_CHANGE stream_id=%d returning S_OK\n",stream_change->physical);
+    fprintf(MSG_OUT, "libdvdnav: AUDIO_STREAM_CHANGE stream_id=%d returning DVDNAV_STATUS_OK\n",stream_change->physical);
 #endif
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_OK;
+    return DVDNAV_STATUS_OK;
   }
      
   /* Check the STILLFRAME flag */
@@ -710,7 +710,7 @@
     (*len) = sizeof(dvdnav_still_event_t);
     still_event->length = this->position_current.still;
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_OK;
+    return DVDNAV_STATUS_ERR;
   }
 
   /* Have we reached the end of a VOBU? */
@@ -742,7 +742,7 @@
       (*event) = DVDNAV_NOP;
       (*len) = 0;
       pthread_mutex_unlock(&this->vm_lock); 
-      return S_OK;
+      return DVDNAV_STATUS_OK;
     }
 
     /* Perform remapping jump if necessary (this is always a 
@@ -760,13 +760,13 @@
     if(result <= 0) {
       printerr("Error reading NAV packet.");
       pthread_mutex_unlock(&this->vm_lock); 
-      return S_ERR;
+      return DVDNAV_STATUS_ERR;
     }
     /* Decode nav into pci and dsi. Then get next VOBU info. */
     if(!dvdnav_decode_packet(this, *buf, &this->dsi, &this->pci)) {
       printerr("Expected NAV packet but none found.");
       pthread_mutex_unlock(&this->vm_lock); 
-      return S_ERR;
+      return DVDNAV_STATUS_ERR;
     }
     /* We need to update the vm state->blockN with which VOBU we are in.
      * This is so RSM resumes to the VOBU level and not just the CELL level.
@@ -791,14 +791,14 @@
 #endif
     (*len) = 2048; 
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_OK;
+    return DVDNAV_STATUS_OK;
   }
   
   /* If we've got here, it must just be a normal block. */
   if(!this->file) {
     printerr("Attempting to read without opening file.");
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   this->vobu.blockN++;
@@ -806,24 +806,24 @@
   if(result <= 0) {
     printerr("Error reading from DVD.");
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   (*event) = DVDNAV_BLOCK_OK;
   (*len) = 2048;
 
   pthread_mutex_unlock(&this->vm_lock); 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_get_title_string(dvdnav_t *this, const char **title_str) {
   
   if(!this || !title_str) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   (*title_str) = this->vm->dvd_name;
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 uint8_t dvdnav_get_video_aspect(dvdnav_t *this) {
@@ -1046,7 +1046,7 @@
   
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   pthread_mutex_lock(&this->vm_lock);
@@ -1057,25 +1057,25 @@
   } else {
     printerr("Passed an invalid angle number.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   pthread_mutex_unlock(&this->vm_lock);
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_get_angle_info(dvdnav_t *this, int *current_angle,
 				      int *number_of_angles) {
   if(!this || !current_angle || !number_of_angles) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   pthread_mutex_lock(&this->vm_lock);
   vm_get_angle_info(this->vm, current_angle, number_of_angles);
   pthread_mutex_unlock(&this->vm_lock);
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 pci_t* dvdnav_get_current_nav_pci(dvdnav_t *this) {
--- a/dvdnav.h	Tue May 06 20:54:59 2003 +0000
+++ b/dvdnav.h	Sun May 11 00:25:24 2003 +0000
@@ -67,8 +67,8 @@
  * they succeeded, otherwise DVDNAV_STATUS_ERR is returned and the error may
  * be obtained by calling dvdnav_err_to_string().
  */
-#define DVDNAV_STATUS_ERR 1
-#define DVDNAV_STATUS_OK  0
+#define DVDNAV_STATUS_ERR 0
+#define DVDNAV_STATUS_OK  1
 
 
 /*********************************************************************
--- a/dvdnav_internal.h.in	Tue May 06 20:54:59 2003 +0000
+++ b/dvdnav_internal.h.in	Sun May 11 00:25:24 2003 +0000
@@ -174,11 +174,4 @@
 #endif
 #define printerr(str) strncpy(this->err_str, str, MAX_ERR_LEN);
 
-/* Save my typing */
-#define S_ERR DVDNAV_STATUS_ERR
-
-#ifndef _MSC_VER
-#define S_OK  DVDNAV_STATUS_OK
-#endif /* MSC_VER */
-
 #endif /* DVDNAV_INTERNAL_H_INCLUDED */
--- a/highlight.c	Tue May 06 20:54:59 2003 +0000
+++ b/highlight.c	Sun May 11 00:25:24 2003 +0000
@@ -209,13 +209,13 @@
   
   if(!this || !button) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   /* Simply return the appropriate value based on the SPRM */
   (*button) = this->position_current.button;
   
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 static btni_t *get_current_button(dvdnav_t *this, pci_t *pci) {
@@ -223,15 +223,15 @@
 
   if(!this || !pci) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if(!pci->hli.hl_gi.hli_ss) {
     printerr("Not in a menu.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) {
     printerr("This NAV has already been left.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   button = this->vm->state.HL_BTNN_REG >> 10;
@@ -251,48 +251,48 @@
   btni_t *button_ptr;
   
   if(!(button_ptr = get_current_button(this, pci)))
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
 
   dvdnav_button_select(this, pci, button_ptr->up);
   button_auto_action(this, pci);
  
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_lower_button_select(dvdnav_t *this, pci_t *pci) {
   btni_t *button_ptr;
   
   if(!(button_ptr = get_current_button(this, pci)))
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
 
   dvdnav_button_select(this, pci, button_ptr->down);
   button_auto_action(this, pci);
   
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_right_button_select(dvdnav_t *this, pci_t *pci) {
   btni_t *button_ptr;
   
   if(!(button_ptr = get_current_button(this, pci)))
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
 
   dvdnav_button_select(this, pci, button_ptr->right);
   button_auto_action(this, pci);
   
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_left_button_select(dvdnav_t *this, pci_t *pci) {
   btni_t *button_ptr;
   
   if(!(button_ptr = get_current_button(this, pci)))
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
 
   dvdnav_button_select(this, pci, button_ptr->left);
   button_auto_action(this, pci);
   
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_get_highlight_area(pci_t *nav_pci , int32_t button, int32_t mode, 
@@ -304,9 +304,9 @@
 #endif
   
   if(!nav_pci->hli.hl_gi.hli_ss)
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   if((button <= 0) || (button > nav_pci->hli.hl_gi.btn_ns))
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
 
 
   button_ptr = &nav_pci->hli.btnit[button-1];
@@ -330,7 +330,7 @@
                button);
 #endif
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_button_activate(dvdnav_t *this, pci_t *pci) {
@@ -339,15 +339,15 @@
 
   if(!this || !pci) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if(!pci->hli.hl_gi.hli_ss) {
     printerr("Not in a menu.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) {
     printerr("This NAV has already been left.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   pthread_mutex_lock(&this->vm_lock); 
@@ -373,10 +373,10 @@
       pthread_mutex_unlock(&this->vm_lock);
       /* clear error message */
       printerr("");
-      return S_OK;
+      return DVDNAV_STATUS_OK;
     }
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   button_ptr = get_current_button(this, pci);
@@ -393,14 +393,14 @@
   }
   
   pthread_mutex_unlock(&this->vm_lock); 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_button_activate_cmd(dvdnav_t *this, int32_t button, vm_cmd_t *cmd)
 {
   if(!this || !cmd) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   pthread_mutex_lock(&this->vm_lock);
@@ -420,22 +420,22 @@
   this->position_current.still = 0;
   this->sync_wait = 0;
   pthread_mutex_unlock(&this->vm_lock);
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }  
 
 dvdnav_status_t dvdnav_button_select(dvdnav_t *this, pci_t *pci, int button) {
   
   if(!this || !pci) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if(!pci->hli.hl_gi.hli_ss) {
     printerr("Not in a menu.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) {
     printerr("This NAV has already been left.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
  
 #ifdef BUTTON_TESTING
@@ -444,21 +444,21 @@
   
   if((button <= 0) || (button > pci->hli.hl_gi.btn_ns)) {
     printerr("Button does not exist.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   this->vm->state.HL_BTNN_REG = (button << 10);
   this->position_current.button = -1; /* Force Highligh change */
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_button_select_and_activate(dvdnav_t *this, pci_t *pci, 
 						  int button) {
   /* A trivial function */
-  if(dvdnav_button_select(this, pci, button) != S_ERR)
+  if(dvdnav_button_select(this, pci, button) != DVDNAV_STATUS_ERR)
     return dvdnav_button_activate(this, pci);
-  return S_ERR;
+  return DVDNAV_STATUS_ERR;
 }
 
 dvdnav_status_t dvdnav_mouse_select(dvdnav_t *this, pci_t *pci, int x, int y) {
@@ -468,15 +468,15 @@
 
   if(!this || !pci) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if(!pci->hli.hl_gi.hli_ss) {
     printerr("Not in a menu.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) {
     printerr("This NAV has already been left.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   cur_button = this->vm->state.HL_BTNN_REG >> 10;
@@ -509,13 +509,13 @@
   if (best != 0 && best != cur_button)
     dvdnav_button_select(this, pci, best);
 
-  /* return S_OK only if we actually found a matching button */
-  return best ? S_OK : S_ERR;
+  /* return DVDNAV_STATUS_OK only if we actually found a matching button */
+  return best ? DVDNAV_STATUS_OK : DVDNAV_STATUS_ERR;
 }
 
 dvdnav_status_t dvdnav_mouse_activate(dvdnav_t *this, pci_t *pci, int x, int y) {
   /* A trivial function */
-  if(dvdnav_mouse_select(this, pci, x,y) != S_ERR)
+  if(dvdnav_mouse_select(this, pci, x,y) != DVDNAV_STATUS_ERR)
     return dvdnav_button_activate(this, pci);
-  return S_ERR;
+  return DVDNAV_STATUS_ERR;
 }
--- a/navigation.c	Tue May 06 20:54:59 2003 +0000
+++ b/navigation.c	Sun May 11 00:25:24 2003 +0000
@@ -32,7 +32,7 @@
 dvdnav_status_t dvdnav_still_skip(dvdnav_t *this) {
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   this->position_current.still = 0;
@@ -40,25 +40,25 @@
   this->sync_wait = 0;
   this->sync_wait_skip = 1;
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_wait_skip(dvdnav_t *this) {
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   this->sync_wait = 0;
   this->sync_wait_skip = 1;
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *this, int *titles) {
   if(!this || !titles) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   if(!this->started) {
@@ -69,26 +69,26 @@
 
   (*titles) = vm_get_vmgi(this->vm)->tt_srpt->nr_of_srpts;
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *this, int title, int *parts) {
   if(!this || !parts) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if(!this->started) {
     printerr("Virtual DVD machine not started.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if ((title < 1) || (title > vm_get_vmgi(this->vm)->tt_srpt->nr_of_srpts) ) {
     printerr("Passed a title number out of range.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   (*parts) = vm_get_vmgi(this->vm)->tt_srpt->title[title-1].nr_of_ptts;
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_current_title_info(dvdnav_t *this, int *title, int *part) {
@@ -96,19 +96,19 @@
   
   if(!this || !title || !part) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   pthread_mutex_lock(&this->vm_lock);
   if (!this->vm->vtsi || !this->vm->vmgi) {
     printerr("Bad VM state.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if (!this->vm->state.pgc) {
     printerr("No current PGC.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if ( (this->vm->state.domain == VTSM_DOMAIN)
       || (this->vm->state.domain == VMGM_DOMAIN) ) {
@@ -117,23 +117,23 @@
     if (*part > -1) {
       *title = 0;
       pthread_mutex_unlock(&this->vm_lock);
-      return S_OK;
+      return DVDNAV_STATUS_OK;
     }
   }
   if (this->vm->state.domain == VTS_DOMAIN) {
     retval = vm_get_current_title_part(this->vm, title, part);
     pthread_mutex_unlock(&this->vm_lock);
-    return retval ? S_OK : S_ERR;
+    return retval ? DVDNAV_STATUS_OK : DVDNAV_STATUS_ERR;
   }
   printerr("Not in a title or menu.");
   pthread_mutex_unlock(&this->vm_lock);
-  return S_ERR;
+  return DVDNAV_STATUS_ERR;
 }
 
 dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int title) {
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   return dvdnav_part_play(this, title, 1);
 }
@@ -143,29 +143,29 @@
 
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   pthread_mutex_lock(&this->vm_lock);
   if (!this->vm->vmgi) {
     printerr("Bad VM state.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if (!this->vm->state.pgc) {
     printerr("No current PGC.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if((title < 1) || (title > this->vm->vmgi->tt_srpt->nr_of_srpts)) {
     printerr("Title out of range.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if((part < 1) || (part > this->vm->vmgi->tt_srpt->title[title-1].nr_of_ptts)) {
     printerr("Part out of range.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   retval = vm_jump_title_part(this->vm, title, part);
@@ -173,45 +173,45 @@
     this->vm->hop_channel++;
   pthread_mutex_unlock(&this->vm_lock);
 
-  return retval ? S_OK : S_ERR;
+  return retval ? DVDNAV_STATUS_OK : DVDNAV_STATUS_ERR;
 }
 
 dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *this, int title,
 					   int part, int parts_to_play) {
   /* FIXME: Implement auto-stop */
- if (dvdnav_part_play(this, title, part) == S_OK)
+ if (dvdnav_part_play(this, title, part) == DVDNAV_STATUS_OK)
    printerr("Not implemented yet.");
- return S_ERR;
+ return DVDNAV_STATUS_ERR;
 }
 
 dvdnav_status_t dvdnav_time_play(dvdnav_t *this, int title,
 				 unsigned long int time) {
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   /* FIXME: Implement */
   printerr("Not implemented yet.");
-  return S_ERR;
+  return DVDNAV_STATUS_ERR;
 }
 
 dvdnav_status_t dvdnav_stop(dvdnav_t *this) {
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   pthread_mutex_lock(&this->vm_lock);
   this->vm->stopped = 1;
   pthread_mutex_unlock(&this->vm_lock);
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_go_up(dvdnav_t *this) {
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   /* A nice easy function... delegate to the VM */
@@ -219,5 +219,5 @@
   vm_jump_up(this->vm);
   pthread_mutex_unlock(&this->vm_lock);
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
--- a/searching.c	Tue May 06 20:54:59 2003 +0000
+++ b/searching.c	Sun May 11 00:25:24 2003 +0000
@@ -37,7 +37,7 @@
 dvdnav_status_t dvdnav_time_search(dvdnav_t *this,
 				   unsigned long int time) {
   /* FIXME: Time search the current PGC based on the xxx table */
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 /* Scan the ADMAP for a particular block number. */
@@ -91,14 +91,14 @@
     }
     if(found) {
       *vobu = vobu_start;
-      return S_OK;
+      return DVDNAV_STATUS_OK;
     } else {
       fprintf(MSG_OUT, "libdvdnav: Could not locate block\n");
-      return S_ERR;
+      return DVDNAV_STATUS_ERR;
     }
   }
   fprintf(MSG_OUT, "libdvdnav: admap not located\n");
-  return S_ERR;
+  return DVDNAV_STATUS_ERR;
 }
 
 dvdnav_status_t dvdnav_sector_search(dvdnav_t *this,
@@ -113,12 +113,12 @@
 
   if(this->position_current.still != 0) {
     printerr("Cannot seek in a still frame.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   result = dvdnav_get_position(this, &target, &length);
   if(!result) {
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
  
   pthread_mutex_lock(&this->vm_lock);
@@ -126,7 +126,7 @@
   if(!state->pgc) {
     printerr("No current PGC.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 #ifdef LOG_DEBUG
   fprintf(MSG_OUT, "libdvdnav: seeking to offset=%lu pos=%u length=%u\n", offset, target, length); 
@@ -138,7 +138,7 @@
     if(offset > length) {
       printerr("Request to seek behind end.");
       pthread_mutex_unlock(&this->vm_lock);
-      return S_ERR;
+      return DVDNAV_STATUS_ERR;
     }
     target = offset;
     break;
@@ -146,7 +146,7 @@
     if(target + offset > length) {
       printerr("Request to seek behind end.");
       pthread_mutex_unlock(&this->vm_lock);
-      return S_ERR;
+      return DVDNAV_STATUS_ERR;
     }
     target += offset;
     break;
@@ -154,7 +154,7 @@
     if(length - offset < 0) {
       printerr("Request to seek before start.");
       pthread_mutex_unlock(&this->vm_lock);
-      return S_ERR;
+      return DVDNAV_STATUS_ERR;
     }
     target = length - offset;
     break;
@@ -162,7 +162,7 @@
     /* Error occured */
     printerr("Illegal seek mode.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   if (this->pgc_based) {
@@ -198,7 +198,7 @@
     fprintf(MSG_OUT, "libdvdnav: Seeking to cell %i from choice of %i to %i\n",
 	    cell_nr, first_cell_nr, last_cell_nr);
 #endif
-    if (dvdnav_scan_admap(this, state->domain, target, &vobu) == S_OK) {
+    if (dvdnav_scan_admap(this, state->domain, target, &vobu) == DVDNAV_STATUS_OK) {
       int32_t start = state->pgc->cell_playback[cell_nr-1].first_sector;
       
       if (vm_jump_cell_block(this->vm, cell_nr, vobu - start)) {
@@ -208,7 +208,7 @@
 #endif
         this->vm->hop_channel += HOP_SEEK;
         pthread_mutex_unlock(&this->vm_lock);
-        return S_OK;
+        return DVDNAV_STATUS_OK;
       }
     }
   }
@@ -217,29 +217,29 @@
   fprintf(MSG_OUT, "libdvdnav: FIXME: Implement seeking to location %u\n", target); 
   printerr("Error when seeking.");
   pthread_mutex_unlock(&this->vm_lock);
-  return S_ERR;
+  return DVDNAV_STATUS_ERR;
 }
 
 dvdnav_status_t dvdnav_part_search(dvdnav_t *this, int part) {
   int title, old_part;
   
-  if (dvdnav_current_title_info(this, &title, &old_part) == S_OK)
+  if (dvdnav_current_title_info(this, &title, &old_part) == DVDNAV_STATUS_OK)
     return dvdnav_part_play(this, title, part);
-  return S_ERR;
+  return DVDNAV_STATUS_ERR;
 }
 
 dvdnav_status_t dvdnav_prev_pg_search(dvdnav_t *this) {
 
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   pthread_mutex_lock(&this->vm_lock);
   if(!this->vm->state.pgc) {
     printerr("No current PGC.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
 #ifdef LOG_DEBUG
@@ -249,7 +249,7 @@
     fprintf(MSG_OUT, "libdvdnav: previous chapter failed.\n");
     printerr("Skip to previous chapter failed.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   this->position_current.still = 0;
   this->vm->hop_channel++;
@@ -258,21 +258,21 @@
 #endif
   pthread_mutex_unlock(&this->vm_lock);
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_top_pg_search(dvdnav_t *this) {
 
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
     
   pthread_mutex_lock(&this->vm_lock);
   if(!this->vm->state.pgc) {
     printerr("No current PGC.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
 #ifdef LOG_DEBUG
@@ -282,7 +282,7 @@
     fprintf(MSG_OUT, "libdvdnav: top chapter failed.\n");
     printerr("Skip to top chapter failed.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   this->position_current.still = 0;
   this->vm->hop_channel++;
@@ -291,7 +291,7 @@
 #endif
   pthread_mutex_unlock(&this->vm_lock);
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_next_pg_search(dvdnav_t *this) {
@@ -299,14 +299,14 @@
 
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   pthread_mutex_lock(&this->vm_lock);
   if(!this->vm->state.pgc) {
     printerr("No current PGC.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
 #ifdef LOG_DEBUG
@@ -324,7 +324,7 @@
       fprintf(MSG_OUT, "libdvdnav: next chapter failed.\n");
       printerr("Skip to next chapter failed.");
       pthread_mutex_unlock(&this->vm_lock);
-      return S_ERR;
+      return DVDNAV_STATUS_ERR;
     }
   }
   /* merge changes on success */
@@ -337,7 +337,7 @@
 #endif
   pthread_mutex_unlock(&this->vm_lock);
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_menu_call(dvdnav_t *this, DVDMenuID_t menu) {
@@ -345,14 +345,14 @@
   
   if(!this) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   pthread_mutex_lock(&this->vm_lock);
   if(!this->vm->state.pgc) {
     printerr("No current PGC.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   /* make a copy of current VM and try to navigate the copy to the menu */
@@ -366,7 +366,7 @@
         this->position_current.still = 0;
         this->vm->hop_channel++;
         pthread_mutex_unlock(&this->vm_lock); 
-        return S_OK;
+        return DVDNAV_STATUS_OK;
     }
   }
   if (menu == DVD_MENU_Escape) menu = DVD_MENU_Root;
@@ -378,12 +378,12 @@
     this->position_current.still = 0;
     this->vm->hop_channel++;
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_OK;
+    return DVDNAV_STATUS_OK;
   } else {
     vm_free_copy(try_vm);
     printerr("No such menu or menu not reachable.");
     pthread_mutex_unlock(&this->vm_lock); 
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 }
 
@@ -396,11 +396,11 @@
 
   if(!this || !pos || !len) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if(!this->started) {
     printerr("Virtual DVD machine not started.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   pthread_mutex_lock(&this->vm_lock);
@@ -408,7 +408,7 @@
   if(!state->pgc) {
     printerr("No current PGC.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   if (this->position_current.hop_channel  != this->vm->hop_channel ||
       this->position_current.domain       != state->domain         ||
@@ -416,7 +416,7 @@
       this->position_current.cell_restart != state->cell_restart) {
     printerr("New position not yet determined.");
     pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   /* Get current sector */
@@ -451,7 +451,7 @@
 
   pthread_mutex_unlock(&this->vm_lock);
 
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_get_position_in_title(dvdnav_t *this,
@@ -466,13 +466,13 @@
 
   if(!this || !pos || !len) {
     printerr("Passed a NULL pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   state = &(this->vm->state);
   if(!state->pgc) {
     printerr("No current PGC.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   /* Get current sector */
@@ -487,5 +487,5 @@
   *pos = cur_sector - first_cell->first_sector;
   *len = last_cell->last_sector - first_cell->first_sector;
   
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
--- a/settings.c	Tue May 06 20:54:59 2003 +0000
+++ b/settings.c	Sun May 11 00:25:24 2003 +0000
@@ -32,60 +32,60 @@
 dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *this, int *region) {
   if(!this || !region) {
     printerr("Passed a NULL this pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   (*region) = this->vm->state.registers.SPRM[20];
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *this, int mask) {
   if(!this) {
     printerr("Passed a NULL this pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   pthread_mutex_lock(&this->vm_lock);
   this->vm->state.registers.SPRM[20] = (mask & 0xff);
   pthread_mutex_unlock(&this->vm_lock);
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *this, int use_readahead) {
   if(!this) {
     printerr("Passed a NULL this pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   this->use_read_ahead = use_readahead;
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *this, int *flag) {
   if(!this || !flag) {
     printerr("Passed a NULL this pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   (*flag) = this->use_read_ahead;
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 static dvdnav_status_t set_language_register(dvdnav_t *this, char *code, int reg) {
   if(!this || !code) {
     printerr("Passed a NULL this pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
     
   if(!code[0] || !code[1]) {
     printerr("Passed illegal language code.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
   
   pthread_mutex_lock(&this->vm_lock);
   this->vm->state.registers.SPRM[reg] = (code[0] << 8) | code[1];
   pthread_mutex_unlock(&this->vm_lock);
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_menu_language_select(dvdnav_t *this, char *code) {
@@ -103,19 +103,19 @@
 dvdnav_status_t dvdnav_set_PGC_positioning_flag(dvdnav_t *this, int pgc) {
   if(!this) {
     printerr("Passed a NULL this pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   this->pgc_based = pgc;
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }
 
 dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *this, int *flag) {
   if(!this || !flag) {
     printerr("Passed a NULL this pointer.");
-    return S_ERR;
+    return DVDNAV_STATUS_ERR;
   }
 
   (*flag) = this->pgc_based;
-  return S_OK;
+  return DVDNAV_STATUS_OK;
 }