rotateLogFile method

String rotateLogFile()

Rotate the logging file

Implementation

String rotateLogFile() {
  final tmp0 = _rotateLogFile();
  final tmp2 = tmp0.arg0;
  final tmp3 = tmp0.arg1;
  final tmp4 = tmp0.arg2;
  final tmp5 = tmp0.arg3;
  final tmp6 = tmp0.arg4;
  final tmp7 = tmp0.arg5;
  final tmp8 = tmp0.arg6;
  if (tmp2 == 0) {
    debugAllocation("handle error", tmp3, tmp4);
    final ffi.Pointer<ffi.Uint8> tmp3_0 = ffi.Pointer.fromAddress(tmp3);
    final tmp2_0 =
        utf8.decode(tmp3_0.asTypedList(tmp4), allowMalformed: true);
    if (tmp4 > 0) {
      final ffi.Pointer<ffi.Void> tmp3_0;
      tmp3_0 = ffi.Pointer.fromAddress(tmp3);
      this.__deallocate(tmp3_0, tmp5, 1);
    }
    throw tmp2_0;
  }
  if (tmp7 == 0) {
    print("returning empty string");
    return "";
  }
  final ffi.Pointer<ffi.Uint8> tmp6_ptr = ffi.Pointer.fromAddress(tmp6);
  List<int> tmp6_buf = [];
  final tmp6_precast = tmp6_ptr.cast<ffi.Uint8>();
  for (int i = 0; i < tmp7; i++) {
    int char = tmp6_precast.elementAt(i).value;
    tmp6_buf.add(char);
  }
  final tmp1 = utf8.decode(tmp6_buf, allowMalformed: true);
  if (tmp8 > 0) {
    final ffi.Pointer<ffi.Void> tmp6_0;
    tmp6_0 = ffi.Pointer.fromAddress(tmp6);
    this.__deallocate(tmp6_0, tmp8 * 1, 1);
  }
  return tmp1;
}