+ if (lnofile) {
+ uint32_t lnotype = *(unsigned int*)"LNOF";
+ uint32_t version = 1;
+
+ fp = util_fopen(lnofile, "wb");
+ if (!fp)
+ return false;
+
+ if (fwrite(&lnotype, sizeof(lnotype), 1, fp) != 1 ||
+ fwrite(&version, sizeof(version), 1, fp) != 1 ||
+ fwrite(&code_header.defs.length, sizeof(code_header.defs.length), 1, fp) != 1 ||
+ fwrite(&code_header.globals.length, sizeof(code_header.globals.length), 1, fp) != 1 ||
+ fwrite(&code_header.fields.length, sizeof(code_header.fields.length), 1, fp) != 1 ||
+ fwrite(&code_header.statements.length, sizeof(code_header.statements.length), 1, fp) != 1 ||
+ fwrite(code_linenums, sizeof(code_linenums[0]), vec_size(code_linenums), fp) != vec_size(code_linenums))
+ {
+ con_err("failed to write lno file\n");
+ }
+ /*
+ h = SafeOpenWrite (destfile, 2*1024*1024);
+ SafeWrite (h, &lnotype, sizeof(int));
+ SafeWrite (h, &version, sizeof(int));
+ SafeWrite (h, &numglobaldefs, sizeof(int));
+ SafeWrite (h, &numpr_globals, sizeof(int));
+ SafeWrite (h, &numfielddefs, sizeof(int));
+ SafeWrite (h, &numstatements, sizeof(int));
+ SafeWrite (h, statement_linenums, numstatements*sizeof(int));
+ SafeClose (h);
+ */
+
+ fclose(fp);
+ fp = NULL;
+ }
+