/[dgee]/dgee/dbstore/listOwners.c
ViewVC logotype

Diff of /dgee/dbstore/listOwners.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by csmith, Mon May 12 20:48:22 2003 UTC revision 1.2 by csmith, Sun Sep 21 10:48:17 2003 UTC
# Line 0  Line 1 
1    #include <stdio.h>
2    #include <stdlib.h>
3    
4    #include "dgBDB.h"
5    
6    #define DBSTORE_WANT_DETAILS 1
7    
8    #include "ownerTable.h"
9    
10    /* ------------------------------------------------------------------------- */
11    
12    int
13    main()
14    {
15            char *dbh = NULL;
16    
17            dbRow       tRow;
18            dbOwnerKey  tKey;
19            dbOwnerData tData;
20            dbRowItterator dbi;
21    
22            dgdb_configure( "/tmp/dgeeDB" );
23    
24        if( dgadm_initialiseOwnerDB() < 0 ) {
25                    printf( "Cannot init owner db\n" );
26            }
27    
28            if( (dbh = dgdb_open_db( "owner", 1 )) == NULL ) {
29                    printf( "Failed to open database\n" );
30                    exit(1);
31            }
32    
33            tKey.ownerName[0] = '\0';
34            SET_ROW_KEY(tRow, tKey);
35            SET_ROW_DATA(tRow, tData);
36    
37            printf( "Users known to the DGEE:\n" );
38            if( dgdb_get_first( &tRow, dbh, &dbi, NULL ) > 0 ) {
39                    do {
40                  printf("%s (%s) <%s>\n", tKey.ownerName, tData.realName, tData.email );
41                    } while( dgdb_get_next( &tRow, dbh, &dbi, NULL ) > 0 );
42            }
43    
44            dgdb_close_itterator( &dbi );
45    
46            dgdb_close_db( dbh );
47    
48            exit(0);
49    }
50    
51    /* ------------------------------------------------------------------------- */
52    /* end */

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26