write_XLI

# write_XLI Write a model to a file via the External Language Interface. unsigned char write_XLI(lprec *lp, char *filename, char *options, unsigned char results); Return Value write_XLI returns TRUE (1) if the operation was successful. A return value of FALSE (0) indicates an error. Parameters lp Pointer to previously created lp model. See return value of make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI filename Filename to write the model to. options Extra options that can be used by the writer. results FALSE to generate a model file and TRUE to generate a solution file. Remarks The write_XLI function writes the model to filename via the External Language Interface. Note that set_XLI must be called before this routine to set an XLI. See External Language Interfaces for a complete description on XLIs. Example
    #include <stdio.h>
    #include <stdlib.h>
    #include "lp_lib.h"
    int main(void)
    {
      lprec *lp;

      /* Create a new LP model */
      lp = make_lp(0, 0);
      if(lp == NULL) {
        fprintf(stderr, "Unable to create new LP model\n");
        return(1);
      }

      set_XLI(lp, "xli_MathProg");

      write_XLI(lp, "model.mod", "", FALSE);

      delete_lp(lp);
      return(0);
    }
lp_solve API reference See Also delete_lp, free_lp, make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, write_mps, write_freemps, write_MPS, write_freeMPS, MPS_writefileex, read_XLI, has_XLI, is_nativeXLI, set_XLI