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