Opened 10 years ago

Closed 10 years ago

Last modified 10 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)

in reply to:  description ; comment:1 by martinl, 10 years ago

Replying to martinl:

Rast_segment_open()

Or

Segment_segment_open()

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

in reply to:  1 ; comment:2 by martinl, 10 years ago

Replying to martinl:

Segment_segment_open()

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

I meant

Segment_open()

in reply to:  2 comment:3 by martinl, 10 years ago

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()

in reply to:  2 ; comment:4 by mmetz, 10 years ago

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.

in reply to:  4 comment:5 by martinl, 10 years ago

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 by neteler, 10 years ago

I have updated trunk accordingly in r62324.

TODO: backport if all is ok and update Addons.

in reply to:  6 comment:7 by neteler, 10 years ago

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 by neteler, 10 years ago

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

Note: See TracTickets for help on using tickets.