Exemple #1
0
 public static byte AndAllMembers([DNNE.C99Type("struct bool_struct*")] BoolStructNative_V1* pArray, int length)
 {
     bool result = true;
     for (int i = 0; i < length; i++)
     {
         BoolStruct_V1 managed = pArray[i].ToManaged();
         result &= managed.b1 && managed.b2 && managed.b3;
     }
     return (byte)(result ? 1 : 0);
 }
Exemple #2
0
 public static void NegateBools(
     [DNNE.C99Type("struct bool_struct")] BoolStructNative_V1 boolStruct,
     [DNNE.C99Type("struct bool_struct*")] BoolStructNative_V1 *pBoolStructOut)
 {
     *pBoolStructOut = new BoolStructNative_V1
     {
         b1 = (byte)(boolStruct.b1 != 0 ? 0 : 1),
         b2 = (byte)(boolStruct.b2 != 0 ? 0 : 1),
         b3 = (byte)(boolStruct.b3 != 0 ? 0 : 1),
     };
 }
Exemple #3
0
 public static byte AndBoolsRef(
     [DNNE.C99Type("struct bool_struct*")] BoolStructNative_V1 *boolStruct)
 {
     return((byte)(boolStruct->b1 != 0 && boolStruct->b2 != 0 && boolStruct->b3 != 0 ? 1 : 0));
 }