[libpri-commits] rmudgett: branch rmudgett/facility r751 - /team/rmudgett/facility/

SVN commits to the libpri project libpri-commits at lists.digium.com
Fri Apr 17 12:02:47 CDT 2009


Author: rmudgett
Date: Fri Apr 17 12:02:43 2009
New Revision: 751

URL: http://svn.digium.com/svn-view/libpri?view=rev&rev=751
Log:
Added a note to prefix new global identifiers with PRI_ or pri_  and changed the new identifiers to comply.

Modified:
    team/rmudgett/facility/libpri.h
    team/rmudgett/facility/pri_facility.c

Modified: team/rmudgett/facility/libpri.h
URL: http://svn.digium.com/svn-view/libpri/team/rmudgett/facility/libpri.h?view=diff&rev=751&r1=750&r2=751
==============================================================================
--- team/rmudgett/facility/libpri.h (original)
+++ team/rmudgett/facility/libpri.h Fri Apr 17 12:02:43 2009
@@ -26,7 +26,14 @@
  * provided with that copy of Asterisk, instead of the license
  * terms granted here.
  */
- 
+
+/*
+ * NOTE:
+ * All new global identifiers that are added to this file MUST be
+ * prefixed with PRI_ or pri_ to indicate that they are part of this
+ * library and to reduce potential naming conflicts.
+ */
+
 #ifndef _LIBPRI_H
 #define _LIBPRI_H
 
@@ -137,44 +144,44 @@
 #define PRI_UNKNOWN					0x0
 
 /* Presentation */
-#define PRES_NUMBER_TYPE					0x03
-#define PRES_USER_NUMBER_UNSCREENED			0x00
-#define PRES_USER_NUMBER_PASSED_SCREEN		0x01
-#define PRES_USER_NUMBER_FAILED_SCREEN		0x02
-#define PRES_NETWORK_NUMBER					0x03
-
-#define PRES_RESTRICTION					0x60
-#define PRES_ALLOWED						0x00
-#define PRES_RESTRICTED						0x20
-#define PRES_UNAVAILABLE					0x40
-#define PRES_RESERVED						0x60
+#define PRI_PRES_NUMBER_TYPE				0x03
+#define PRI_PRES_USER_NUMBER_UNSCREENED		0x00
+#define PRI_PRES_USER_NUMBER_PASSED_SCREEN	0x01
+#define PRI_PRES_USER_NUMBER_FAILED_SCREEN	0x02
+#define PRI_PRES_NETWORK_NUMBER				0x03
+
+#define PRI_PRES_RESTRICTION				0x60
+#define PRI_PRES_ALLOWED					0x00
+#define PRI_PRES_RESTRICTED					0x20
+#define PRI_PRES_UNAVAILABLE				0x40
+#define PRI_PRES_RESERVED					0x60
 
 #define PRES_ALLOWED_USER_NUMBER_NOT_SCREENED \
-	(PRES_ALLOWED | PRES_USER_NUMBER_UNSCREENED)
+	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_UNSCREENED)
 
 #define PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN \
-	(PRES_ALLOWED | PRES_USER_NUMBER_PASSED_SCREEN)
+	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_PASSED_SCREEN)
 
 #define PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN \
-	(PRES_ALLOWED | PRES_USER_NUMBER_FAILED_SCREEN)
+	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_FAILED_SCREEN)
 
 #define PRES_ALLOWED_NETWORK_NUMBER	\
-	(PRES_ALLOWED | PRES_NETWORK_NUMBER)
+	(PRI_PRES_ALLOWED | PRI_PRES_NETWORK_NUMBER)
 
 #define PRES_PROHIB_USER_NUMBER_NOT_SCREENED \
-	(PRES_RESTRICTED | PRES_USER_NUMBER_UNSCREENED)
+	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_UNSCREENED)
 
 #define PRES_PROHIB_USER_NUMBER_PASSED_SCREEN \
-	(PRES_RESTRICTED | PRES_USER_NUMBER_PASSED_SCREEN)
+	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_PASSED_SCREEN)
 
 #define PRES_PROHIB_USER_NUMBER_FAILED_SCREEN \
-	(PRES_RESTRICTED | PRES_USER_NUMBER_FAILED_SCREEN)
+	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_FAILED_SCREEN)
 
 #define PRES_PROHIB_NETWORK_NUMBER \
-	(PRES_RESTRICTED | PRES_NETWORK_NUMBER)
+	(PRI_PRES_RESTRICTED | PRI_PRES_NETWORK_NUMBER)
 
 #define PRES_NUMBER_NOT_AVAILABLE \
-	(PRES_UNAVAILABLE | PRES_NETWORK_NUMBER)
+	(PRI_PRES_UNAVAILABLE | PRI_PRES_NETWORK_NUMBER)
 
 /* Causes for disconnection */
 #define PRI_CAUSE_UNALLOCATED					1

Modified: team/rmudgett/facility/pri_facility.c
URL: http://svn.digium.com/svn-view/libpri/team/rmudgett/facility/pri_facility.c?view=diff&rev=751&r1=750&r2=751
==============================================================================
--- team/rmudgett/facility/pri_facility.c (original)
+++ team/rmudgett/facility/pri_facility.c Fri Apr 17 12:02:43 2009
@@ -334,22 +334,22 @@
 {
 	int value;
 
-	switch (presentation & PRES_RESTRICTION) {
-	case PRES_ALLOWED:
+	switch (presentation & PRI_PRES_RESTRICTION) {
+	case PRI_PRES_ALLOWED:
 		value = 0;	/* presentationAllowed<Number/Address> */
 		break;
 	default:
 		pri_message(ctrl, "!! Unsupported Q.931 number presentation value (%d)\n",
 			presentation);
 		/* fall through */
-	case PRES_RESTRICTED:
+	case PRI_PRES_RESTRICTED:
 		if (number_present) {
 			value = 3;	/* presentationRestricted<Number/Address> */
 		} else {
 			value = 1;	/* presentationRestricted */
 		}
 		break;
-	case PRES_UNAVAILABLE:
+	case PRI_PRES_UNAVAILABLE:
 		value = 2;	/* numberNotAvailableDueToInterworking */
 		break;
 	}
@@ -373,7 +373,7 @@
 
 	switch (presentation) {
 	case 0:	/* presentationAllowed<Number/Address> */
-		value = PRES_ALLOWED;
+		value = PRI_PRES_ALLOWED;
 		break;
 	default:
 		pri_message(ctrl,
@@ -382,10 +382,10 @@
 		/* fall through */
 	case 1:	/* presentationRestricted */
 	case 3:	/* presentationRestricted<Number/Address> */
-		value = PRES_RESTRICTED;
+		value = PRI_PRES_RESTRICTED;
 		break;
 	case 2:	/* numberNotAvailableDueToInterworking */
-		value = PRES_UNAVAILABLE;
+		value = PRI_PRES_UNAVAILABLE;
 		break;
 	}
 
@@ -1770,7 +1770,7 @@
 		}
 		call->redirectingreason = redirectingreason_for_q931(ctrl,
 			invoke->args.qsig.DivertingLegInformation2.diversion_reason);
-		call->redirectingpres = PRES_UNAVAILABLE;
+		call->redirectingpres = PRI_PRES_UNAVAILABLE;
 		call->redirectingnum[0] = '\0';
 		call->redirectingplan = (PRI_TON_UNKNOWN << 4) | PRI_NPI_E163_E164;
 		if (invoke->args.qsig.DivertingLegInformation2.diverting_present) {




More information about the libpri-commits mailing list