diff navigation.c @ 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 25b0c4f881c3
children 6b1bfe8f5283
line wrap: on
line diff
--- 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;
 }