Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#2422 closed task (fixed)

Functions from Segment lib have no prefix

Reported by: martinl Owned by: grass-dev@…
Priority: blocker Milestone: 7.0.0
Component: LibRaster Version: unspecified
Keywords: segmentlib, api, prefix Cc:
CPU: Unspecified Platform: Unspecified

Description

In contrast to other GRASS libs, Segment lib (1) doesn't use any prefix. I would suggest to change eg.

segment_open()

to

Rast_segment_open()

Any option? Marked as blocker since it's API change.

(1) http://grass.osgeo.org/programming7/segmentlib.html

Change History (8)

comment:1 in reply to:  description ; Changed 6 years ago by martinl

Replying to martinl:

Rast_segment_open()

Or

Segment_segment_open()

inspired by Row Input/Output? Library, http://grass.osgeo.org/programming7/rowiolib.html

comment:2 in reply to:  1 ; Changed 6 years ago by martinl

Replying to martinl:

Segment_segment_open()

inspired by Row Input/Output? Library, http://grass.osgeo.org/programming7/rowiolib.html

I meant

Segment_open()

comment:3 in reply to:  2 Changed 6 years ago by martinl

Replying to martinl:

Replying to martinl:

inspired by Row Input/Output? Library, http://grass.osgeo.org/programming7/rowiolib.html

from this point of view, we could rename function in this library to eg.

Rowio_get() -> Rast_rowio_get()

and

segment_open() -> Rast_segment_open()

comment:4 in reply to:  2 ; Changed 6 years ago by mmetz

Replying to martinl:

In contrast to other GRASS libs, Segment lib (1) doesn't use any prefix.

The prefix used by the segment lib is "segment_".

I would suggest to change eg.

segment_open()

to

Replying to martinl:

Segment_open()

So you mean to change the first letter of the prefix to upper case?

E.g. "Rast_segment_open" does not make sense to me because the segment library is standalone and not part of the raster library.

Currently library functions for each library have their own prefix (that happened also when splitting gis lib in gis lib and raster lib). This convention makes work for developers easier and I would suggest to keep it. Thus e.g. "Rowio_get()" is just fine, no need to mask it as a raster lib function, it is a rowio lib function.

comment:5 in reply to:  4 Changed 6 years ago by martinl

Replying to mmetz:

> Segment_open()

So you mean to change the first letter of the prefix to upper case?

yes, it's consistent with prefixes from other GRASS libs which are upper-case. If no objection I will do this change within the next days.

comment:6 Changed 6 years ago by neteler

I have updated trunk accordingly in r62324.

TODO: backport if all is ok and update Addons.

comment:7 in reply to:  6 Changed 6 years ago by neteler

Resolution: fixed
Status: newclosed

Replying to neteler:

TODO: backport if all is ok and update Addons.

Done in r62336 (relbr7) and r62337 (G7 Addons). Closing.

comment:8 Changed 6 years ago by neteler

For the record: r62372 and r62373 (separate internal and external functions)

Note: See TracTickets for help on using tickets.