{-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# Language ForeignFunctionInterface #-} {-# Language FlexibleInstances #-} {-# Language MultiParamTypeClasses #-} module Casadi.Core.Classes.NlpBuilder ( NlpBuilder, NlpBuilderClass(..), nlpBuilder_getDescription, nlpBuilder_getRepresentation, nlpBuilder_parseNL__0, nlpBuilder_parseNL__1, ) where import Prelude hiding ( Functor ) import Data.Vector ( Vector ) import qualified Data.Map as M import Foreign.C.Types import Foreign.Marshal ( new, free ) import Foreign.Storable ( peek ) import Foreign.Ptr ( Ptr, nullPtr ) import Foreign.ForeignPtr ( newForeignPtr ) import System.IO.Unsafe ( unsafePerformIO ) -- for show instances import Casadi.Internal.FormatException ( formatException ) import Casadi.Internal.MarshalTypes ( StdVec, StdString, StdMap, StdPair ) -- StdPair StdOstream' import Casadi.Internal.Marshal ( Marshal(..), withMarshal ) import Casadi.Internal.WrapReturn ( WrapReturn(..) ) import Casadi.Core.Data import Casadi.Core.Enums -- direct wrapper foreign import ccall unsafe "casadi__NlpBuilder__parseNL__0" c_casadi__NlpBuilder__parseNL__0 :: Ptr (Ptr StdString) -> Ptr NlpBuilder' -> Ptr StdString -> IO () casadi__NlpBuilder__parseNL__0 :: NlpBuilder -> String -> IO () casadi__NlpBuilder__parseNL__0 x0 x1 = withMarshal x0 $ \x0' -> withMarshal x1 $ \x1' -> do errStrPtrP <- new nullPtr ret <- c_casadi__NlpBuilder__parseNL__0 errStrPtrP x0' x1' errStrPtr <- peek errStrPtrP free errStrPtrP if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException) -- classy wrapper nlpBuilder_parseNL__0 :: NlpBuilderClass a => a -> String -> IO () nlpBuilder_parseNL__0 x = casadi__NlpBuilder__parseNL__0 (castNlpBuilder x) -- direct wrapper foreign import ccall unsafe "casadi__NlpBuilder__parseNL__1" c_casadi__NlpBuilder__parseNL__1 :: Ptr (Ptr StdString) -> Ptr NlpBuilder' -> Ptr StdString -> Ptr (StdMap StdString (Ptr GenericType')) -> IO () casadi__NlpBuilder__parseNL__1 :: NlpBuilder -> String -> M.Map String GenericType -> IO () casadi__NlpBuilder__parseNL__1 x0 x1 x2 = withMarshal x0 $ \x0' -> withMarshal x1 $ \x1' -> withMarshal x2 $ \x2' -> do errStrPtrP <- new nullPtr ret <- c_casadi__NlpBuilder__parseNL__1 errStrPtrP x0' x1' x2' errStrPtr <- peek errStrPtrP free errStrPtrP if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException) -- classy wrapper nlpBuilder_parseNL__1 :: NlpBuilderClass a => a -> String -> M.Map String GenericType -> IO () nlpBuilder_parseNL__1 x = casadi__NlpBuilder__parseNL__1 (castNlpBuilder x) -- direct wrapper foreign import ccall unsafe "casadi__NlpBuilder__getRepresentation" c_casadi__NlpBuilder__getRepresentation :: Ptr (Ptr StdString) -> Ptr NlpBuilder' -> IO (Ptr StdString) casadi__NlpBuilder__getRepresentation :: NlpBuilder -> IO String casadi__NlpBuilder__getRepresentation x0 = withMarshal x0 $ \x0' -> do errStrPtrP <- new nullPtr ret <- c_casadi__NlpBuilder__getRepresentation errStrPtrP x0' errStrPtr <- peek errStrPtrP free errStrPtrP if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException) -- classy wrapper nlpBuilder_getRepresentation :: NlpBuilderClass a => a -> IO String nlpBuilder_getRepresentation x = casadi__NlpBuilder__getRepresentation (castNlpBuilder x) -- direct wrapper foreign import ccall unsafe "casadi__NlpBuilder__getDescription" c_casadi__NlpBuilder__getDescription :: Ptr (Ptr StdString) -> Ptr NlpBuilder' -> IO (Ptr StdString) casadi__NlpBuilder__getDescription :: NlpBuilder -> IO String casadi__NlpBuilder__getDescription x0 = withMarshal x0 $ \x0' -> do errStrPtrP <- new nullPtr ret <- c_casadi__NlpBuilder__getDescription errStrPtrP x0' errStrPtr <- peek errStrPtrP free errStrPtrP if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException) -- classy wrapper nlpBuilder_getDescription :: NlpBuilderClass a => a -> IO String nlpBuilder_getDescription x = casadi__NlpBuilder__getDescription (castNlpBuilder x)