@@ -883,6 +883,48 @@ static PyObject* Reader_seek_monotonic(Reader *self, PyObject *args) {
883883 Py_RETURN_NONE ;
884884}
885885
886+ PyDoc_STRVAR (Reader_get_start__doc__ ,
887+ "get_start() -> int\n\n"
888+ "Return the realtime timestamp of the first journal entry\n\n"
889+ "in microseconds.\n\n"
890+ "Wraps sd_journal_get_cutoff_realtime_usec().\n"
891+ "See :manpage:`sd_journal_get_cutoff_realtime_usec(3)`." );
892+ static PyObject * Reader_get_start (Reader * self , PyObject * args ) {
893+ uint64_t start ;
894+ int r ;
895+
896+ assert (self );
897+ assert (!args );
898+
899+ r = sd_journal_get_cutoff_realtime_usec (self -> j , & start , NULL );
900+ if (set_error (r , NULL , NULL ) < 0 )
901+ return NULL ;
902+
903+ assert_cc (sizeof (unsigned long long ) == sizeof (start ));
904+ return PyLong_FromUnsignedLongLong (start );
905+ }
906+
907+ PyDoc_STRVAR (Reader_get_end__doc__ ,
908+ "get_end() -> int\n\n"
909+ "Return the realtime timestamp of the last journal entry\n\n"
910+ "in microseconds.\n\n"
911+ "Wraps sd_journal_get_cutoff_realtime_usec().\n"
912+ "See :manpage:`sd_journal_get_cutoff_realtime_usec(3)`." );
913+ static PyObject * Reader_get_end (Reader * self , PyObject * args ) {
914+ uint64_t end ;
915+ int r ;
916+
917+ assert (self );
918+ assert (!args );
919+
920+ r = sd_journal_get_cutoff_realtime_usec (self -> j , NULL , & end );
921+ if (set_error (r , NULL , NULL ) < 0 )
922+ return NULL ;
923+
924+ assert_cc (sizeof (unsigned long long ) == sizeof (end ));
925+ return PyLong_FromUnsignedLongLong (end );
926+ }
927+
886928
887929PyDoc_STRVAR (Reader_process__doc__ ,
888930 "process() -> state change (integer)\n\n"
@@ -1278,6 +1320,8 @@ static PyMethodDef Reader_methods[] = {
12781320 {"seek_tail" , (PyCFunction ) Reader_seek_tail , METH_NOARGS , Reader_seek_tail__doc__ },
12791321 {"seek_realtime" , (PyCFunction ) Reader_seek_realtime , METH_VARARGS , Reader_seek_realtime__doc__ },
12801322 {"seek_monotonic" , (PyCFunction ) Reader_seek_monotonic , METH_VARARGS , Reader_seek_monotonic__doc__ },
1323+ {"_get_start" , (PyCFunction ) Reader_get_start , METH_NOARGS , Reader_get_start__doc__ },
1324+ {"_get_end" , (PyCFunction ) Reader_get_end , METH_NOARGS , Reader_get_end__doc__ },
12811325 {"process" , (PyCFunction ) Reader_process , METH_NOARGS , Reader_process__doc__ },
12821326 {"wait" , (PyCFunction ) Reader_wait , METH_VARARGS , Reader_wait__doc__ },
12831327 {"seek_cursor" , (PyCFunction ) Reader_seek_cursor , METH_VARARGS , Reader_seek_cursor__doc__ },
0 commit comments