Git Product home page Git Product logo

Comments (8)

czender avatar czender commented on May 22, 2024

i'm glad you checked-in on this. please do not modify ncks.c. the task is to modify the multi-argument (MTA) code that you already wrote. and that is initialized in the rgr, sld, trr routines. we need that routine to handle flags. ncks already does (because getopt() does). but your MTA does not. the hard-coded flags will mostly be for rgr so that nco_rgr_ini() can do the right thing. any hardcoded flags should go there or in the MTA source code.

from nco.

FlyingWithJerome avatar FlyingWithJerome commented on May 22, 2024

I'm thinking on this way as well. I just read through the ncks.c to understand the mechanism of ncks and saw that these flags had already been hardcoded in

static struct option opt_lng[];

Unfortunately it is static and in main().

Also, seems NCO has different streams of processing on key-value pairs and flags.

Flags are level-1 arguments, which are processed prior to the kv pair (kv pairs are level-2 arguments, because we need at least one flag to let ncks know what are these kv pairs for). These flags had already been picked up by ncks.c way before the nco_rgr_ini() is called -- at the very beginning of the huge infinite loop. If the flags come with rgr, trr or gaa key-value pairs, then where should we pass them to?

from nco.

czender avatar czender commented on May 22, 2024

Yes, NCO has two levels of input processing. Do not concern yourself with the ncks.c front end. The task for you is to allow MTA to parse flags. Put a hard-coded list of flags either in nco_arg_mlt_prs() or in a calling routine like nco_rgr_ini(), whichever seems more elegant/maintainable/extensible.

from nco.

FlyingWithJerome avatar FlyingWithJerome commented on May 22, 2024

@czender
I mean I'm curious about how to pass the flags, since the flags had already been parsed before nco_rgr_ini() is called in the main loop.
Or the flags can be passed like a key-value pair but with a NULL value?

from nco.

czender avatar czender commented on May 22, 2024

everything will still be passed through rgr_arg into nco_rgr_ini(). ncks.c does not need to be modified. period. trace the code to see what happens now with --rgr arguments.

from nco.

FlyingWithJerome avatar FlyingWithJerome commented on May 22, 2024

@czender
It may take some extra time since both Valgrind and gdb are down on my Mac due to the OS version. Rebuilding with other versions also failed; it is catastrophic. I need to squeeze my disk so that I can have enough space to set up a Linux virtual machine as a new environment

from nco.

FlyingWithJerome avatar FlyingWithJerome commented on May 22, 2024

@czender
Here is the list of the rgr/gaa/trr/ppc flags I concluded from the source code. No gaa/ppc/trr flags so far. I will hard code these flags to nco_mta.c so that in the future we can have a place to add/remove and keep track on these flags.

flag gaa/trr/ppc/rgr
--no_area rgr
--no_area_out rgr
--cell_measures rgr
--cll_msr rgr
--no_cell_measures rgr
--no_cll_msr rgr
--curvilinear rgr
--crv rgr
--infer rgr
--nfr rgr
--no_stagger rgr
--no_stg rgr

from nco.

czender avatar czender commented on May 22, 2024

This patch is in an working in 4.6.7

from nco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.